From 0cc29d2c993473acad6b3540508b075e652ea33e Mon Sep 17 00:00:00 2001 From: fgsfds Date: Tue, 15 Aug 2023 00:16:25 +0200 Subject: [PATCH] port: fix healthbar rendering --- src/game/healthbar.c | 12 ++++++------ src/game/player.c | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/game/healthbar.c b/src/game/healthbar.c index 8df9d1909..3590c9410 100644 --- a/src/game/healthbar.c +++ b/src/game/healthbar.c @@ -449,7 +449,7 @@ Gfx *healthbarDraw(Gfx *gdl, struct chrdata *chr, s32 offyarg, f32 heightfracarg shieldvertices->colour = (i + i) << 2; shieldvertices++; - shieldcolours->word = colour; + shieldcolours->word = PD_BE32(colour); shieldcolours++; shieldvertices->x = (s32)marker->x2 + offx; @@ -458,7 +458,7 @@ Gfx *healthbarDraw(Gfx *gdl, struct chrdata *chr, s32 offyarg, f32 heightfracarg shieldvertices->colour = (i + i + 1) << 2; shieldvertices++; - shieldcolours->word = colour; + shieldcolours->word = PD_BE32(colour); shieldcolours++; } @@ -483,7 +483,7 @@ Gfx *healthbarDraw(Gfx *gdl, struct chrdata *chr, s32 offyarg, f32 heightfracarg armourvertices->colour = (i + i) << 2; armourvertices++; - armourcolours->word = colour; + armourcolours->word = PD_BE32(colour); armourcolours++; armourvertices->x = (s32)marker->x2 + offx; @@ -492,7 +492,7 @@ Gfx *healthbarDraw(Gfx *gdl, struct chrdata *chr, s32 offyarg, f32 heightfracarg armourvertices->colour = (i + i + 1) << 2; armourvertices++; - armourcolours->word = colour; + armourcolours->word = PD_BE32(colour); armourcolours++; } @@ -517,7 +517,7 @@ Gfx *healthbarDraw(Gfx *gdl, struct chrdata *chr, s32 offyarg, f32 heightfracarg traumavertices->colour = (i + i) << 2; traumavertices++; - traumacolours->word = colour; + traumacolours->word = PD_BE32(colour); traumacolours++; traumavertices->x = (s32)marker->x2 + offx; @@ -526,7 +526,7 @@ Gfx *healthbarDraw(Gfx *gdl, struct chrdata *chr, s32 offyarg, f32 heightfracarg traumavertices->colour = (i + i + 1) << 2; traumavertices++; - traumacolours->word = colour; + traumacolours->word = PD_BE32(colour); traumacolours++; } diff --git a/src/game/player.c b/src/game/player.c index d1a7a0897..5c1f5303e 100644 --- a/src/game/player.c +++ b/src/game/player.c @@ -2689,6 +2689,10 @@ Gfx *playerRenderHealthBar(Gfx *gdl) gDPSetCombineMode(gdl++, G_CC_SHADE, G_CC_SHADE); gDPSetPrimColorViaWord(gdl++, 0, 0, 0xe6e6e600); gSPClearGeometryMode(gdl++, G_CULL_BOTH); +#ifndef PLATFORM_N64 + // bug? + gSPClearGeometryMode(gdl++, G_ZBUFFER); +#endif gdl = healthbarDraw(gdl, NULL, 0, 0);