mirror of
https://github.com/zeldaret/tww.git
synced 2026-07-11 14:38:38 -04:00
Fix weird gameInfo loads caused by casts within inlines
This commit is contained in:
@@ -2798,7 +2798,7 @@ inline s32 dComIfGp_event_orderOld(u16 eventType, u16 priority, u16 flag, u16 hi
|
||||
}
|
||||
|
||||
inline fopAc_ac_c* dComIfGp_event_getTalkPartner() {
|
||||
return (fopAc_ac_c*)g_dComIfG_gameInfo.play.getEvent().getPtT();
|
||||
return g_dComIfG_gameInfo.play.getEvent().getPtT();
|
||||
}
|
||||
|
||||
inline void dComIfGp_event_setTalkPartner(void* i_actor) {
|
||||
@@ -2806,7 +2806,7 @@ inline void dComIfGp_event_setTalkPartner(void* i_actor) {
|
||||
}
|
||||
|
||||
inline fopAc_ac_c* dComIfGp_event_getItemPartner() {
|
||||
return (fopAc_ac_c*)g_dComIfG_gameInfo.play.getEvent().getPtI();
|
||||
return g_dComIfG_gameInfo.play.getEvent().getPtI();
|
||||
}
|
||||
|
||||
inline void dComIfGp_event_setItemPartner(void* pt) {
|
||||
@@ -2818,11 +2818,11 @@ inline void dComIfGp_event_setItemPartnerId(fpc_ProcID id) {
|
||||
}
|
||||
|
||||
inline fopAc_ac_c* dComIfGp_event_getPt1() {
|
||||
return (fopAc_ac_c*)g_dComIfG_gameInfo.play.getEvent().getPt1();
|
||||
return g_dComIfG_gameInfo.play.getEvent().getPt1();
|
||||
}
|
||||
|
||||
inline fopAc_ac_c* dComIfGp_event_getPt2() {
|
||||
return (fopAc_ac_c*)g_dComIfG_gameInfo.play.getEvent().getPt2();
|
||||
return g_dComIfG_gameInfo.play.getEvent().getPt2();
|
||||
}
|
||||
|
||||
inline f32 dComIfGp_event_getCullRate() {
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
|
||||
/* 8012CD60-8012CDD4 .text getDemoLookActor__9daPy_lk_cFv */
|
||||
fopAc_ac_c *daPy_lk_c::getDemoLookActor() {
|
||||
/* Nonmatching */
|
||||
if (mDemo.getParam0() == 1) {
|
||||
return dComIfGp_event_getPt1();
|
||||
} else if (mDemo.getParam0() == 2) {
|
||||
|
||||
@@ -2083,8 +2083,7 @@ BOOL daShip_c::procZevDemo() {
|
||||
int* talkP = dComIfGp_evmng_getMyIntegerP(mEvtStaffId, "talk");
|
||||
int* atn_actorP = dComIfGp_evmng_getMyIntegerP(mEvtStaffId, "atn_actor");
|
||||
|
||||
// Fakematch, dComIfGp_event_getPt1 doesn't work for some reason
|
||||
if (atn_actorP && g_dComIfG_gameInfo.play.getEvent().getPt1()) {
|
||||
if (atn_actorP && dComIfGp_event_getPt1()) {
|
||||
m0428 = &dComIfGp_event_getPt1()->eyePos;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -927,15 +927,24 @@ BOOL daTbox_c::actionDemo() {
|
||||
/* Fakematch - the temp variable for play is definitely not right. */
|
||||
s16 eventId = eventInfo.getEventId();
|
||||
dComIfG_play_c* play = &g_dComIfG_gameInfo.play;
|
||||
|
||||
if (dComIfGp_evmng_endCheck(eventId)) {
|
||||
// if (dComIfGp_evmng_endCheck(eventInfo.getEventId())) {
|
||||
setAction(&daTbox_c::actionWait);
|
||||
|
||||
// Fakematch:
|
||||
// When dComIfGp_event_reset is used here, the way gameInfo is loaded matches the demo
|
||||
// binary, but not the release binary. So the demo's debug map may be misleading here?
|
||||
// But daTbox_c::actionDemo in TP debug still calls dComIfGp_event_reset, so maybe not?
|
||||
// Also, putting a cast like (void) on dComIfGp_event_reset() slightly improves the
|
||||
// codegen, but it's still slightly wrong.
|
||||
// dComIfGp_event_reset();
|
||||
play->getEvent().reset();
|
||||
|
||||
dKy_set_allcol_ratio(1.0f);
|
||||
|
||||
flagOff(daTboxFlg_UNK_08 | daTboxFlg_OPENING_e);
|
||||
|
||||
// The fakematch also might be related to dComIfGp_event_setItemPartner? Removing this
|
||||
// call fixes the load above.
|
||||
dComIfGp_event_setItemPartner(NULL);
|
||||
|
||||
if (mSmokeEmitter != NULL) {
|
||||
|
||||
@@ -759,20 +759,20 @@ s32 fopAcM_orderTreasureEvent(fopAc_ac_c* i_this, fopAc_ac_c* i_partner) {
|
||||
|
||||
/* 80026044-80026074 .text fopAcM_getTalkEventPartner__FP10fopAc_ac_c */
|
||||
fopAc_ac_c* fopAcM_getTalkEventPartner(fopAc_ac_c*) {
|
||||
return dComIfGp_event_getTalkPartner();
|
||||
return (fopAc_ac_c*)dComIfGp_event_getTalkPartner();
|
||||
}
|
||||
|
||||
/* 80026074-800260A4 .text fopAcM_getItemEventPartner__FP10fopAc_ac_c */
|
||||
fopAc_ac_c* fopAcM_getItemEventPartner(fopAc_ac_c*) {
|
||||
return dComIfGp_event_getItemPartner();
|
||||
return (fopAc_ac_c*)dComIfGp_event_getItemPartner();
|
||||
}
|
||||
|
||||
/* 800260A4-80026118 .text fopAcM_getEventPartner__FP10fopAc_ac_c */
|
||||
fopAc_ac_c* fopAcM_getEventPartner(fopAc_ac_c* i_this) {
|
||||
if (dComIfGp_event_getPt1() != i_this)
|
||||
return dComIfGp_event_getPt1();
|
||||
return (fopAc_ac_c*)dComIfGp_event_getPt1();
|
||||
|
||||
return dComIfGp_event_getPt2();
|
||||
return (fopAc_ac_c*)dComIfGp_event_getPt2();
|
||||
}
|
||||
|
||||
/* 80026118-800261E8 .text fopAcM_createItemForPresentDemo__FP4cXyziUciiP5csXyzP4cXyz */
|
||||
|
||||
Reference in New Issue
Block a user