1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-21 22:41:14 +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

@ -141,7 +141,7 @@ static Vec3f sBottlesPositions[] = {
};
void func_80A2F180(EnGb* this) {
if (gSaveContext.infTable[0xB] & 0x40) {
if (GET_INFTABLE(INFTABLE_B6)) {
this->textId = 0x70F5;
} else {
this->textId = 0x70F4;
@ -303,8 +303,8 @@ void func_80A2F83C(EnGb* this, GlobalContext* globalCtx) {
void func_80A2F94C(EnGb* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE && Message_ShouldAdvance(globalCtx)) {
if (!(gSaveContext.infTable[0xB] & 0x40)) {
gSaveContext.infTable[0xB] |= 0x40;
if (!GET_INFTABLE(INFTABLE_B6)) {
SET_INFTABLE(INFTABLE_B6);
}
func_80A2F180(this);
this->actionFunc = func_80A2F83C;
@ -313,8 +313,8 @@ void func_80A2F94C(EnGb* this, GlobalContext* globalCtx) {
void func_80A2F9C0(EnGb* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE && Message_ShouldAdvance(globalCtx)) {
if (!(gSaveContext.infTable[0xB] & 0x40)) {
gSaveContext.infTable[0xB] |= 0x40;
if (!GET_INFTABLE(INFTABLE_B6)) {
SET_INFTABLE(INFTABLE_B6);
}
func_80A2F180(this);
Player_UpdateBottleHeld(globalCtx, GET_PLAYER(globalCtx), ITEM_BOTTLE, PLAYER_AP_BOTTLE);
@ -325,8 +325,8 @@ void func_80A2F9C0(EnGb* this, GlobalContext* globalCtx) {
void func_80A2FA50(EnGb* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE && Message_ShouldAdvance(globalCtx)) {
if (!(gSaveContext.infTable[0xB] & 0x40)) {
gSaveContext.infTable[0xB] |= 0x40;
if (!GET_INFTABLE(INFTABLE_B6)) {
SET_INFTABLE(INFTABLE_B6);
}
func_80A2F180(this);
Player_UpdateBottleHeld(globalCtx, GET_PLAYER(globalCtx), ITEM_BOTTLE, PLAYER_AP_BOTTLE);