summaryrefslogtreecommitdiff
path: root/libs/SSystem
diff options
context:
space:
mode:
authorhatal175 <hatal175@users.noreply.github.com>2023-02-23 17:41:05 +0200
committerGitHub <noreply@github.com>2023-02-23 08:41:05 -0700
commit4df6e8edea459eea6b13a0aa5c348d457d15edd5 (patch)
tree2b1a9fe520310953c358dfdf92e1c8475ec8bf62 /libs/SSystem
parentfa1f47f7a134cdc203207ec0b273ca7d32542d52 (diff)
Various matches and improvements (#299)
* Various matches and improvements * Remove unnecessary comment
Diffstat (limited to 'libs/SSystem')
-rw-r--r--libs/SSystem/SComponent/c_m3d.cpp34
1 files changed, 15 insertions, 19 deletions
diff --git a/libs/SSystem/SComponent/c_m3d.cpp b/libs/SSystem/SComponent/c_m3d.cpp
index 6fd69c5e49..28dda82caa 100644
--- a/libs/SSystem/SComponent/c_m3d.cpp
+++ b/libs/SSystem/SComponent/c_m3d.cpp
@@ -314,35 +314,31 @@ bool cM3d_Cross_AabCyl(const cM3dGAab* pAab, const cM3dGCyl* pCyl) {
/* 80268BB4-80268C5C 2634F4 00A8+00 0/0 2/2 0/0 .text cM3d_Cross_AabSph__FPC8cM3dGAabPC8cM3dGSph
*/
-#ifdef NONMATCHING
bool cM3d_Cross_AabSph(const cM3dGAab* pAab, const cM3dGSph* pSph) {
f32 radius = pSph->GetR();
- if (pAab->GetMinX() > pSph->GetC().x + radius) { // addition registers are flipped
+ f32 cx = pSph->GetC().x;
+ if (pAab->GetMinX() > cx + radius) {
return false;
- } else if (pAab->GetMaxX() < pSph->GetC().x - radius) {
+ }
+ else if (pAab->GetMaxX() < cx - radius) {
return false;
- } else if (pAab->GetMinZ() > pSph->GetC().z + radius) {
+ }
+
+ f32 cz = pSph->GetC().z;
+ if (pAab->GetMinZ() > cz + radius) {
return false;
- } else if (pAab->GetMaxZ() < pSph->GetC().z - radius) {
+ } else if (pAab->GetMaxZ() < cz - radius) {
return false;
- } else if (pAab->GetMinY() > pSph->GetC().y + radius) {
+ }
+
+ f32 cy = pSph->GetC().y;
+ if (pAab->GetMinY() > cy + radius) {
return false;
- } else if (pAab->GetMaxY() < pSph->GetC().y - radius) {
+ } else if (pAab->GetMaxY() < cy - radius) {
return false;
- } else {
- return true;
}
+ return true;
}
-#else
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm bool cM3d_Cross_AabSph(cM3dGAab const* param_0, cM3dGSph const* param_1) {
- nofralloc
-#include "asm/SSystem/SComponent/c_m3d/cM3d_Cross_AabSph__FPC8cM3dGAabPC8cM3dGSph.s"
-}
-#pragma pop
-#endif
/* 80268C5C-80268ED4 26359C 0278+00 3/3 0/0 0/0 .text
* cM3d_Check_LinLin__FPC8cM3dGLinPC8cM3dGLinPfPf */