Explicit Template Types

u32 and the literal suffixes don't necessarily refer to the same type depending on compiler
This commit is contained in:
SuperDude88
2026-09-23 22:12:29 -04:00
parent b57c63423f
commit 7953486589
4 changed files with 31 additions and 31 deletions
+13 -13
View File
@@ -28,19 +28,19 @@ public:
typedef void (daNpc_kam_c::*EventActionInitFunc)(int evtStaffId);
typedef BOOL (daNpc_kam_c::*EventActionFunc)(int evtStaffId);
void offLineHit() { cLib_offBit(mHitFlags, 0x07UL); }
void onFrontLineHit() { cLib_onBit(mHitFlags, 0x01UL); }
u32 isFrontLineHit() { return cLib_checkBit(mHitFlags, 0x01UL); }
void onLeftLineHit() { cLib_onBit(mHitFlags, 0x02UL); }
u32 isLeftLineHit() { return cLib_checkBit(mHitFlags, 0x02UL); }
void onRightLineHit() { cLib_onBit(mHitFlags, 0x04UL); }
u32 isRightLineHit() { return cLib_checkBit(mHitFlags, 0x04UL); }
void onWaterHit() { cLib_onBit(mHitFlags, 0x08UL); }
void offWaterHit() { cLib_offBit(mHitFlags, 0x08UL); }
u32 isWaterHit() { return cLib_checkBit(mHitFlags, 0x08UL); }
void onNoBgCheck() { cLib_onBit(mHitFlags, 0x10UL); }
void offNoBgCheck() { cLib_offBit(mHitFlags, 0x10UL); }
u32 isNoBgCheck() { return cLib_checkBit(mHitFlags, 0x10UL); }
void offLineHit() { cLib_offBit<u32>(mHitFlags, 0x07UL); }
void onFrontLineHit() { cLib_onBit<u32>(mHitFlags, 0x01UL); }
u32 isFrontLineHit() { return cLib_checkBit<u32>(mHitFlags, 0x01UL); }
void onLeftLineHit() { cLib_onBit<u32>(mHitFlags, 0x02UL); }
u32 isLeftLineHit() { return cLib_checkBit<u32>(mHitFlags, 0x02UL); }
void onRightLineHit() { cLib_onBit<u32>(mHitFlags, 0x04UL); }
u32 isRightLineHit() { return cLib_checkBit<u32>(mHitFlags, 0x04UL); }
void onWaterHit() { cLib_onBit<u32>(mHitFlags, 0x08UL); }
void offWaterHit() { cLib_offBit<u32>(mHitFlags, 0x08UL); }
u32 isWaterHit() { return cLib_checkBit<u32>(mHitFlags, 0x08UL); }
void onNoBgCheck() { cLib_onBit<u32>(mHitFlags, 0x10UL); }
void offNoBgCheck() { cLib_offBit<u32>(mHitFlags, 0x10UL); }
u32 isNoBgCheck() { return cLib_checkBit<u32>(mHitFlags, 0x10UL); }
void onHyoiKamome() { m_hyoi_kamome = true; }
void offHyoiKamome() { m_hyoi_kamome = false; }
+9 -9
View File
@@ -58,15 +58,15 @@ public:
}
}
BOOL isFinish() { return cLib_checkBit(field_0x784, 0x1UL); }
void onFinish() { cLib_onBit(field_0x784, 0x1UL); }
BOOL isSetHomePos() { return cLib_checkBit(field_0x784, 0x2UL); }
void onSetHomePos() { cLib_onBit(field_0x784, 0x2UL); }
BOOL isWaterHit() { return cLib_checkBit(field_0x784, 0x4UL); }
void onWaterHit() { cLib_onBit(field_0x784, 0x4UL); }
BOOL isGravity() { return cLib_checkBit(field_0x784, 0x8UL); }
void onGravity() { cLib_onBit(field_0x784, 0x8UL); }
void offGravity() { cLib_offBit(field_0x784, 0x8UL); }
BOOL isFinish() { return cLib_checkBit<u32>(field_0x784, 0x1UL); }
void onFinish() { cLib_onBit<u32>(field_0x784, 0x1UL); }
BOOL isSetHomePos() { return cLib_checkBit<u32>(field_0x784, 0x2UL); }
void onSetHomePos() { cLib_onBit<u32>(field_0x784, 0x2UL); }
BOOL isWaterHit() { return cLib_checkBit<u32>(field_0x784, 0x4UL); }
void onWaterHit() { cLib_onBit<u32>(field_0x784, 0x4UL); }
BOOL isGravity() { return cLib_checkBit<u32>(field_0x784, 0x8UL); }
void onGravity() { cLib_onBit<u32>(field_0x784, 0x8UL); }
void offGravity() { cLib_offBit<u32>(field_0x784, 0x8UL); }
// Note: The 0x10 bit is used in the final release, but not in the demo debug maps, so its official name is unknown.
void offPlayerRoom(int idx) { m_playerRoom[idx] = false; }
+6 -6
View File
@@ -13,12 +13,12 @@ public:
/* 0x4E9 */ u8 mDamageFogTimer;
/* 0x4EA */ u8 field_4EA[0x4EC - 0x4EA];
void returnLink() { cLib_onBit(m4E4, 0x01UL); }
void offReturnLink() { cLib_offBit(m4E4, 0x01UL); }
bool isReturnLink() { return cLib_checkBit(m4E4, 0x01UL); }
void onEventAccept() { cLib_onBit(m4E4, 0x02UL); }
void offEventAccept() { cLib_offBit(m4E4, 0x02UL); }
bool isEventAccept() { return cLib_checkBit(m4E4, 0x02UL); }
void returnLink() { cLib_onBit<u32>(m4E4, 0x01UL); }
void offReturnLink() { cLib_offBit<u32>(m4E4, 0x01UL); }
bool isReturnLink() { return cLib_checkBit<u32>(m4E4, 0x01UL); }
void onEventAccept() { cLib_onBit<u32>(m4E4, 0x02UL); }
void offEventAccept() { cLib_offBit<u32>(m4E4, 0x02UL); }
bool isEventAccept() { return cLib_checkBit<u32>(m4E4, 0x02UL); }
u8 getDamageFogTimer() { return mDamageFogTimer; }
void setDamageFogTimer(u8 timer) { mDamageFogTimer = timer; }
+3 -3
View File
@@ -586,7 +586,7 @@ void dWood::Unit_c::cc_hit_before_cut(dWood::Packet_c *packet) {
}
// Evaluate for attacks that will not cut us down
if (cLib_checkBit(ret, 0x01UL)) {
if (cLib_checkBit<u32>(ret, 0x01UL)) {
cCcD_Obj *atHitObj = inf.GetAtHitObj();
if (atHitObj != NULL && (atHitObj->ChkAtType(AT_TYPE_WIND) ||
atHitObj->ChkAtType(AT_TYPE_BOMB) ||
@@ -627,7 +627,7 @@ void dWood::Unit_c::cc_hit_before_cut(dWood::Packet_c *packet) {
}
// Check for collisions that are not attacks
if (cLib_checkBit(ret, 0x02UL) && actor && inf.GetCoHitObj() &&
if (cLib_checkBit<u32>(ret, 0x02UL) && actor && inf.GetCoHitObj() &&
inf.GetCoHitObj()->GetStts()) {
animIdx = packet->search_anm(Anm_c::Mode_PushInto);
@@ -656,7 +656,7 @@ void dWood::Unit_c::cc_hit_before_cut(dWood::Packet_c *packet) {
}
// Check for attacks that WILL cut us down
if (cLib_checkBit(ret, 0x01UL)) {
if (cLib_checkBit<u32>(ret, 0x01UL)) {
AnmID_e oldAnimIdx = mAnmIdx;
if ((mAnmIdx < 8)) {