summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorPepe20129 <72659707+Pepe20129@users.noreply.github.com>2024-11-19 17:44:44 +0100
committerGitHub <noreply@github.com>2024-11-19 09:44:44 -0700
commit9bed5af33b920cc0d44b410dce152de784ce56b3 (patch)
tree2d67b200f9dfb3bbb3ecd2f80ac9b740d60e3481 /soh/src/code
parent70f3dfa8c59890819c3c4539bdcf75b20f15badd (diff)
OTRGlobals cleanup (#4251)
* Remove unused headers * Move all "ResourceMgr_" functions to a new file * Don't transitively include SaveManager * Move cvar prefixes to a new header * Add missing includes * Update OTRGlobals.cpp * Fix build * Address review * Fix some of the errors * Update gameplaystats.h * Update z_en_in.c * Hopefully fix the linux issues * Fix Linux issues for real this time, I checked * Update ResourceManagerHelpers.cpp * Update z_obj_mure2.c * Post-merge fixes * Fix build (hopefully) * Post-merge fixes * Update z_file_nameset_PAL.c * cleanup some unnecessary headers (#7) --------- Co-authored-by: Archez <Archez@users.noreply.github.com>
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/audio_load.c1
-rw-r--r--soh/src/code/audio_playback.c1
-rw-r--r--soh/src/code/audio_seqplayer.c1
-rw-r--r--soh/src/code/code_800EC960.c1
-rw-r--r--soh/src/code/game.c1
-rw-r--r--soh/src/code/gfxprint.c2
-rw-r--r--soh/src/code/padmgr.c2
-rw-r--r--soh/src/code/z_actor.c1
-rw-r--r--soh/src/code/z_bgcheck.c3
-rw-r--r--soh/src/code/z_cheap_proc.c1
-rw-r--r--soh/src/code/z_demo.c2
-rw-r--r--soh/src/code/z_elf_message.c1
-rw-r--r--soh/src/code/z_en_item00.c1
-rw-r--r--soh/src/code/z_fbdemo_circle.c2
-rw-r--r--soh/src/code/z_fcurve_data_skelanime.c1
-rw-r--r--soh/src/code/z_game_over.c1
-rw-r--r--soh/src/code/z_kankyo.c2
-rw-r--r--soh/src/code/z_lifemeter.c1
-rw-r--r--soh/src/code/z_lights.c1
-rw-r--r--soh/src/code/z_map_exp.c1
-rw-r--r--soh/src/code/z_map_mark.c2
-rw-r--r--soh/src/code/z_parameter.c3
-rw-r--r--soh/src/code/z_play.c2
-rw-r--r--soh/src/code/z_player_lib.c1
-rw-r--r--soh/src/code/z_rcp.c1
-rw-r--r--soh/src/code/z_room.c2
-rw-r--r--soh/src/code/z_scene_table.c2
-rw-r--r--soh/src/code/z_skelanime.c2
-rw-r--r--soh/src/code/z_skin_awb.c1
-rw-r--r--soh/src/code/z_sram.c2
-rw-r--r--soh/src/code/z_ss_sram.c1
31 files changed, 45 insertions, 1 deletions
diff --git a/soh/src/code/audio_load.c b/soh/src/code/audio_load.c
index cb7ba60bb..3c7224612 100644
--- a/soh/src/code/audio_load.c
+++ b/soh/src/code/audio_load.c
@@ -7,6 +7,7 @@
#include "soh/OTRGlobals.h"
#include "soh/Enhancements/audio/AudioCollection.h"
#include "soh/Enhancements/audio/AudioEditor.h"
+#include "soh/ResourceManagerHelpers.h"
#define MK_ASYNC_MSG(retData, tableType, id, status) (((retData) << 24) | ((tableType) << 16) | ((id) << 8) | (status))
#define ASYNC_TBLTYPE(v) ((u8)(v >> 16))
diff --git a/soh/src/code/audio_playback.c b/soh/src/code/audio_playback.c
index 39be0c3a7..3b3089e2c 100644
--- a/soh/src/code/audio_playback.c
+++ b/soh/src/code/audio_playback.c
@@ -1,4 +1,5 @@
#include "global.h"
+#include "soh/ResourceManagerHelpers.h"
#include <libultraship/bridge.h>
extern bool gUseLegacySD;
diff --git a/soh/src/code/audio_seqplayer.c b/soh/src/code/audio_seqplayer.c
index 8d484575d..e194fd28b 100644
--- a/soh/src/code/audio_seqplayer.c
+++ b/soh/src/code/audio_seqplayer.c
@@ -4,6 +4,7 @@
#include "global.h"
#include "soh/Enhancements/audio/AudioEditor.h"
+#include "soh/ResourceManagerHelpers.h"
extern char** sequenceMap;
diff --git a/soh/src/code/code_800EC960.c b/soh/src/code/code_800EC960.c
index 90e49bbd3..d8da87bb4 100644
--- a/soh/src/code/code_800EC960.c
+++ b/soh/src/code/code_800EC960.c
@@ -1,5 +1,6 @@
#include <libultraship/libultra.h>
#include "global.h"
+#include "soh/OTRGlobals.h"
#include "soh/Enhancements/audio/AudioEditor.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
diff --git a/soh/src/code/game.c b/soh/src/code/game.c
index 90438b5db..a14266719 100644
--- a/soh/src/code/game.c
+++ b/soh/src/code/game.c
@@ -4,6 +4,7 @@
#include "libultraship/bridge.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
+#include "soh/ResourceManagerHelpers.h"
SpeedMeter D_801664D0;
VisCvg sVisCvg;
diff --git a/soh/src/code/gfxprint.c b/soh/src/code/gfxprint.c
index 6d8686074..42e9c3e16 100644
--- a/soh/src/code/gfxprint.c
+++ b/soh/src/code/gfxprint.c
@@ -1,5 +1,7 @@
#include "global.h"
#include "align_asset_macro.h"
+#include "soh/OTRGlobals.h"
+#include "soh/ResourceManagerHelpers.h"
u16 sGfxPrintFontTLUT[64] = {
0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000,
diff --git a/soh/src/code/padmgr.c b/soh/src/code/padmgr.c
index 57dd2c6f7..8665fb448 100644
--- a/soh/src/code/padmgr.c
+++ b/soh/src/code/padmgr.c
@@ -3,6 +3,8 @@
#include <string.h>
#include "soh/Enhancements/game-interactor/GameInteractor.h"
+#include "soh/OTRGlobals.h"
+#include "soh/ResourceManagerHelpers.h"
s32 D_8012D280 = 1;
diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c
index f69e18f1c..a9f5aeab0 100644
--- a/soh/src/code/z_actor.c
+++ b/soh/src/code/z_actor.c
@@ -13,6 +13,7 @@
#include "soh/Enhancements/nametag.h"
#include "soh/ActorDB.h"
+#include "soh/OTRGlobals.h"
#include <string.h>
#include <stdlib.h>
diff --git a/soh/src/code/z_bgcheck.c b/soh/src/code/z_bgcheck.c
index 2a385f966..df7dd0600 100644
--- a/soh/src/code/z_bgcheck.c
+++ b/soh/src/code/z_bgcheck.c
@@ -1,7 +1,8 @@
#include "global.h"
#include "vt.h"
-#include <soh/OTRGlobals.h>
+#include "soh/OTRGlobals.h"
+#include "soh/ResourceManagerHelpers.h"
#include <assert.h>
#define SS_NULL 0xFFFF
diff --git a/soh/src/code/z_cheap_proc.c b/soh/src/code/z_cheap_proc.c
index cf52db2d3..4af2867e5 100644
--- a/soh/src/code/z_cheap_proc.c
+++ b/soh/src/code/z_cheap_proc.c
@@ -1,4 +1,5 @@
#include "global.h"
+#include "soh/ResourceManagerHelpers.h"
void Gfx_DrawDListOpa(PlayState* play, Gfx* dlist) {
OPEN_DISPS(play->state.gfxCtx);
diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c
index 5c2348829..2129dbf10 100644
--- a/soh/src/code/z_demo.c
+++ b/soh/src/code/z_demo.c
@@ -32,6 +32,8 @@
#include "scenes/misc/hakaana_ouke/hakaana_ouke_scene.h"
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
+#include "soh/OTRGlobals.h"
+#include "soh/ResourceManagerHelpers.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
u16 D_8011E1C0 = 0;
diff --git a/soh/src/code/z_elf_message.c b/soh/src/code/z_elf_message.c
index e586c1bcc..91f00105f 100644
--- a/soh/src/code/z_elf_message.c
+++ b/soh/src/code/z_elf_message.c
@@ -1,6 +1,7 @@
#include "global.h"
#include "z64elf_message.h"
#include <assert.h>
+#include "soh/OTRGlobals.h"
ElfMessage sChildSariaMsgs[] = {
ELF_MSG_STRENGTH_UPG(SKIP, 3, false, 0),
diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c
index 9e2ec53cf..93e5fad42 100644
--- a/soh/src/code/z_en_item00.c
+++ b/soh/src/code/z_en_item00.c
@@ -4,6 +4,7 @@
#include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h"
#include "textures/icon_item_static/icon_item_static.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
+#include "soh/OTRGlobals.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#define FLAGS 0
diff --git a/soh/src/code/z_fbdemo_circle.c b/soh/src/code/z_fbdemo_circle.c
index 8d92b03f9..f077d5171 100644
--- a/soh/src/code/z_fbdemo_circle.c
+++ b/soh/src/code/z_fbdemo_circle.c
@@ -1,5 +1,7 @@
#include "global.h"
#include <string.h>
+#include "soh/OTRGlobals.h"
+#include "soh/ResourceManagerHelpers.h"
// unused
Gfx sCircleNullDList[] = {
diff --git a/soh/src/code/z_fcurve_data_skelanime.c b/soh/src/code/z_fcurve_data_skelanime.c
index c75450be2..3daa6528a 100644
--- a/soh/src/code/z_fcurve_data_skelanime.c
+++ b/soh/src/code/z_fcurve_data_skelanime.c
@@ -1,5 +1,6 @@
#include "global.h"
#include <assert.h>
+#include "soh/ResourceManagerHelpers.h"
void SkelCurve_Clear(SkelAnimeCurve* skelCurve) {
skelCurve->limbCount = 0;
diff --git a/soh/src/code/z_game_over.c b/soh/src/code/z_game_over.c
index 2d46a1899..a2bdfc1a5 100644
--- a/soh/src/code/z_game_over.c
+++ b/soh/src/code/z_game_over.c
@@ -1,4 +1,5 @@
#include "global.h"
+#include "soh/OTRGlobals.h"
void GameOver_Init(PlayState* play) {
play->gameOverCtx.state = GAMEOVER_INACTIVE;
diff --git a/soh/src/code/z_kankyo.c b/soh/src/code/z_kankyo.c
index e573b0f57..6e3736b77 100644
--- a/soh/src/code/z_kankyo.c
+++ b/soh/src/code/z_kankyo.c
@@ -4,6 +4,8 @@
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#include "soh/frame_interpolation.h"
+#include "soh/OTRGlobals.h"
+#include "soh/ResourceManagerHelpers.h"
typedef enum {
/* 0 */ LENS_FLARE_CIRCLE0,
diff --git a/soh/src/code/z_lifemeter.c b/soh/src/code/z_lifemeter.c
index 15d136eab..52742bc62 100644
--- a/soh/src/code/z_lifemeter.c
+++ b/soh/src/code/z_lifemeter.c
@@ -1,6 +1,7 @@
#include "global.h"
#include "textures/parameter_static/parameter_static.h"
#include "soh/frame_interpolation.h"
+#include "soh/OTRGlobals.h"
s16 Top_LM_Margin = 0;
s16 Left_LM_Margin = 0;
diff --git a/soh/src/code/z_lights.c b/soh/src/code/z_lights.c
index aed55eda0..d45d10cc9 100644
--- a/soh/src/code/z_lights.c
+++ b/soh/src/code/z_lights.c
@@ -5,6 +5,7 @@
#include "objects/gameplay_keep/gameplay_keep.h"
#include "soh/frame_interpolation.h"
+#include "soh/OTRGlobals.h"
#define LIGHTS_BUFFER_SIZE 32
//#define LIGHTS_BUFFER_SIZE 1024 // Kill me
diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c
index 637823b57..be358f075 100644
--- a/soh/src/code/z_map_exp.c
+++ b/soh/src/code/z_map_exp.c
@@ -5,6 +5,7 @@
#include "textures/map_i_static/map_i_static.h"
#include "textures/map_grand_static/map_grand_static.h"
#include <assert.h>
+#include "soh/OTRGlobals.h"
MapData* gMapData;
diff --git a/soh/src/code/z_map_mark.c b/soh/src/code/z_map_mark.c
index df8ef4464..1831b8fdd 100644
--- a/soh/src/code/z_map_mark.c
+++ b/soh/src/code/z_map_mark.c
@@ -1,6 +1,8 @@
#include "global.h"
#include "vt.h"
#include "textures/parameter_static/parameter_static.h"
+#include "soh/OTRGlobals.h"
+#include "soh/ResourceManagerHelpers.h"
typedef struct {
/* 0x00 */ void* texture;
diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c
index a9fa846d2..2c180c584 100644
--- a/soh/src/code/z_parameter.c
+++ b/soh/src/code/z_parameter.c
@@ -21,6 +21,9 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/Enhancements/randomizer/randomizer_grotto.h"
+#include "soh/OTRGlobals.h"
+#include "soh/ResourceManagerHelpers.h"
+#include "soh/Enhancements/gameplaystats.h"
#define DO_ACTION_TEX_WIDTH() 48
#define DO_ACTION_TEX_HEIGHT() 16
diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c
index 83bffcd27..219b3a448 100644
--- a/soh/src/code/z_play.c
+++ b/soh/src/code/z_play.c
@@ -11,6 +11,8 @@
#include <overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h>
#include "soh/Enhancements/enhancementTypes.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
+#include "soh/OTRGlobals.h"
+#include "soh/SaveManager.h"
#include "soh/framebuffer_effects.h"
#include <libultraship/libultraship.h>
diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c
index 6def1f410..7afa6fdd3 100644
--- a/soh/src/code/z_player_lib.c
+++ b/soh/src/code/z_player_lib.c
@@ -8,6 +8,7 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/randomizer/draw.h"
+#include "soh/ResourceManagerHelpers.h"
#include <stdlib.h>
diff --git a/soh/src/code/z_rcp.c b/soh/src/code/z_rcp.c
index 978c04d3c..767772949 100644
--- a/soh/src/code/z_rcp.c
+++ b/soh/src/code/z_rcp.c
@@ -1,5 +1,6 @@
#include "global.h"
#include <assert.h>
+#include "soh/OTRGlobals.h"
Gfx sSetupDL[SETUPDL_MAX][6] = {
{
diff --git a/soh/src/code/z_room.c b/soh/src/code/z_room.c
index 1478d50f8..2e8cdc655 100644
--- a/soh/src/code/z_room.c
+++ b/soh/src/code/z_room.c
@@ -9,6 +9,8 @@
#include <assert.h>
#include "public/bridge/gfxbridge.h"
+#include "soh/OTRGlobals.h"
+#include "soh/ResourceManagerHelpers.h"
void func_80095AB4(PlayState* play, Room* room, u32 flags);
void func_80095D04(PlayState* play, Room* room, u32 flags);
diff --git a/soh/src/code/z_scene_table.c b/soh/src/code/z_scene_table.c
index 9cb9a31d7..c7d76db01 100644
--- a/soh/src/code/z_scene_table.c
+++ b/soh/src/code/z_scene_table.c
@@ -25,6 +25,8 @@
#include "soh/mq_asset_hacks.h"
#include "soh/Enhancements/randomizer/adult_trade_shuffle.h"
+#include "soh/OTRGlobals.h"
+#include "soh/ResourceManagerHelpers.h"
// Entrance Table definition
#define DEFINE_ENTRANCE(_0, sceneId, spawn, continueBgm, displayTitleCard, endTransType, startTransType) \
diff --git a/soh/src/code/z_skelanime.c b/soh/src/code/z_skelanime.c
index 0bcf39236..e91de847b 100644
--- a/soh/src/code/z_skelanime.c
+++ b/soh/src/code/z_skelanime.c
@@ -3,6 +3,8 @@
#include <string.h>
#include <stdio.h>
#include <assert.h>
+#include "soh/OTRGlobals.h"
+#include "soh/ResourceManagerHelpers.h"
#define ANIM_INTERP 1
diff --git a/soh/src/code/z_skin_awb.c b/soh/src/code/z_skin_awb.c
index d0ebe75b4..3627797b4 100644
--- a/soh/src/code/z_skin_awb.c
+++ b/soh/src/code/z_skin_awb.c
@@ -1,6 +1,7 @@
#include "global.h"
#include "overlays/actors/ovl_En_fHG/z_en_fhg.h"
#include <assert.h>
+#include "soh/ResourceManagerHelpers.h"
/**
* Initialises the Vtx buffers used for limb at index `limbIndex`
diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c
index 388d59ec9..e7e43a823 100644
--- a/soh/src/code/z_sram.c
+++ b/soh/src/code/z_sram.c
@@ -5,6 +5,8 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/Enhancements/randomizer/savefile.h"
+#include "soh/OTRGlobals.h"
+#include "soh/SaveManager.h"
#define NUM_DUNGEONS 8
#define NUM_COWS 10
diff --git a/soh/src/code/z_ss_sram.c b/soh/src/code/z_ss_sram.c
index 51f28a068..8cea4b5d4 100644
--- a/soh/src/code/z_ss_sram.c
+++ b/soh/src/code/z_ss_sram.c
@@ -1,5 +1,6 @@
#include <libultraship/libultra.h>
#include "global.h"
+#include "soh/OTRGlobals.h"
#include <stdio.h>
#include <assert.h>