From 8a348ab1b5a9ef2e9b86be3a81827e11d638a67f Mon Sep 17 00:00:00 2001 From: fgsfds Date: Mon, 13 Nov 2023 21:07:53 +0100 Subject: [PATCH] port: fix bullet casings going behind the world --- src/game/bondgun.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/game/bondgun.c b/src/game/bondgun.c index c7b3b4048..efe979624 100644 --- a/src/game/bondgun.c +++ b/src/game/bondgun.c @@ -10918,6 +10918,7 @@ void bgunRender(Gfx **gdlptr) struct modelrenderdata renderdata = {NULL, true, 3}; // 10c struct player *player; s32 i; + const u32 wnorm = mtx00016dcc(0, 300); static bool renderhand = true; // var800702dc @@ -10983,7 +10984,7 @@ void bgunRender(Gfx **gdlptr) gSPLookAt(gdl++, camGetLookAt()); } - gSPPerspNormalize(gdl++, mtx00016dcc(0, 300)); + gSPPerspNormalize(gdl++, wnorm); // There is support for guns having a TV screen on them // but no guns have this model part so it's not used. @@ -11158,7 +11159,17 @@ void bgunRender(Gfx **gdlptr) } } +#ifndef PLATFORM_N64 + // put the casings into the same Z range as the gun + gSPPerspNormalize(gdl++, wnorm); +#endif + casingsRender(&gdl); + +#ifndef PLATFORM_N64 + gSPPerspNormalize(gdl++, viGetPerspScale()); +#endif + zbufSwap(); gdl = zbufConfigureRdp(gdl);