mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-24 00:02:43 +02:00
port: slightly simpler fix for bgTestHitOnObj
This commit is contained in:
1 parent
83c5b4980b
commit
5df6d2fdfb
1 file changed
+3
-7
+3
-7
@@ -3659,23 +3659,19 @@ bool bgTestHitOnObj(struct coord *arg0, struct coord *arg1, struct coord *arg2,
|
||||
} else if (gdl->dma.cmd == G_VTX) {
|
||||
ptr = var800a6470;
|
||||
count = gdl->bytes[GFX_W0_BYTE(1)] & 0xf;
|
||||
numvertices = (((u32) gdl->bytes[GFX_W0_BYTE(1)] >> 4) & 0xf) + 1;
|
||||
|
||||
#ifdef PLATFORM_N64
|
||||
offset = (UNSEGADDR(gdl->words.w1) & 0xffffff);
|
||||
vtx = (Vtx *)((uintptr_t)vertices + offset);
|
||||
#else
|
||||
if (gdl->words.w1 & 1) {
|
||||
// segmented address
|
||||
offset = (UNSEGADDR(gdl->words.w1) & 0xffffff);
|
||||
vtx = (Vtx *)((uintptr_t)vertices + offset);
|
||||
} else {
|
||||
// linear address
|
||||
offset = 0;
|
||||
vtx = (Vtx *)gdl->words.w1;
|
||||
offset = gdl->words.w1 - (uintptr_t)vertices;
|
||||
}
|
||||
#endif
|
||||
|
||||
numvertices = (((u32) gdl->bytes[GFX_W0_BYTE(1)] >> 4) & 0xf) + 1;
|
||||
vtx = (Vtx *)((uintptr_t)vertices + offset);
|
||||
vtx -= count;
|
||||
|
||||
ptr[0] = vtx->x;
|
||||
|
||||
Reference in new issue
Block a user