diff options
| author | RevoSucks <projectrevotpp@hotmail.com> | 2023-11-09 23:10:08 -0500 |
|---|---|---|
| committer | RevoSucks <projectrevotpp@hotmail.com> | 2023-11-09 23:10:08 -0500 |
| commit | d60d163f554fc7f795e8ed75c3d40b537dd7ad3b (patch) | |
| tree | 28b9051bae98ce9c7848643955c68a886465f4ba /src/code | |
| parent | 3536286a2028f6edf9b3611fc3f36d1c57fc859e (diff) | |
fix ugly union hack with less fake code
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_collision_check.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 284452f05..1dc4181f8 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -1250,12 +1250,13 @@ ColChkResetFunc sOCResetFuncs[] = { Collider_ResetQuadOC, Collider_ResetSphereOC, }; -union TriNorm2 { - u8 raw[2][0x38]; // HAAAAAACK. IDO PLEASE FUCKING STOP ADDING +4. TRINORM IS 0x34 WHICH MEANS 0x34*2 IS 0x68 YOU DUMBASS - TriNorm norm1[2]; +struct TriNorm2 { + TriNorm norm1; + u8 pad[4]; + TriNorm norm2; }; -union TriNorm2 D_801EE6C8; +struct TriNorm2 D_801EE6C8; /** * Sets collider as an OC (object collider) for the current frame, allowing it to detect other OCs. @@ -2667,11 +2668,11 @@ void CollisionCheck_AC_SphereVsQuad(PlayState* play, CollisionCheckContext* colC return; } - Math3D_TriNorm((void*)&D_801EE6C8.raw[0], &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]); - Math3D_TriNorm((void*)&D_801EE6C8.raw[1], &ac->dim.quad[1], &ac->dim.quad[0], &ac->dim.quad[2]); + Math3D_TriNorm(&D_801EE6C8.norm1, &ac->dim.quad[2], &ac->dim.quad[3], &ac->dim.quad[1]); + Math3D_TriNorm(&D_801EE6C8.norm2, &ac->dim.quad[1], &ac->dim.quad[0], &ac->dim.quad[2]); - if (Math3D_TriVsSphIntersect(&at->dim.worldSphere, (void*)&D_801EE6C8.raw[0], &hitPos) != 0 || - Math3D_TriVsSphIntersect(&at->dim.worldSphere, (void*)&D_801EE6C8.raw[1], &hitPos) != 0) { + if (Math3D_TriVsSphIntersect(&at->dim.worldSphere, &D_801EE6C8.norm1, &hitPos) != 0 || + Math3D_TriVsSphIntersect(&at->dim.worldSphere, &D_801EE6C8.norm2, &hitPos) != 0) { Vec3f atPos; Vec3f acPos; |
