Fix JUT_ASSERT and several other macros (#2711)

* Fix JUT_ASSERT to be a nested define

* Switch names that appear in asserts to be constants instead of defines

* Replace `0` in asserts with `NULL` or `FALSE`

* Fix fpclassify

* Fix ARRAY_SIZE

* Use G_CM3D_F_INF

* More fixes for fpclassify

* Remove FLOAT_LABEL

* Remove incorrect FLAG_ON macro

* Remove UNK_BSS macro

* Silence clangd unused header warning for PCH
This commit is contained in:
LagoLunatic
2025-09-28 16:11:07 -04:00
committed by GitHub
parent 737250d7f5
commit 6ec6fce8cb
1008 changed files with 3172 additions and 3237 deletions
+9 -9
View File
@@ -3,7 +3,7 @@
*
*/
#include "d/dolzel_rel.h"
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_e_bg.h"
#include "SSystem/SComponent/c_math.h"
@@ -340,7 +340,7 @@ void daE_BG_c::executeSwim() {
{
if (!fopAcM_otherBgCheck(this, daPy_getPlayerActorClass())) {
if (daPy_getPlayerActorClass()->checkEquipHeavyBoots()) {
if (field_0x684 != -1e+09f) {
if (field_0x684 != -G_CM3D_F_INF) {
if (daPy_getPlayerActorClass()->current.pos.y < field_0x684 - 20.0f) {
setActionMode(2, 0);
return;
@@ -365,7 +365,7 @@ void daE_BG_c::executeSwim() {
switch (mMoveMode) {
case 0: {
field_0x660.y = home.pos.y + cM_rndFX(500.0f);
if (field_0x684 != -1e+09f && field_0x660.y > field_0x684 - 50.0f) {
if (field_0x684 != -G_CM3D_F_INF && field_0x660.y > field_0x684 - 50.0f) {
field_0x660.y = field_0x684 - 50.0f;
}
@@ -409,7 +409,7 @@ void daE_BG_c::executeSwim() {
cLib_addCalcAngleS(&field_0x6a0, 0xc00, 8, 0x400, 0x100);
if (speed.y > 0.0f && field_0x684 != -1e+09f && current.pos.y > field_0x684 - 50.0f) {
if (speed.y > 0.0f && field_0x684 != -G_CM3D_F_INF && current.pos.y > field_0x684 - 50.0f) {
mMoveMode = 3;
}
@@ -463,7 +463,7 @@ void daE_BG_c::executeAttack() {
if (mMoveMode <= 2) {
if (daPy_getPlayerActorClass()->checkEquipHeavyBoots()) {
if (field_0x684 != -1e+09f && playerPos.y >= field_0x684 - 20.0f) {
if (field_0x684 != -G_CM3D_F_INF && playerPos.y >= field_0x684 - 20.0f) {
setActionMode(1, 0);
return;
}
@@ -966,7 +966,7 @@ void daE_BG_c::executeEat() {
switch (this->mMoveMode) {
case 0:
field_0x660.y = rodPos.y + cM_rndFX(100.0f);
if (field_0x684 != -1e+09f && field_0x660.y > field_0x684 - 50.0f) {
if (field_0x684 != -G_CM3D_F_INF && field_0x660.y > field_0x684 - 50.0f) {
field_0x660.y = field_0x684 - 50.0f;
}
@@ -1164,7 +1164,7 @@ void daE_BG_c::action() {
fopAcM_posMoveF(this, mStts.GetCCMoveP());
if (field_0x684 != -1e+09f && current.pos.y > field_0x684 - 50.0f) {
if (field_0x684 != -G_CM3D_F_INF && current.pos.y > field_0x684 - 50.0f) {
current.pos.y = field_0x684 - 50.0f;
if (speed.y > 0.0f) {
speed.y = 0.0f;
@@ -1323,7 +1323,7 @@ static int daE_BG_Delete(daE_BG_c* i_this) {
/* 80689A0C-80689BD0 0042EC 01C4+00 1/1 0/0 0/0 .text CreateHeap__8daE_BG_cFv */
int daE_BG_c::CreateHeap() {
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("E_BG", 10);
JUT_ASSERT(0, modelData != 0);
JUT_ASSERT(0, modelData != NULL);
mpMorfSO = new mDoExt_McaMorfSO(modelData, NULL, NULL,
(J3DAnmTransform*)dComIfG_getObjectRes("E_BG", 7), 0, 1.0f, 0,
@@ -1426,7 +1426,7 @@ int daE_BG_c::create() {
gndChkSpl.SetPos(&gndChkPos);
field_0x684 = dComIfG_Bgsp().GroundCross(&gndChkSpl);
if (field_0x684 != -1e+09f && current.pos.y > field_0x684 - 50.0f) {
if (field_0x684 != -G_CM3D_F_INF && current.pos.y > field_0x684 - 50.0f) {
current.pos.y = field_0x684 - 50.0f;
}