1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-23 15:31:15 +00:00

Defines for SaveContext flags (eventChkInf, itemGetInf, infTable, eventInf) (#1094)

* script-assisted `itemGetInf` flags

* comment near non-trivial `itemGetInf` usage

* Run formatter

* Try something with the itemgetinf flags that can't use the packed value

* Add defines for `eventChkInf` (direct access)

* Add defines for `eventChkInf` (access through `Flags_GetEventChkInf`)

* Add defines for `eventChkInf` (access through `Flags_SetEventChkInf`)

* Add defines for `infTable` (direct access)

* Add defines for `infTable` (used by `Flags_GetInfTable`)

* Add defines for `infTable` (used by `Flags_SetInfTable`)

* Add defines for `eventInf`

* parenthesis cleanup near `GET_EVENTCHKINF` usage

* parenthesis cleanup near `GET_ITEMGETINF` usage

* parenthesis cleanup near `GET_INFTABLE` usage

* fixup one `eventInf` usage

* parenthesis cleanup near `GET_EVENTINF` usage

* parenthesis cleanup near `Flags_GetEventChkInf` usage

* slight `z64save.h` formatting improvement

* Improve itemGetInf flags in z_bg_dy_yoseizo

* Questionable improvement in z_en_ge2

* Questionable improvement in z_en_daiku

* Questionable improvement in z_en_mu

* Run formatter

* Parentheses around `gSaveContext` macros arguments

* Move individual flags define to the end of z64save.h, and improve comments separating the groups
This commit is contained in:
Dragorn421 2022-04-29 20:19:48 +02:00 committed by GitHub
parent 16790bc253
commit 6336df5fcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
146 changed files with 1931 additions and 1315 deletions

View file

@ -228,7 +228,7 @@ s32 func_80AADAA0(EnMm* this, GlobalContext* globalCtx) {
EnMm_ChangeAnim(this, RM_ANIM_HAPPY, &this->curAnimIndex);
} else {
player->actor.textId = 0x202C;
gSaveContext.infTable[23] |= 0x1000;
SET_INFTABLE(INFTABLE_17C);
}
sp1C = 2;
}
@ -237,7 +237,7 @@ s32 func_80AADAA0(EnMm* this, GlobalContext* globalCtx) {
if (Message_ShouldAdvance(globalCtx)) {
Player_UnsetMask(globalCtx);
Item_Give(globalCtx, ITEM_SOLD_OUT);
gSaveContext.itemGetInf[3] |= 0x800;
SET_ITEMGETINF(ITEMGETINF_3B);
Rupees_ChangeBy(500);
player->actor.textId = 0x202E;
sp1C = 2;
@ -263,12 +263,12 @@ s32 EnMm_GetTextId(EnMm* this, GlobalContext* globalCtx) {
textId = Text_GetFaceReaction(globalCtx, 0x1C);
if (gSaveContext.itemGetInf[3] & 0x800) {
if (GET_ITEMGETINF(ITEMGETINF_3B)) {
if (textId == 0) {
textId = 0x204D;
}
} else if (player->currentMask == PLAYER_MASK_BUNNY) {
textId = (gSaveContext.infTable[23] & 0x1000) ? 0x202B : 0x202A;
textId = GET_INFTABLE(INFTABLE_17C) ? 0x202B : 0x202A;
} else if (textId == 0) {
textId = 0x2029;
}
@ -427,7 +427,7 @@ void func_80AAE294(EnMm* this, GlobalContext* globalCtx) {
}
}
if (gSaveContext.itemGetInf[3] & 0x800) {
if (GET_ITEMGETINF(ITEMGETINF_3B)) {
this->speedXZ = 10.0f;
this->skelAnime.playSpeed = 2.0f;
} else {
@ -454,7 +454,7 @@ void func_80AAE294(EnMm* this, GlobalContext* globalCtx) {
}
}
if (gSaveContext.itemGetInf[3] & 0x800) {
if (GET_ITEMGETINF(ITEMGETINF_3B)) {
dustPos.x = this->actor.world.pos.x;
dustPos.y = this->actor.world.pos.y;
dustPos.z = this->actor.world.pos.z;
@ -475,7 +475,7 @@ void func_80AAE50C(EnMm* this, GlobalContext* globalCtx) {
this->sitTimer = 0;
this->actionFunc = func_80AAE294;
if (gSaveContext.itemGetInf[3] & 0x800) {
if (GET_ITEMGETINF(ITEMGETINF_3B)) {
EnMm_ChangeAnim(this, RM_ANIM_SPRINT, &this->curAnimIndex);
this->mouthTexIndex = RM_MOUTH_CLOSED;
} else {
@ -523,7 +523,7 @@ void EnMm_Draw(Actor* thisx, GlobalContext* globalCtx) {
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
EnMm_OverrideLimbDraw, EnMm_PostLimbDraw, this);
if (gSaveContext.itemGetInf[3] & 0x800) {
if (GET_ITEMGETINF(ITEMGETINF_3B)) {
s32 linkChildObjBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_LINK_CHILD);
if (linkChildObjBankIndex >= 0) {