From a6d9583e5b320660aece04171d8c9aa873c6c4b0 Mon Sep 17 00:00:00 2001 From: z64a Date: Mon, 30 Sep 2024 16:58:52 -0400 Subject: [PATCH] rename isBattle -> context --- include/common_structs.h | 2 +- include/enums.h | 8 ++++---- src/111f0_len_860.c | 6 +++--- src/77480.c | 4 ++-- src/8a860_len_3f30.c | 2 +- src/animator.c | 16 ++++++++-------- src/audio/sfx.c | 6 +++--- src/battle/battle.c | 2 +- src/effects.c | 10 +++++----- src/effects/fire_breath.c | 2 +- src/effects/lightning.c | 2 +- src/effects/lightning_bolt.c | 2 +- src/effects/star.c | 2 +- src/entity.c | 30 +++++++++++++++--------------- src/entity_model.c | 18 +++++++++--------- src/evt/cam_api.c | 2 +- src/evt/model_api.c | 6 +++--- src/evt/script_list.c | 4 ++-- src/evt/virtual_entity.c | 6 +++--- src/heap.c | 8 ++++---- src/hud_element.c | 22 +++++++++++----------- src/imgfx.c | 6 +++--- src/inventory.c | 16 ++++++++-------- src/item_entity.c | 16 ++++++++-------- src/model.c | 6 +++--- src/npc.c | 6 +++--- src/screen_overlays.c | 4 ++-- src/sprite.c | 6 +++--- src/sprite_shading.c | 2 +- src/state_battle.c | 4 ++-- src/state_demo.c | 2 +- src/state_file_select.c | 4 ++-- src/state_intro.c | 2 +- src/state_pause.c | 4 ++-- src/state_startup.c | 2 +- src/state_title_screen.c | 2 +- src/status_icons.c | 30 +++++++++++++++--------------- src/trigger.c | 4 ++-- src/worker.c | 12 ++++++------ src/world/action/misc.c | 2 +- src/world/area_gv/gv_01/main.c | 2 +- 41 files changed, 146 insertions(+), 146 deletions(-) diff --git a/include/common_structs.h b/include/common_structs.h index c9f0951e51..170f0e1f1e 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -1427,7 +1427,7 @@ typedef struct GameStatus { /* 0x06A */ s8 demoStickX; /* 0x06B */ s8 demoStickY; /* 0x06C */ s32 mainScriptID; - /* 0x070 */ s8 isBattle; + /* 0x070 */ s8 context; /* 0x071 */ s8 demoState; // see DemoState enum /* 0x072 */ s8 nextDemoScene; /* which part of the demo to play next */ /* 0x073 */ u8 contBitPattern; diff --git a/include/enums.h b/include/enums.h index 1f4f9f903d..9d83dfeb1e 100644 --- a/include/enums.h +++ b/include/enums.h @@ -3526,10 +3526,10 @@ enum EffectGfxDataFlags { #include "move_enum.h" -enum MainState{ - MAIN_STATE_WORLD = 0, - MAIN_STATE_BATTLE = 1, - MAIN_STATE_PAUSE = 2, +enum GameContext { + CONTEXT_WORLD = 0, + CONTEXT_BATTLE = 1, + CONTEXT_PAUSE = 2, }; enum DemoState { diff --git a/src/111f0_len_860.c b/src/111f0_len_860.c index 5fb9709525..e40213da4e 100644 --- a/src/111f0_len_860.c +++ b/src/111f0_len_860.c @@ -51,7 +51,7 @@ void state_step_enter_world(void) { break; } - gGameStatusPtr->isBattle = MAIN_STATE_WORLD; + gGameStatusPtr->context = CONTEXT_WORLD; gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE; if (!gLoadedFromFileSelect) { @@ -155,7 +155,7 @@ void state_step_change_map(void) { if (gMapTransitionStateTime != 0) { gMapTransitionStateTime--; } else { - gGameStatusPtr->isBattle = MAIN_STATE_WORLD; + gGameStatusPtr->context = CONTEXT_WORLD; gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE; load_map_by_IDs(gGameStatusPtr->areaID, gGameStatusPtr->mapID, LOAD_FROM_MAP); set_time_freeze_mode(TIME_FREEZE_NORMAL); @@ -230,7 +230,7 @@ void state_step_game_over(void) { if (gMapTransitionStateTime != 0) { gMapTransitionStateTime--; } else { - gGameStatusPtr->isBattle = MAIN_STATE_WORLD; + gGameStatusPtr->context = CONTEXT_WORLD; gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE; load_map_by_IDs(gGameStatusPtr->areaID, gGameStatusPtr->mapID, LOAD_FROM_MAP); nuContRmbForceStopEnd(); diff --git a/src/77480.c b/src/77480.c index 83e88bc05d..f74676062f 100644 --- a/src/77480.c +++ b/src/77480.c @@ -1052,7 +1052,7 @@ void check_for_pulse_stone(void) { return; } - if (gGameStatusPtr->areaID != AREA_SBK || gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->areaID != AREA_SBK || gGameStatusPtr->context != CONTEXT_WORLD) { return; } @@ -1318,7 +1318,7 @@ void clear_interact_prompt(void) { void update_partner_timers(void) { PlayerData* playerData = &gPlayerData; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { s32 i; for (i = 1; i < ARRAY_COUNT(playerData->partnerUnlockedTime); i++) { diff --git a/src/8a860_len_3f30.c b/src/8a860_len_3f30.c index 3b9188fde0..c782301085 100644 --- a/src/8a860_len_3f30.c +++ b/src/8a860_len_3f30.c @@ -241,7 +241,7 @@ void destroy_popup_menu(void) { gPopupMenu->popupType == POPUP_TYPE_TRADE_FOR_BADGE || gPopupMenu->popupType == POPUP_TYPE_UPGRADE_PARTNER || gPopupMenu->popupType == POPUP_TYPE_USE_KEY - ) && gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + ) && gGameStatusPtr->context == CONTEXT_WORLD) { if (!PopupMenu_WasStatusBarIgnoringChanges) { status_bar_respond_to_changes(); } diff --git a/src/animator.c b/src/animator.c index 474c6d2c13..3b22ce6f0a 100644 --- a/src/animator.c +++ b/src/animator.c @@ -184,7 +184,7 @@ void free_animator_nodes(AnimatorNode* root) { void clear_animator_list(void) { s32 i; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentAnimMeshListPtr = &D_801539C0; for (i = 0; i < ARRAY_COUNT(D_801533C0); i++) { D_801533C0[i].ttl = -1; @@ -212,7 +212,7 @@ void clear_animator_list(void) { } void reset_animator_list(void) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentAnimMeshListPtr = &D_801539C0; } else { gCurrentAnimMeshListPtr = &D_80153A00; @@ -311,7 +311,7 @@ s32 create_model_animator(s16* animPos) { animator->staticNodeIDs[j] = j + 1; } - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->context != CONTEXT_WORLD) { i |= BATTLE_ID_BIT; } return i; @@ -351,7 +351,7 @@ s32 create_mesh_animator(s16* animPos, s16* animBuffer) { animator->staticNodeIDs[j] = j + 1; } - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->context != CONTEXT_WORLD) { i |= BATTLE_ID_BIT; } return i; @@ -434,7 +434,7 @@ void update_model_animator(s32 animatorID) { s32 temp; s32 i; - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD && !(animatorID & BATTLE_ID_BIT)) { + if (gGameStatusPtr->context != CONTEXT_WORLD && !(animatorID & BATTLE_ID_BIT)) { return; } @@ -498,7 +498,7 @@ void update_model_animator_with_transform(s32 animatorID, Mtx* mtx) { s32 temp; s32 i; - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD && !(animatorID & BATTLE_ID_BIT)) { + if (gGameStatusPtr->context != CONTEXT_WORLD && !(animatorID & BATTLE_ID_BIT)) { return; } @@ -717,7 +717,7 @@ void render_animated_model(s32 animatorID, Mtx* rootTransform) { RenderTask rt; RenderTask* rtPtr = &rt; - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD && !(animatorID & BATTLE_ID_BIT)) { + if (gGameStatusPtr->context != CONTEXT_WORLD && !(animatorID & BATTLE_ID_BIT)) { return; } @@ -747,7 +747,7 @@ void render_animated_model_with_vertices(s32 animatorID, Mtx* rootTransform, s32 RenderTask rt; RenderTask* rtPtr = &rt; - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD && !(animatorID & BATTLE_ID_BIT)) { + if (gGameStatusPtr->context != CONTEXT_WORLD && !(animatorID & BATTLE_ID_BIT)) { return; } diff --git a/src/audio/sfx.c b/src/audio/sfx.c index 6e9cfeef94..29c50e3658 100644 --- a/src/audio/sfx.c +++ b/src/audio/sfx.c @@ -311,7 +311,7 @@ void sfx_clear_sounds(void) { // name might be incorrect? void sfx_clear_env_sounds(s16 playSounds) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentEnvSounds = wEnvSounds; } else { gCurrentEnvSounds = bEnvSounds; @@ -362,7 +362,7 @@ void sfx_stop_env_sounds(void) { SoundInstance* sound; s32 i; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentEnvSounds = wEnvSounds; } else { gCurrentEnvSounds = bEnvSounds; @@ -619,7 +619,7 @@ void sfx_compute_spatialized_sound_params_ignore_depth(f32 x, f32 y, f32 z, s16* *volume = 1; } - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { // 25/75 at screen edge *pan = (screenX * 0.2f) + 32.0f; } else { diff --git a/src/battle/battle.c b/src/battle/battle.c index 2d7ad8ebf4..d89534610a 100644 --- a/src/battle/battle.c +++ b/src/battle/battle.c @@ -220,7 +220,7 @@ void load_demo_battle(u32 index) { gGameStatusPtr->demoBattleFlags = 0; gGameStatusPtr->areaID = 0; gGameStatusPtr->mapID = 0; - gGameStatusPtr->isBattle = MAIN_STATE_WORLD; + gGameStatusPtr->context = CONTEXT_WORLD; general_heap_create(); clear_worker_list(); diff --git a/src/effects.c b/src/effects.c index c835213190..07271a02b3 100644 --- a/src/effects.c +++ b/src/effects.c @@ -73,7 +73,7 @@ void update_effects(void) { if (effectInstance != NULL && (effectInstance->flags & FX_INSTANCE_FLAG_ENABLED)) { effectInstance->graphics->flags &= ~FX_GRAPHICS_CAN_FREE; - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->context != CONTEXT_WORLD) { if (effectInstance->flags & FX_INSTANCE_FLAG_BATTLE) { effectInstance->graphics->update(effectInstance); effectInstance->flags |= FX_INSTANCE_FLAG_HAS_UPDATED; @@ -116,7 +116,7 @@ void render_effects_world(void) { if (effectInstance != NULL) { if (effectInstance->flags & FX_INSTANCE_FLAG_ENABLED) { if (effectInstance->flags & FX_INSTANCE_FLAG_HAS_UPDATED) { - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->context != CONTEXT_WORLD) { if (effectInstance->flags & FX_INSTANCE_FLAG_BATTLE) { effectInstance->graphics->renderWorld(effectInstance); } @@ -143,11 +143,11 @@ void render_effects_UI(void) { if (effectInstance->flags & FX_INSTANCE_FLAG_HAS_UPDATED) { void (*renderUI)(EffectInstance* effect); - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD && !(effectInstance->flags & FX_INSTANCE_FLAG_BATTLE)) { + if (gGameStatusPtr->context != CONTEXT_WORLD && !(effectInstance->flags & FX_INSTANCE_FLAG_BATTLE)) { continue; } - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD && effectInstance->flags & FX_INSTANCE_FLAG_BATTLE) { + if (gGameStatusPtr->context == CONTEXT_WORLD && effectInstance->flags & FX_INSTANCE_FLAG_BATTLE) { continue; } @@ -243,7 +243,7 @@ EffectInstance* create_effect_instance(EffectBlueprint* effectBp) { effectBp->init(newEffectInst); } - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->context != CONTEXT_WORLD) { newEffectInst->flags |= FX_INSTANCE_FLAG_BATTLE; } return newEffectInst; diff --git a/src/effects/fire_breath.c b/src/effects/fire_breath.c index bb24c62f6e..13c65983b2 100644 --- a/src/effects/fire_breath.c +++ b/src/effects/fire_breath.c @@ -167,7 +167,7 @@ void fire_breath_render(EffectInstance* effect) { renderTask.appendGfx = fire_breath_appendGfx; renderTask.appendGfxArg = effect; - if (gGameStatusPtr->isBattle == MAIN_STATE_BATTLE) { + if (gGameStatusPtr->context == CONTEXT_BATTLE) { renderTask.dist = data->pos.z + 1000.0f; } else { renderTask.dist = 0; diff --git a/src/effects/lightning.c b/src/effects/lightning.c index 4f061c5665..9590a71f34 100644 --- a/src/effects/lightning.c +++ b/src/effects/lightning.c @@ -101,7 +101,7 @@ EffectInstance* lightning_main( s32 effectArg0; load_effect(EFFECT_FLASHING_BOX_SHOCKWAVE); - if (gGameStatusPtr->isBattle == MAIN_STATE_BATTLE) { + if (gGameStatusPtr->context == CONTEXT_BATTLE) { effectArg0 = FX_SHOCK_OVERLAY_LIGHTNING_BATTLE; } else { effectArg0 = FX_SHOCK_OVERLAY_LIGHTNING_WORLD; diff --git a/src/effects/lightning_bolt.c b/src/effects/lightning_bolt.c index c383b739ba..b3a9ddb240 100644 --- a/src/effects/lightning_bolt.c +++ b/src/effects/lightning_bolt.c @@ -155,7 +155,7 @@ void lightning_bolt_render(EffectInstance *effect) { renderTask.appendGfx = lightning_bolt_appendGfx; renderTask.appendGfxArg = effect; - if (gGameStatusPtr->isBattle == MAIN_STATE_BATTLE) { + if (gGameStatusPtr->context == CONTEXT_BATTLE) { renderTask.dist = data->tipPos.z + 1000.0f; } else { renderTask.dist = 10; diff --git a/src/effects/star.c b/src/effects/star.c index 4911773ac0..e56394838d 100644 --- a/src/effects/star.c +++ b/src/effects/star.c @@ -151,7 +151,7 @@ void star_update(EffectInstance* effect) { load_effect(EFFECT_LANDING_DUST); landing_dust_main(0, data->pos.x, data->pos.y - 5.0f, data->pos.z, 0.0f); - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { sfx_play_sound_at_position(SOUND_SEQ_SHOOTING_STAR_BOUNCE, SOUND_SPACE_DEFAULT, data->pos.x, data->pos.y, data->pos.z); } diff --git a/src/entity.c b/src/entity.c index 2a9a58156b..8da9ff9557 100644 --- a/src/entity.c +++ b/src/entity.c @@ -345,7 +345,7 @@ void render_entities(void) { Entity* entity = get_entity_by_index(i); if (entity != NULL) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { if (gEntityHideMode != ENTITY_HIDE_MODE_0 && !(entity->flags & ENTITY_FLAG_IGNORE_DISTANCE_CULLING) && dist2D(gPlayerStatusPtr->pos.x, @@ -541,7 +541,7 @@ Shadow* get_shadow_by_index(s32 index) { EntityList* get_entity_list(void) { EntityList* ret; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { ret = &gWorldEntityList; } else { ret = &gBattleEntityList; @@ -552,7 +552,7 @@ EntityList* get_entity_list(void) { ShadowList* get_shadow_list(void) { ShadowList* ret; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { ret = &gWorldShadowList; } else { ret = &gBattleShadowList; @@ -795,7 +795,7 @@ void clear_entity_data(b32 arg0) { entity_updateCounter = 0; D_80151304 = 0; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gEntityHideMode = ENTITY_HIDE_MODE_0; } @@ -807,7 +807,7 @@ void clear_entity_data(b32 arg0) { } D_8014AFB0 = 255; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { wEntityDataLoadedSize = 0; for (i = 0; i < MAX_ENTITIES; i++) { wEntityBlueprint[i] = NULL; @@ -819,7 +819,7 @@ void clear_entity_data(b32 arg0) { } } - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gEntityHeapBottom = WORLD_ENTITY_HEAP_BOTTOM; gEntityHeapBase = WORLD_ENTITY_HEAP_BASE; } else { @@ -840,7 +840,7 @@ void clear_entity_data(b32 arg0) { } void init_entity_data(void) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gEntityHeapBottom = WORLD_ENTITY_HEAP_BOTTOM; gEntityHeapBase = WORLD_ENTITY_HEAP_BASE; reload_world_entity_data(); @@ -957,7 +957,7 @@ s32 is_entity_data_loaded(Entity* entity, EntityBlueprint* blueprint, s32* loade *loadedEnd = 0; ret = FALSE; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { blueprints = wEntityBlueprint; } else { blueprints = bEntityBlueprint; @@ -1016,7 +1016,7 @@ void load_simple_entity_data(Entity* entity, EntityBlueprint* bp, s32 listIndex) s32 totalSize; entity->vertexSegment = 0xA; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { totalSize = wEntityDataLoadedSize; } else { totalSize = bEntityDataLoadedSize; @@ -1038,7 +1038,7 @@ void load_simple_entity_data(Entity* entity, EntityBlueprint* bp, s32 listIndex) get_entity_type(entity->listIndex); } - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { wEntityDataLoadedSize = totalSize; } else { bEntityDataLoadedSize = totalSize; @@ -1091,7 +1091,7 @@ void load_split_entity_data(Entity* entity, EntityBlueprint* entityData, s32 lis animBaseAddr = (void*)(gEntityHeapBottom + specialSize * 4 + dma1size * 4); swizzlePointers = TRUE; } else if (is_entity_data_loaded(entity, entityData, &loadedStart, &loadedEnd)) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { totalLoaded = wEntityDataLoadedSize; } else { totalLoaded = bEntityDataLoadedSize; @@ -1116,7 +1116,7 @@ void load_split_entity_data(Entity* entity, EntityBlueprint* entityData, s32 lis totalLoaded += dma2size_2; get_entity_type(entity->listIndex); - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { wEntityDataLoadedSize = totalLoaded; } else { bEntityDataLoadedSize = totalLoaded; @@ -1688,7 +1688,7 @@ s32 entity_raycast_down(f32* x, f32* y, f32* z, f32* hitYaw, f32* hitPitch, f32* } void set_standard_shadow_scale(Shadow* shadow, f32 height) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { shadow->scale.x = 0.13 - (height / 2600.0f); } else { shadow->scale.x = 0.12 - (height / 3600.0f); @@ -1701,7 +1701,7 @@ void set_standard_shadow_scale(Shadow* shadow, f32 height) { } void set_npc_shadow_scale(Shadow* shadow, f32 height, f32 npcRadius) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { shadow->scale.x = 0.13 - (height / 2600.0f); } else { shadow->scale.x = 0.12 - (height / 3600.0f); @@ -1722,7 +1722,7 @@ void set_peach_shadow_scale(Shadow* shadow, f32 scale) { PlayerStatus* playerStatus = &gPlayerStatus; f32 phi_f2 = 0.12f; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { switch (playerStatus->anim) { case ANIM_Peach2_Carried: case ANIM_Peach2_Thrown: diff --git a/src/entity_model.c b/src/entity_model.c index 623255a29c..108c890125 100644 --- a/src/entity_model.c +++ b/src/entity_model.c @@ -51,7 +51,7 @@ void free_entity_model_by_ref(EntityModel* entityModel); void clear_entity_models(void) { s32 i; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentEntityModelList = &gWorldEntityModelList; } else { gCurrentEntityModelList = &gBattleEntityModelList; @@ -74,7 +74,7 @@ void clear_entity_models(void) { void init_entity_models(void) { s32 i; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentEntityModelList = &gWorldEntityModelList; } else { gCurrentEntityModelList = &gBattleEntityModelList; @@ -121,7 +121,7 @@ s32 load_entity_model(EntityModelScript* cmdList) { newEntityModel->fpSetupGfxCallback = NULL; newEntityModel->cmdListSavedPos = newEntityModel->cmdListReadPos; - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->context != CONTEXT_WORLD) { i |= BATTLE_ENTITY_ID_BIT; } return i; @@ -163,7 +163,7 @@ s32 ALT_load_entity_model(EntityModelScript* cmdList) { newEntityModel->fpSetupGfxCallback = NULL; newEntityModel->cmdListSavedPos = newEntityModel->cmdListReadPos; - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->context != CONTEXT_WORLD) { i |= BATTLE_ENTITY_ID_BIT; } return i; @@ -172,7 +172,7 @@ s32 ALT_load_entity_model(EntityModelScript* cmdList) { void exec_entity_model_commandlist(s32 idx) { EntityModel* entityModel; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD || (idx & BATTLE_ENTITY_ID_BIT)) { + if (gGameStatusPtr->context == CONTEXT_WORLD || (idx & BATTLE_ENTITY_ID_BIT)) { idx &= ~BATTLE_ENTITY_ID_BIT; entityModel = (*gCurrentEntityModelList)[idx]; if (entityModel != NULL && (entityModel->flags)) { @@ -412,7 +412,7 @@ void draw_entity_model_A(s32 modelIdx, Mtx* transformMtx) { f32 x, y, z, w; f32 inX, inY, inZ; - if ((gGameStatusPtr->isBattle == MAIN_STATE_WORLD) || (modelIdx & BATTLE_ENTITY_ID_BIT)) { + if ((gGameStatusPtr->context == CONTEXT_WORLD) || (modelIdx & BATTLE_ENTITY_ID_BIT)) { modelIdx &= ~BATTLE_ENTITY_ID_BIT; model = (*gCurrentEntityModelList)[modelIdx]; @@ -450,7 +450,7 @@ void draw_entity_model_B(s32 modelIdx, Mtx* transformMtx, s32 vertexSegment, Vec f32 x, y, z, w; f32 inX, inY, inZ; - if ((gGameStatusPtr->isBattle == MAIN_STATE_WORLD) || (modelIdx & BATTLE_ENTITY_ID_BIT)) { + if ((gGameStatusPtr->context == CONTEXT_WORLD) || (modelIdx & BATTLE_ENTITY_ID_BIT)) { modelIdx &= ~BATTLE_ENTITY_ID_BIT; model = (*gCurrentEntityModelList)[modelIdx]; @@ -485,7 +485,7 @@ void draw_entity_model_C(s32 modelIdx, Mtx* transformMtx) { RenderTask rt; RenderTask* rtPtr = &rt; - if ((gGameStatusPtr->isBattle == MAIN_STATE_WORLD) || (modelIdx & BATTLE_ENTITY_ID_BIT)) { + if ((gGameStatusPtr->context == CONTEXT_WORLD) || (modelIdx & BATTLE_ENTITY_ID_BIT)) { modelIdx &= ~BATTLE_ENTITY_ID_BIT; model = (*gCurrentEntityModelList)[modelIdx]; @@ -515,7 +515,7 @@ void draw_entity_model_D(s32 modelIdx, Mtx* transformMtx, s32 arg2, Vec3s* verte RenderTask rt; RenderTask* rtPtr = &rt; - if ((gGameStatusPtr->isBattle == MAIN_STATE_WORLD) || (modelIdx & BATTLE_ENTITY_ID_BIT)) { + if ((gGameStatusPtr->context == CONTEXT_WORLD) || (modelIdx & BATTLE_ENTITY_ID_BIT)) { modelIdx &= ~BATTLE_ENTITY_ID_BIT; model = (*gCurrentEntityModelList)[modelIdx]; diff --git a/src/evt/cam_api.c b/src/evt/cam_api.c index ca2ce1b8eb..219338082c 100644 --- a/src/evt/cam_api.c +++ b/src/evt/cam_api.c @@ -278,7 +278,7 @@ API_CALLABLE(ShakeCam) { *(f32*)&script->functionTemp[3] = 1.0f; //TODO functionTempF ? script->functionTemp[1] = duration; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { if (magnitude > 10.0f) { magnitude = 10.0f; } diff --git a/src/evt/model_api.c b/src/evt/model_api.c index cf1c859204..ea6b75379d 100644 --- a/src/evt/model_api.c +++ b/src/evt/model_api.c @@ -50,7 +50,7 @@ void render_animated_models(void) { // split here? API_CALLABLE(InitAnimatedModels) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentMeshAnimationListPtr = &gWorldMeshAnimationList; } else { gCurrentMeshAnimationListPtr = &gBattleMeshAnimationList; @@ -258,7 +258,7 @@ API_CALLABLE(SetAnimatorFlags) { void reset_model_animators(void) { s32 i; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD ) { + if (gGameStatusPtr->context == CONTEXT_WORLD ) { gCurrentMeshAnimationListPtr = &gWorldMeshAnimationList; } else { gCurrentMeshAnimationListPtr = &gBattleMeshAnimationList; @@ -276,7 +276,7 @@ void reset_model_animators(void) { } void init_model_animators(void) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentMeshAnimationListPtr = &gWorldMeshAnimationList; } else { gCurrentMeshAnimationListPtr = &gBattleMeshAnimationList; diff --git a/src/evt/script_list.c b/src/evt/script_list.c index 070dd41785..1130be3c1a 100644 --- a/src/evt/script_list.c +++ b/src/evt/script_list.c @@ -170,7 +170,7 @@ void find_script_labels(Evt* script) { void clear_script_list(void) { s32 i; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentScriptListPtr = &gWorldScriptList; gMapVars = gWorldMapVars; gMapFlags = gWorldMapFlags; @@ -201,7 +201,7 @@ void clear_script_list(void) { } void init_script_list(void) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentScriptListPtr = &gWorldScriptList; gMapVars = gWorldMapVars; gMapFlags = gWorldMapFlags; diff --git a/src/evt/virtual_entity.c b/src/evt/virtual_entity.c index 12dee479ff..0012a011ec 100644 --- a/src/evt/virtual_entity.c +++ b/src/evt/virtual_entity.c @@ -119,7 +119,7 @@ void virtual_entity_list_render_UI(void) { } API_CALLABLE(InitVirtualEntityList) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentVirtualEntityListPtr = &wWorldVirtualEntityList; } else { gCurrentVirtualEntityListPtr = &bBattleVirtualEntityList; @@ -654,7 +654,7 @@ void virtual_entity_delete_by_ref(VirtualEntity* obj) { void clear_virtual_entity_list(void) { s32 i; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentVirtualEntityListPtr = &wWorldVirtualEntityList; } else { gCurrentVirtualEntityListPtr = &bBattleVirtualEntityList; @@ -671,7 +671,7 @@ void clear_virtual_entity_list(void) { } void init_virtual_entity_list(void) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentVirtualEntityListPtr = &wWorldVirtualEntityList; } else { gCurrentVirtualEntityListPtr = &bBattleVirtualEntityList; diff --git a/src/heap.c b/src/heap.c index 2603c2bb3e..8cb5a9a213 100644 --- a/src/heap.c +++ b/src/heap.c @@ -32,7 +32,7 @@ s32 func_8002ACDC(void) { } void* heap_malloc(s32 size) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { return general_heap_malloc(size); } else { return _heap_malloc(&heap_battleHead, size); @@ -40,7 +40,7 @@ void* heap_malloc(s32 size) { } s32 heap_free(void* data) { - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->context != CONTEXT_WORLD) { return _heap_free(&heap_battleHead, data); } else { return general_heap_free(data); @@ -55,7 +55,7 @@ s32 collision_heap_create(void) { } void* collision_heap_malloc(s32 size) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { return _heap_malloc(&heap_collisionHead, size); } else { return _heap_malloc(&heap_battleHead, size); @@ -63,7 +63,7 @@ void* collision_heap_malloc(s32 size) { } s32 collision_heap_free(void* data) { - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->context != CONTEXT_WORLD) { return _heap_free(&heap_battleHead, data); } else { return _heap_free(&heap_collisionHead, data); diff --git a/src/hud_element.c b/src/hud_element.c index 9defbc3e10..a1d6f4eb52 100644 --- a/src/hud_element.c +++ b/src/hud_element.c @@ -190,7 +190,7 @@ void hud_element_load_script(HudElement* hudElement, HudScript* anim) { if (entry->id == -1) { entry->id = raster; entry->data = &gHudElementCacheBuffer[*gHudElementCacheSize]; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { capacity = gHudElementCacheCapacity; } else { capacity = gHudElementCacheCapacity / 2; @@ -198,7 +198,7 @@ void hud_element_load_script(HudElement* hudElement, HudScript* anim) { ASSERT(capacity > *gHudElementCacheSize + gHudElementSizes[preset].size); nuPiReadRom((s32)icon_ROM_START + raster, entry->data, gHudElementSizes[preset].size); *gHudElementCacheSize += gHudElementSizes[preset].size; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { *pos = i; } else { *pos = (u16)(*pos) | (i << 16); @@ -206,7 +206,7 @@ void hud_element_load_script(HudElement* hudElement, HudScript* anim) { i++; break; } else if (entry->id == raster) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { *pos = i; } else { *pos = (u16)(*pos) | (i << 16); @@ -226,7 +226,7 @@ void hud_element_load_script(HudElement* hudElement, HudScript* anim) { if (entry->id == -1) { entry->id = palette; entry->data = &gHudElementCacheBuffer[*gHudElementCacheSize]; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { capacity = gHudElementCacheCapacity; } else { capacity = gHudElementCacheCapacity / 2; @@ -234,7 +234,7 @@ void hud_element_load_script(HudElement* hudElement, HudScript* anim) { ASSERT(capacity > *gHudElementCacheSize + 32); nuPiReadRom((s32)icon_ROM_START + palette, entry->data, 32); *gHudElementCacheSize += 32; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { *pos = i; } else { *pos = (u16)(*pos) | (i << 16); @@ -242,7 +242,7 @@ void hud_element_load_script(HudElement* hudElement, HudScript* anim) { i++; break; } else if (entry->id == palette) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { *pos = i; } else { *pos = (u16)(*pos) | (i << 16); @@ -610,7 +610,7 @@ void hud_element_clear_cache(void) { HudCacheEntry* entryRaster; HudCacheEntry* entryPalette; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gHudElements = &gHudElementsWorld; gHudElementCacheSize = &gHudElementCacheSizeWorld; gHudElementCacheTableRaster = gHudElementCacheTableRasterWorld; @@ -622,7 +622,7 @@ void hud_element_clear_cache(void) { gHudElementCacheTablePalette = gHudElementCacheTablePaletteBattle; } - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gHudElementCacheBuffer = general_heap_malloc(gHudElementCacheCapacity); ASSERT(gHudElementCacheBuffer); gHudElementCacheBufferWorld = gHudElementCacheBuffer; @@ -664,7 +664,7 @@ extern Addr D_80200000; #endif void init_hud_element_list(void) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { if (gHudElementCacheBufferBattle != NULL) { #if VERSION_PAL if (gHudElementCacheBufferBattle != D_80200000) { @@ -755,7 +755,7 @@ s32 hud_element_create(HudScript* anim) { hudElement->tint.g = 255; hudElement->tint.b = 255; - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->context != CONTEXT_WORLD) { hudElement->flags |= HUD_ELEMENT_FLAG_BATTLE; id |= HUD_ELEMENT_BATTLE_ID_MASK; } @@ -2042,7 +2042,7 @@ void hud_element_clear_flags(s32 id, s32 flags) { void ALT_clear_hud_element_cache(void) { s32 i; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { heap_free(gHudElementCacheBuffer); gHudElementCacheBuffer = heap_malloc(gHudElementCacheCapacity); ASSERT(gHudElementCacheBuffer); diff --git a/src/imgfx.c b/src/imgfx.c index f3c9bf422c..7ba39647f7 100644 --- a/src/imgfx.c +++ b/src/imgfx.c @@ -1526,7 +1526,7 @@ void imgfx_appendGfx_mesh_basic(ImgFXState* state, Matrix4f mtx) { ) { cam = &gCameras[gCurrentCamID]; - if (gGameStatusPtr->isBattle == MAIN_STATE_PAUSE) { + if (gGameStatusPtr->context == CONTEXT_PAUSE) { gSPViewport(gMainGfxPos++, &D_8014EE50); } else { gSPViewport(gMainGfxPos++, &cam->vpAlt); @@ -1565,7 +1565,7 @@ void imgfx_appendGfx_mesh_basic(ImgFXState* state, Matrix4f mtx) { alpha2 = 255; cam = &gCameras[gCurrentCamID]; - if (gGameStatusPtr->isBattle == MAIN_STATE_PAUSE) { + if (gGameStatusPtr->context == CONTEXT_PAUSE) { gSPViewport(gMainGfxPos++, &D_8014EE50); } else { gSPViewport(gMainGfxPos++, &cam->vpAlt); @@ -1620,7 +1620,7 @@ void imgfx_appendGfx_mesh_basic(ImgFXState* state, Matrix4f mtx) { && (state->flags & someFlags) ) { cam = &gCameras[gCurrentCamID]; - if (gGameStatusPtr->isBattle == MAIN_STATE_PAUSE) { + if (gGameStatusPtr->context == CONTEXT_PAUSE) { gSPViewport(gMainGfxPos++, &D_8014EE40); D_8014EE50.vp.vtrans[0] = D_8014EE40.vp.vtrans[0] + gGameStatusPtr->altViewportOffset.x; D_8014EE50.vp.vtrans[1] = D_8014EE40.vp.vtrans[1] + gGameStatusPtr->altViewportOffset.y; diff --git a/src/inventory.c b/src/inventory.c index 5d8886ef35..78b623ad7f 100644 --- a/src/inventory.c +++ b/src/inventory.c @@ -578,7 +578,7 @@ void update_status_bar(void) { return; } - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD && playerData->coins != statusBar->displayCoins) { + if (gGameStatusPtr->context == CONTEXT_WORLD && playerData->coins != statusBar->displayCoins) { status_bar_start_blinking_coins(); } @@ -626,7 +626,7 @@ void update_status_bar(void) { // sync displayed HP toward true HP if (statusBar->displayHP != playerData->curHP) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD && playerData->curHP < statusBar->displayHP) { + if (gGameStatusPtr->context == CONTEXT_WORLD && playerData->curHP < statusBar->displayHP) { status_bar_start_blinking_hp(); } if (statusBar->displayHP < playerData->curHP) { @@ -645,7 +645,7 @@ void update_status_bar(void) { // sync displayed FP toward true FP if (statusBar->displayFP != playerData->curFP) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD && playerData->curFP < statusBar->displayFP) { + if (gGameStatusPtr->context == CONTEXT_WORLD && playerData->curFP < statusBar->displayFP) { status_bar_start_blinking_fp(); } if (statusBar->displayFP < playerData->curFP) { @@ -700,7 +700,7 @@ void update_status_bar(void) { } else { if (!statusBar->ignoreChanges) { if (!statusBar->unk_3B || playerStatus->actionState != ACTION_STATE_IDLE) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { statusBar->hidden = TRUE; statusBar->showTimer = 0; statusBar->unk_3C = FALSE; @@ -723,7 +723,7 @@ void update_status_bar(void) { statusBar->showTimer++; } - if (statusBar->showTimer >= 240 && gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (statusBar->showTimer >= 240 && gGameStatusPtr->context == CONTEXT_WORLD) { statusBar->showTimer = 210; statusBar->hidden = FALSE; statusBar->unk_3B = TRUE; @@ -1372,7 +1372,7 @@ s32 is_status_bar_visible(void) { void status_bar_start_blinking_hp(void) { StatusBar* statusBar = &gStatusBar; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { statusBar->hpBlinkTimer = 120; } @@ -1395,7 +1395,7 @@ void status_bar_stop_blinking_hp(void) { void status_bar_start_blinking_fp(void) { StatusBar* statusBar = &gStatusBar; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { statusBar->fpBlinkTimer = 120; } @@ -1417,7 +1417,7 @@ void status_bar_stop_blinking_fp(void) { void status_bar_start_blinking_coins(void) { StatusBar* statusBar = &gStatusBar; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { statusBar->coinsBlinkTimer = 120; } diff --git a/src/item_entity.c b/src/item_entity.c index f9ef4fbb1d..6027f0a383 100644 --- a/src/item_entity.c +++ b/src/item_entity.c @@ -242,7 +242,7 @@ void reveal_item_entity(ItemEntity* item) { void clear_item_entity_data(void) { s32 i; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentItemEntities = WorldItemEntities; } else { gCurrentItemEntities = BattleItemEntities; @@ -258,7 +258,7 @@ void clear_item_entity_data(void) { CoinSparkleCenterZ = 0; ItemEntityAlternatingSpawn = 0; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { ItemEntityRenderGroup = 0; } @@ -271,7 +271,7 @@ void clear_item_entity_data(void) { } void init_item_entity_list(void) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentItemEntities = WorldItemEntities; } else { gCurrentItemEntities = BattleItemEntities; @@ -327,7 +327,7 @@ void item_entity_load(ItemEntity* item) { ASSERT(*gHudElementCacheSize + size < 0x11000); nuPiReadRom((s32)icon_ROM_START + raster, entry->data, size); *gHudElementCacheSize += size; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { *pos = i; } else { *pos = (u16)(*pos) | (i << 16); @@ -337,7 +337,7 @@ void item_entity_load(ItemEntity* item) { } else { cond = entry->id == raster; // TODO required to match if (cond) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { *pos = i; } else { *pos = (u16)(*pos) | (i << 16); @@ -360,7 +360,7 @@ void item_entity_load(ItemEntity* item) { ASSERT(*gHudElementCacheSize + 0x20 < 0x11000); nuPiReadRom((s32)icon_ROM_START + palette, entry->data, 0x20); *gHudElementCacheSize += 0x20; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { *pos = i; } else { *pos = (u16)(*pos) | (i << 16); @@ -368,7 +368,7 @@ void item_entity_load(ItemEntity* item) { pos++; break; } else if (entry->id == palette) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { *pos = i; } else { *pos = (u16)(*pos) | (i << 16); @@ -791,7 +791,7 @@ void item_entity_update(ItemEntity* entity) { entity->nextUpdate = *args++; *args++; *args++; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { entity->lookupRasterIndex = *args++; entity->lookupPaletteIndex = *args++; } else { diff --git a/src/model.c b/src/model.c index 6477c85ba7..f739a540e6 100644 --- a/src/model.c +++ b/src/model.c @@ -2318,7 +2318,7 @@ void mdl_load_all_textures(ModelNode* rootModel, s32 romOffset, s32 size) { s32 baseOffset = 0; // textures are loaded to the upper half of the texture heap when not in the world - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->context != CONTEXT_WORLD) { baseOffset = WORLD_TEXTURE_MEMORY_SIZE; } @@ -2359,7 +2359,7 @@ s32 mdl_get_child_count(ModelNode* model) { void clear_model_data(void) { s32 i; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentModels = &wModelList; gCurrentTransformGroups = &wTransformGroups; gCurrentCustomModelGfxPtr = &wCustomModelGfx; @@ -2424,7 +2424,7 @@ void clear_model_data(void) { } void init_model_data(void) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentModels = &wModelList; gCurrentTransformGroups = &wTransformGroups; gCurrentCustomModelGfxPtr = &wCustomModelGfx; diff --git a/src/npc.c b/src/npc.c index be1cd06a43..73bec256d8 100644 --- a/src/npc.c +++ b/src/npc.c @@ -77,7 +77,7 @@ void mtx_ident_mirror_y(Matrix4f mtx) { void clear_npcs(void) { s32 i; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentNpcListPtr = &gWorldNpcList; } else { gCurrentNpcListPtr = &gBattleNpcList; @@ -92,7 +92,7 @@ void clear_npcs(void) { } void init_npc_list(void) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentNpcListPtr = &gWorldNpcList; } else { gCurrentNpcListPtr = &gBattleNpcList; @@ -207,7 +207,7 @@ s32 create_npc_impl(NpcBlueprint* blueprint, AnimID* animList, s32 isPeachNpc) { npc->shadowIndex = create_shadow_type(SHADOW_VARYING_CIRCLE, npc->pos.x, npc->pos.y, npc->pos.z); npc->shadowScale = 1.0f; - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->context != CONTEXT_WORLD) { i |= BATTLE_NPC_ID_BIT; } return i; diff --git a/src/screen_overlays.c b/src/screen_overlays.c index 56b5f6017e..912e856f57 100644 --- a/src/screen_overlays.c +++ b/src/screen_overlays.c @@ -479,7 +479,7 @@ void func_80138198(void) { void render_screen_overlay_frontUI(void) { if (screen_overlay_frontType != OVERLAY_NONE && screen_overlay_frontZoom != -1.0f - && gGameStatusPtr->isBattle != MAIN_STATE_PAUSE + && gGameStatusPtr->context != CONTEXT_PAUSE ) { _render_transition_stencil(screen_overlay_frontType, screen_overlay_frontZoom, &ScreenOverlays[0]); } @@ -488,7 +488,7 @@ void render_screen_overlay_frontUI(void) { void render_screen_overlay_backUI(void) { if (screen_overlay_backType != OVERLAY_NONE && screen_overlay_backZoom != -1.0f - && gGameStatusPtr->isBattle != MAIN_STATE_PAUSE + && gGameStatusPtr->context != CONTEXT_PAUSE ) { _render_transition_stencil(screen_overlay_backType, screen_overlay_backZoom, &ScreenOverlays[1]); } diff --git a/src/sprite.c b/src/sprite.c index 1825fd7832..9786be6672 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -241,7 +241,7 @@ void spr_appendGfx_component_flat( gDPSetTileSize(gMainGfxPos++, 2, 0, 0, 63 << 2, 0); if (gSpriteShadingProfile->flags & SPR_SHADING_FLAG_SET_VIEWPORT) { Camera* camera = &gCameras[gCurrentCamID]; - if (gGameStatusPtr->isBattle == MAIN_STATE_PAUSE) { + if (gGameStatusPtr->context == CONTEXT_PAUSE) { gSPViewport(gMainGfxPos++, &SprPauseVpAlt); } else { gSPViewport(gMainGfxPos++, &camera->vpAlt); @@ -268,7 +268,7 @@ void spr_appendGfx_component_flat( 256, 256); if (gSpriteShadingProfile->flags & SPR_SHADING_FLAG_SET_VIEWPORT) { Camera* camera = &gCameras[gCurrentCamID]; - if (gGameStatusPtr->isBattle == MAIN_STATE_PAUSE) { + if (gGameStatusPtr->context == CONTEXT_PAUSE) { gSPViewport(gMainGfxPos++, &SprPauseVpAlt); } else { gSPViewport(gMainGfxPos++, &camera->vpAlt); @@ -304,7 +304,7 @@ void spr_appendGfx_component_flat( if (gSpriteShadingProfile->flags & SPR_SHADING_FLAG_SET_VIEWPORT) { Camera* camera = &gCameras[gCurrentCamID]; - if (gGameStatusPtr->isBattle == MAIN_STATE_PAUSE) { + if (gGameStatusPtr->context == CONTEXT_PAUSE) { gSPViewport(gMainGfxPos++, &SprPauseVp); SprPauseVpAlt.vp.vtrans[0] = SprPauseVp.vp.vtrans[0] + gGameStatusPtr->altViewportOffset.x; SprPauseVpAlt.vp.vtrans[1] = SprPauseVp.vp.vtrans[1] + gGameStatusPtr->altViewportOffset.y; diff --git a/src/sprite_shading.c b/src/sprite_shading.c index 536443730a..d0d1e07f0e 100644 --- a/src/sprite_shading.c +++ b/src/sprite_shading.c @@ -37,7 +37,7 @@ void clear_sprite_shading_data(void) { } void init_sprite_shading_data(void) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gSpriteShadingProfile = &wSpriteShadingProfile; gAuxSpriteShadingProfile = &wSpriteShadingProfileAux; } else { diff --git a/src/state_battle.c b/src/state_battle.c index ecdeaa6522..63ee4687b6 100644 --- a/src/state_battle.c +++ b/src/state_battle.c @@ -57,7 +57,7 @@ void state_step_battle(void) { nuContRmbForceStopEnd(); sfx_stop_env_sounds(); func_8003B1A8(); - gGameStatusPtr->isBattle = MAIN_STATE_BATTLE; + gGameStatusPtr->context = CONTEXT_BATTLE; backup_map_collision_data(); #if !VERSION_IQUE @@ -146,7 +146,7 @@ void state_step_end_battle(void) { mapSettings = get_current_map_settings(); mapConfig = &gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID]; btl_restore_world_cameras(); - gGameStatusPtr->isBattle = MAIN_STATE_WORLD; + gGameStatusPtr->context = CONTEXT_WORLD; func_8005AF84(); func_8002ACDC(); sfx_clear_env_sounds(1); diff --git a/src/state_demo.c b/src/state_demo.c index 9c74f112d3..d0db4c3d4d 100644 --- a/src/state_demo.c +++ b/src/state_demo.c @@ -191,7 +191,7 @@ void state_step_demo(void) { gGameStatusPtr->demoState = DEMO_STATE_NONE; gGameStatusPtr->peachFlags = 0; enable_sounds(); - gGameStatusPtr->isBattle = MAIN_STATE_WORLD; + gGameStatusPtr->context = CONTEXT_WORLD; gGameStatusPtr->debugUnused1 = FALSE; gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE; gGameStatusPtr->keepUsingPartnerOnMapChange = FALSE; diff --git a/src/state_file_select.c b/src/state_file_select.c index a89bacf617..cef428fde2 100644 --- a/src/state_file_select.c +++ b/src/state_file_select.c @@ -139,7 +139,7 @@ void state_step_language_select(void) { D_800A0930 = -1; sfx_stop_env_sounds(); func_8003B1A8(); - gGameStatusPtr->isBattle = MAIN_STATE_PAUSE; + gGameStatusPtr->context = CONTEXT_PAUSE; backup_map_collision_data(); battle_heap_create(); sfx_clear_env_sounds(0); @@ -292,7 +292,7 @@ void state_step_exit_language_select(void) { gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME; mapSettings = get_current_map_settings(); mapConfig = &gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID]; - gGameStatusPtr->isBattle = MAIN_STATE_WORLD; + gGameStatusPtr->context = CONTEXT_WORLD; func_8005AF84(); func_8002ACDC(); sfx_clear_env_sounds(1); diff --git a/src/state_intro.c b/src/state_intro.c index 307167d5b1..b502593931 100644 --- a/src/state_intro.c +++ b/src/state_intro.c @@ -156,7 +156,7 @@ void state_step_intro(void) { break; case INTRO_LOAD_MAP: set_curtain_draw_callback(NULL); - gGameStatusPtr->isBattle = MAIN_STATE_WORLD; + gGameStatusPtr->context = CONTEXT_WORLD; gGameStatusPtr->debugUnused1 = FALSE; gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE; gGameStatusPtr->keepUsingPartnerOnMapChange = FALSE; diff --git a/src/state_pause.c b/src/state_pause.c index e5d8d94c8e..917dec7bf9 100644 --- a/src/state_pause.c +++ b/src/state_pause.c @@ -82,7 +82,7 @@ void state_step_pause(void) { gGameStatusPtr->savedBackgroundDarkness = gGameStatusPtr->backgroundDarkness; sfx_stop_env_sounds(); func_8003B1A8(); - gGameStatusPtr->isBattle = MAIN_STATE_PAUSE; + gGameStatusPtr->context = CONTEXT_PAUSE; backup_map_collision_data(); battle_heap_create(); nuContRmbForceStop(); @@ -163,7 +163,7 @@ void state_step_unpause(void) { gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME; mapSettings = get_current_map_settings(); mapConfig = &gAreas[gGameStatusPtr->areaID].maps[gGameStatusPtr->mapID]; - gGameStatusPtr->isBattle = MAIN_STATE_WORLD; + gGameStatusPtr->context = CONTEXT_WORLD; gGameStatusPtr->backgroundFlags &= ~BACKGROUND_RENDER_STATE_MASK; func_8005AF84(); func_8002ACDC(); diff --git a/src/state_startup.c b/src/state_startup.c index 0e833e5e43..b9d4e7aa5e 100644 --- a/src/state_startup.c +++ b/src/state_startup.c @@ -20,7 +20,7 @@ void state_step_startup(void) { gOverrideFlags = 0; gGameStatusPtr->areaID = 0; - gGameStatusPtr->isBattle = MAIN_STATE_WORLD; + gGameStatusPtr->context = CONTEXT_WORLD; gameStatus->prevArea = -1; gameStatus->mapID = 0; gameStatus->entryID = 0; diff --git a/src/state_title_screen.c b/src/state_title_screen.c index b692af0bb2..751ea3da6b 100644 --- a/src/state_title_screen.c +++ b/src/state_title_screen.c @@ -126,7 +126,7 @@ void state_init_title_screen(void) { sfx_set_reverb_mode(0); gGameStatusPtr->startupState = TITLE_STATE_INIT; gGameStatusPtr->logoTime = 0; - gGameStatusPtr->isBattle = MAIN_STATE_WORLD; + gGameStatusPtr->context = CONTEXT_WORLD; gGameStatusPtr->introPart = INTRO_PART_NONE; startup_fade_screen_update(); titleData = load_asset_by_name("title_data", &titleDataSize); diff --git a/src/status_icons.c b/src/status_icons.c index 94198faa63..c02c442e65 100644 --- a/src/status_icons.c +++ b/src/status_icons.c @@ -615,7 +615,7 @@ void draw_all_status_icons(void* data) { if (icon->status1.activeTask == STATUS_ICON_TASK_DRAW) { if (icon->flags & STATUS_ICON_FLAG_DEBUFF) { hud_element_set_flags(icon->status1.activeElementID, HUD_ELEMENT_FLAG_DISABLED); - } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != MAIN_STATE_BATTLE) { + } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) { hud_element_clear_flags(icon->status1.activeElementID, HUD_ELEMENT_FLAG_DISABLED); x = icon->worldPos.x; @@ -633,7 +633,7 @@ void draw_all_status_icons(void* data) { } if (icon->status1.removingTask == STATUS_ICON_TASK_DRAW - && (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != MAIN_STATE_BATTLE) + && (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) ) { hud_element_clear_flags(icon->status1.removingElementID, HUD_ELEMENT_FLAG_DISABLED); @@ -656,7 +656,7 @@ void draw_all_status_icons(void* data) { if (icon->status2.activeTask == STATUS_ICON_TASK_DRAW) { if (icon->flags & STATUS_ICON_FLAG_STATIC) { hud_element_set_flags(icon->status2.activeElementID, HUD_ELEMENT_FLAG_DISABLED); - } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != MAIN_STATE_BATTLE) { + } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) { hud_element_clear_flags(icon->status2.activeElementID, HUD_ELEMENT_FLAG_DISABLED); offsetY = 0; @@ -680,7 +680,7 @@ void draw_all_status_icons(void* data) { } if (icon->status2.removingTask == STATUS_ICON_TASK_DRAW - && (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != MAIN_STATE_BATTLE) + && (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) ) { hud_element_clear_flags(icon->status2.removingElementID, HUD_ELEMENT_FLAG_DISABLED); @@ -707,7 +707,7 @@ void draw_all_status_icons(void* data) { if (icon->status3.activeTask == STATUS_ICON_TASK_DRAW) { if (icon->flags & STATUS_ICON_FLAG_TRANSPARENT) { hud_element_set_flags(icon->status3.activeElementID, HUD_ELEMENT_FLAG_DISABLED); - } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != MAIN_STATE_BATTLE) { + } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) { hud_element_clear_flags(icon->status3.activeElementID, HUD_ELEMENT_FLAG_DISABLED); offsetY = 0; @@ -732,7 +732,7 @@ void draw_all_status_icons(void* data) { } if (icon->status3.removingTask == STATUS_ICON_TASK_DRAW - && (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != MAIN_STATE_BATTLE) + && (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) ) { hud_element_clear_flags(icon->status3.removingElementID, HUD_ELEMENT_FLAG_DISABLED); @@ -762,7 +762,7 @@ void draw_all_status_icons(void* data) { if (icon->status4.activeTask == STATUS_ICON_TASK_DRAW) { if (icon->flags & STATUS_ICON_FLAG_STATUS_CHILL_OUT) { hud_element_set_flags(icon->status4.activeElementID, HUD_ELEMENT_FLAG_DISABLED); - } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != MAIN_STATE_BATTLE) { + } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) { hud_element_clear_flags(icon->status4.activeElementID, HUD_ELEMENT_FLAG_DISABLED); offsetY = 0; @@ -791,7 +791,7 @@ void draw_all_status_icons(void* data) { } if (icon->status4.removingTask == STATUS_ICON_TASK_DRAW - && (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != MAIN_STATE_BATTLE) + && (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) ) { hud_element_clear_flags(icon->status4.removingElementID, HUD_ELEMENT_FLAG_DISABLED); @@ -824,7 +824,7 @@ void draw_all_status_icons(void* data) { if (icon->boostJump.active) { if (icon->flags & STATUS_ICON_FLAG_BOOST_JUMP) { hud_element_set_flags(icon->boostJump.activeElementID, HUD_ELEMENT_FLAG_DISABLED); - } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != MAIN_STATE_BATTLE) { + } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) { hud_element_clear_flags(icon->boostJump.activeElementID, HUD_ELEMENT_FLAG_DISABLED); x = icon->worldPos.x; @@ -854,7 +854,7 @@ void draw_all_status_icons(void* data) { if (icon->boostHammer.active) { if (icon->flags & STATUS_ICON_FLAG_BOOST_HAMMER) { hud_element_set_flags(icon->boostHammer.activeElementID, HUD_ELEMENT_FLAG_DISABLED); - } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != MAIN_STATE_BATTLE) { + } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) { hud_element_clear_flags(icon->boostHammer.activeElementID, HUD_ELEMENT_FLAG_DISABLED); x = icon->worldPos.x; @@ -884,7 +884,7 @@ void draw_all_status_icons(void* data) { if (icon->boostPartner.active) { if (icon->flags & STATUS_ICON_FLAG_BOOST_PARTNER) { hud_element_set_flags(icon->boostPartner.activeElementID, HUD_ELEMENT_FLAG_DISABLED); - } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != MAIN_STATE_BATTLE) { + } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) { hud_element_clear_flags(icon->boostPartner.activeElementID, HUD_ELEMENT_FLAG_DISABLED); x = icon->worldPos.x; @@ -902,7 +902,7 @@ void draw_all_status_icons(void* data) { if (icon->surprise.active) { if (icon->flags & STATUS_ICON_FLAG_SURPRISE) { hud_element_set_flags(icon->surprise.activeElementID, HUD_ELEMENT_FLAG_DISABLED); - } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != MAIN_STATE_BATTLE) { + } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) { hud_element_clear_flags(icon->surprise.activeElementID, HUD_ELEMENT_FLAG_DISABLED); x = icon->worldPos.x; @@ -920,7 +920,7 @@ void draw_all_status_icons(void* data) { if (icon->peril.active) { if (icon->flags & STATUS_ICON_FLAG_PERIL) { hud_element_set_flags(icon->peril.activeElementID, HUD_ELEMENT_FLAG_DISABLED); - } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != MAIN_STATE_BATTLE) { + } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) { hud_element_clear_flags(icon->peril.activeElementID, HUD_ELEMENT_FLAG_DISABLED); x = icon->worldPos.x; @@ -938,7 +938,7 @@ void draw_all_status_icons(void* data) { if (icon->danger.active) { if (icon->flags & STATUS_ICON_FLAG_DANGER) { hud_element_set_flags(icon->danger.activeElementID, HUD_ELEMENT_FLAG_DISABLED); - } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != MAIN_STATE_BATTLE) { + } else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->context != CONTEXT_BATTLE) { hud_element_clear_flags(icon->danger.activeElementID, HUD_ELEMENT_FLAG_DISABLED); x = icon->worldPos.x; @@ -968,7 +968,7 @@ s32 create_status_icon_set(void) { icon->flags = STATUS_ICON_FLAG_USED; - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->context != CONTEXT_WORLD) { icon->flags |= STATUS_ICON_FLAG_BATTLE; } diff --git a/src/trigger.c b/src/trigger.c index 357862d09d..7f6c663b81 100644 --- a/src/trigger.c +++ b/src/trigger.c @@ -13,7 +13,7 @@ void clear_trigger_data(void) { CollisionStatus* collisionStatus = &gCollisionStatus; s32 i; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentTriggerListPtr = &wTriggerList; } else { gCurrentTriggerListPtr = &bTriggerList; @@ -42,7 +42,7 @@ void clear_trigger_data(void) { } void init_trigger_list(void) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentTriggerListPtr = &wTriggerList; } else { gCurrentTriggerListPtr = &bTriggerList; diff --git a/src/worker.c b/src/worker.c index 36cb11e593..ca8fa7c521 100644 --- a/src/worker.c +++ b/src/worker.c @@ -10,7 +10,7 @@ void worker_delegate_do_nothing(void) { void clear_worker_list(void) { s32 i; - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentWorkerListPtr = &gWorldWorkerList; } else { gCurrentWorkerListPtr = &gBattleWorkerList; @@ -22,7 +22,7 @@ void clear_worker_list(void) { } void init_worker_list(void) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + if (gGameStatusPtr->context == CONTEXT_WORLD) { gCurrentWorkerListPtr = &gWorldWorkerList; } else { gCurrentWorkerListPtr = &gBattleWorkerList; @@ -54,7 +54,7 @@ s32 create_worker_world(void (*updateFunc)(void), void (*drawFunc)(void)) { worker->draw = worker_delegate_do_nothing; } - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->context != CONTEXT_WORLD) { i |= BATTLE_ENTITY_ID_BIT; } return i; @@ -85,7 +85,7 @@ s32 create_worker_frontUI(void (*updateFunc)(void), void (*drawFunc)(void)) { worker->draw = worker_delegate_do_nothing; } - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->context != CONTEXT_WORLD) { i |= BATTLE_ENTITY_ID_BIT; } return i; @@ -116,7 +116,7 @@ s32 create_worker_backUI(void (*updateFunc)(void), void (*drawFunc)(void)) { worker->draw = &worker_delegate_do_nothing; } - if (gGameStatusPtr->isBattle != MAIN_STATE_WORLD) { + if (gGameStatusPtr->context != CONTEXT_WORLD) { i |= BATTLE_ENTITY_ID_BIT; } return i; @@ -174,7 +174,7 @@ void render_workers_backUI(void) { } void free_worker(s32 idx) { - if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD || (idx & BATTLE_ENTITY_ID_BIT)) { + if (gGameStatusPtr->context == CONTEXT_WORLD || (idx & BATTLE_ENTITY_ID_BIT)) { idx &= ~BATTLE_ENTITY_ID_BIT; if ((*gCurrentWorkerListPtr)[idx] != NULL) { heap_free((*gCurrentWorkerListPtr)[idx]); diff --git a/src/world/action/misc.c b/src/world/action/misc.c index 781e282561..4cfd6a7212 100644 --- a/src/world/action/misc.c +++ b/src/world/action/misc.c @@ -155,7 +155,7 @@ void action_update_first_strike(void) { if (playerStatus->curStateTime != 0) { playerStatus->curStateTime--; - } else if (gGameStatusPtr->isBattle == MAIN_STATE_WORLD) { + } else if (gGameStatusPtr->context == CONTEXT_WORLD) { set_action_state(ACTION_STATE_IDLE); } } diff --git a/src/world/area_gv/gv_01/main.c b/src/world/area_gv/gv_01/main.c index b495521511..657611f05d 100644 --- a/src/world/area_gv/gv_01/main.c +++ b/src/world/area_gv/gv_01/main.c @@ -282,7 +282,7 @@ API_CALLABLE(N(FadeToTitleScreen)) { } API_CALLABLE(N(ChangeStateToTitleScreen)) { - gGameStatusPtr->isBattle = MAIN_STATE_WORLD; + gGameStatusPtr->context = CONTEXT_WORLD; gGameStatusPtr->debugUnused1 = FALSE; gGameStatusPtr->debugScripts = DEBUG_SCRIPTS_NONE; gGameStatusPtr->keepUsingPartnerOnMapChange = FALSE;