port: fix s32 pointer in bgRenderRoomPass

This commit is contained in:
fgsfds 2023-08-16 14:52:25 +02:00
parent fedcbb8917
commit 034ff984cc
1 changed files with 5 additions and 0 deletions

View File

@ -3174,8 +3174,13 @@ Gfx *bgRenderRoomPass(Gfx *gdl, s32 roomnum, struct roomblock *block, bool arg3)
v0 = (uintptr_t)g_Rooms[roomnum].colours;
if (v0 != NULL) {
#ifdef PLATFORM_N64
s32 addr = ALIGN8((uintptr_t)&g_Rooms[roomnum].gfxdata->vertices[g_Rooms[roomnum].gfxdata->numvertices]);
v0 += (((intptr_t)block->colours - addr) >> 2) * 4;
#else
uintptr_t addr = ALIGN8((uintptr_t)&g_Rooms[roomnum].gfxdata->vertices[g_Rooms[roomnum].gfxdata->numvertices]);
v0 += (((uintptr_t)block->colours - addr) >> 2) * 4;
#endif
} else {
v0 = (uintptr_t)block->colours;
}