From 9bed5af33b920cc0d44b410dce152de784ce56b3 Mon Sep 17 00:00:00 2001 From: Pepe20129 <72659707+Pepe20129@users.noreply.github.com> Date: Tue, 19 Nov 2024 17:44:44 +0100 Subject: [PATCH] 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 --- soh/include/global.h | 2 +- .../Enhancements/audio/AudioCollection.cpp | 1 + soh/soh/Enhancements/audio/AudioEditor.cpp | 5 +- soh/soh/Enhancements/bootcommands.c | 1 + soh/soh/Enhancements/controls/InputViewer.cpp | 1 + .../controls/SohInputEditorWindow.cpp | 1 + .../cosmetics/CosmeticsEditor.cpp | 5 +- .../cosmetics/authenticGfxPatches.cpp | 7 +- soh/soh/Enhancements/debugconsole.cpp | 1 + .../Enhancements/debugger/MessageViewer.cpp | 1 + soh/soh/Enhancements/debugger/actorViewer.cpp | 1 + soh/soh/Enhancements/debugger/colViewer.cpp | 1 + .../Enhancements/debugger/debugSaveEditor.cpp | 1 + soh/soh/Enhancements/debugger/valueViewer.cpp | 1 + soh/soh/Enhancements/enemyrandomizer.cpp | 4 +- .../GameInteractor_RawAction.cpp | 1 + soh/soh/Enhancements/gameplaystats.cpp | 3 +- soh/soh/Enhancements/gameplaystats.h | 13 +- soh/soh/Enhancements/mods.cpp | 7 +- soh/soh/Enhancements/nametag.cpp | 1 + soh/soh/Enhancements/presets.h | 1 + .../randomizer/3drando/playthrough.cpp | 1 + .../randomizer/3drando/rando_main.cpp | 1 + soh/soh/Enhancements/randomizer/draw.cpp | 1 + .../Enhancements/randomizer/hook_handlers.cpp | 4 +- .../Enhancements/randomizer/randomizer.cpp | 7 +- .../randomizer/randomizer_check_objects.cpp | 1 + .../randomizer/randomizer_check_tracker.cpp | 8 +- .../randomizer/randomizer_entrance.c | 2 + .../randomizer_entrance_tracker.cpp | 1 + .../randomizer/randomizer_grotto.c | 1 + .../randomizer/randomizer_item_tracker.cpp | 10 +- soh/soh/Enhancements/randomizer/savefile.cpp | 2 +- .../resolution-editor/ResolutionEditor.cpp | 1 + soh/soh/OTRGlobals.cpp | 505 +----------------- soh/soh/OTRGlobals.h | 127 ++--- soh/soh/ResourceManagerHelpers.cpp | 505 ++++++++++++++++++ soh/soh/ResourceManagerHelpers.h | 66 +++ soh/soh/SaveManager.cpp | 1 + soh/soh/SaveManager.h | 3 +- soh/soh/SohMenuBar.cpp | 2 + soh/soh/cvar_prefixes.h | 17 + soh/soh/resource/logging/PathLogger.h | 1 + .../resource/logging/SceneCommandLoggers.h | 1 + soh/soh/z_play_otr.cpp | 3 +- soh/soh/z_scene_otr.cpp | 6 +- soh/src/code/audio_load.c | 1 + soh/src/code/audio_playback.c | 1 + soh/src/code/audio_seqplayer.c | 1 + soh/src/code/code_800EC960.c | 1 + soh/src/code/game.c | 1 + soh/src/code/gfxprint.c | 2 + soh/src/code/padmgr.c | 2 + soh/src/code/z_actor.c | 1 + soh/src/code/z_bgcheck.c | 3 +- soh/src/code/z_cheap_proc.c | 1 + soh/src/code/z_demo.c | 2 + soh/src/code/z_elf_message.c | 1 + soh/src/code/z_en_item00.c | 1 + soh/src/code/z_fbdemo_circle.c | 2 + soh/src/code/z_fcurve_data_skelanime.c | 1 + soh/src/code/z_game_over.c | 1 + soh/src/code/z_kankyo.c | 2 + soh/src/code/z_lifemeter.c | 1 + soh/src/code/z_lights.c | 1 + soh/src/code/z_map_exp.c | 1 + soh/src/code/z_map_mark.c | 2 + soh/src/code/z_parameter.c | 3 + soh/src/code/z_play.c | 2 + soh/src/code/z_player_lib.c | 1 + soh/src/code/z_rcp.c | 1 + soh/src/code/z_room.c | 2 + soh/src/code/z_scene_table.c | 2 + soh/src/code/z_skelanime.c | 2 + soh/src/code/z_skin_awb.c | 1 + soh/src/code/z_sram.c | 2 + soh/src/code/z_ss_sram.c | 1 + .../actors/ovl_Bg_Breakwall/z_bg_breakwall.c | 1 + .../ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c | 2 + .../ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c | 1 + .../ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c | 1 + .../ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c | 1 + .../actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c | 1 + .../z_bg_spot01_idosoko.c | 1 + .../ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c | 1 + .../ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c | 1 + .../actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c | 1 + .../actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c | 1 + .../actors/ovl_Bg_Treemouth/z_bg_treemouth.c | 1 + .../actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c | 1 + .../actors/ovl_Boss_Dodongo/z_boss_dodongo.c | 2 + .../actors/ovl_Boss_Ganon/z_boss_ganon.c | 1 + .../actors/ovl_Boss_Ganon2/z_boss_ganon2.c | 2 + .../ovl_Boss_Ganondrof/z_boss_ganondrof.c | 1 + .../actors/ovl_Boss_Goma/z_boss_goma.c | 1 + .../overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 1 + .../overlays/actors/ovl_Boss_Va/z_boss_va.c | 1 + .../overlays/actors/ovl_Demo_6K/z_demo_6k.c | 1 + .../actors/ovl_Demo_Effect/z_demo_effect.c | 2 + .../overlays/actors/ovl_Demo_Ik/z_demo_ik.c | 1 + .../overlays/actors/ovl_Demo_Im/z_demo_im.c | 2 + .../actors/ovl_Demo_Kankyo/z_demo_kankyo.c | 1 + .../actors/ovl_Demo_Kekkai/z_demo_kekkai.c | 1 + .../overlays/actors/ovl_Door_Ana/z_door_ana.c | 1 + .../actors/ovl_Door_Killer/z_door_killer.c | 1 + .../actors/ovl_Door_Warp1/z_door_warp1.c | 1 + soh/src/overlays/actors/ovl_En_Am/z_en_am.c | 1 + soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c | 2 + .../actors/ovl_En_Anubice/z_en_anubice.c | 1 + .../ovl_En_Attack_Niw/z_en_attack_niw.c | 1 + soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c | 1 + .../actors/ovl_En_Bigokuta/z_en_bigokuta.c | 1 + .../overlays/actors/ovl_En_Bili/z_en_bili.c | 1 + .../ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c | 2 + .../ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c | 1 + soh/src/overlays/actors/ovl_En_Box/z_en_box.c | 2 + .../overlays/actors/ovl_En_Brob/z_en_brob.c | 1 + .../overlays/actors/ovl_En_Butte/z_en_butte.c | 1 + soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c | 1 + soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c | 2 + .../overlays/actors/ovl_En_Crow/z_en_crow.c | 1 + soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c | 1 + .../overlays/actors/ovl_En_Daiku/z_en_daiku.c | 1 + .../z_en_daiku_kakariko.c | 1 + .../actors/ovl_En_Dekubaba/z_en_dekubaba.c | 1 + .../actors/ovl_En_Dekunuts/z_en_dekunuts.c | 1 + soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c | 1 + soh/src/overlays/actors/ovl_En_Dha/z_en_dha.c | 1 + .../ovl_En_Diving_Game/z_en_diving_game.c | 2 + soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c | 2 + .../actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c | 1 + .../actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c | 1 + .../actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c | 1 + .../actors/ovl_En_Dodojr/z_en_dodojr.c | 1 + .../actors/ovl_En_Dodongo/z_en_dodongo.c | 1 + soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c | 1 + .../overlays/actors/ovl_En_Door/z_en_door.c | 1 + soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c | 3 + soh/src/overlays/actors/ovl_En_Du/z_en_du.c | 1 + .../actors/ovl_En_Dy_Extra/z_en_dy_extra.c | 1 + .../overlays/actors/ovl_En_Eiyer/z_en_eiyer.c | 1 + soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c | 1 + .../actors/ovl_En_Ex_Item/z_en_ex_item.c | 1 + soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c | 1 + .../actors/ovl_En_Firefly/z_en_firefly.c | 1 + .../overlays/actors/ovl_En_Fish/z_en_fish.c | 1 + .../actors/ovl_En_Floormas/z_en_floormas.c | 1 + soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c | 2 + soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c | 2 + soh/src/overlays/actors/ovl_En_Fw/z_en_fw.c | 1 + .../ovl_En_Ganon_Mant/z_en_ganon_mant.c | 2 + soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c | 2 + soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 2 + soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c | 2 + soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c | 2 + .../overlays/actors/ovl_En_GeldB/z_en_geldb.c | 1 + soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c | 2 + soh/src/overlays/actors/ovl_En_Go/z_en_go.c | 2 + soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c | 3 + .../overlays/actors/ovl_En_Goma/z_en_goma.c | 1 + .../overlays/actors/ovl_En_Guest/z_en_guest.c | 1 + .../actors/ovl_En_Heishi1/z_en_heishi1.c | 1 + .../actors/ovl_En_Heishi2/z_en_heishi2.c | 1 + .../actors/ovl_En_Heishi3/z_en_heishi3.c | 1 + .../actors/ovl_En_Heishi4/z_en_heishi4.c | 2 + .../actors/ovl_En_Hintnuts/z_en_hintnuts.c | 1 + soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c | 3 + soh/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c | 1 + soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c | 2 + soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c | 1 + soh/src/overlays/actors/ovl_En_In/z_en_in.c | 3 +- .../actors/ovl_En_Insect/z_en_insect.c | 1 + .../overlays/actors/ovl_En_Ishi/z_en_ishi.c | 1 + soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c | 1 + soh/src/overlays/actors/ovl_En_Js/z_en_js.c | 2 + .../actors/ovl_En_Jsjutan/z_en_jsjutan.c | 1 + .../actors/ovl_En_Kakasi2/z_en_kakasi2.c | 1 + .../actors/ovl_En_Karebaba/z_en_karebaba.c | 1 + soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c | 3 + soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c | 3 + soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c | 1 + soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c | 1 + soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c | 1 + soh/src/overlays/actors/ovl_En_Md/z_en_md.c | 1 + soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c | 3 + soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c | 1 + soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c | 1 + soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c | 2 + soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c | 1 + soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c | 1 + .../actors/ovl_En_Niw_Girl/z_en_niw_girl.c | 1 + .../actors/ovl_En_Niw_Lady/z_en_niw_lady.c | 3 + .../ovl_En_Okarina_Tag/z_en_okarina_tag.c | 1 + .../overlays/actors/ovl_En_Okuta/z_en_okuta.c | 1 + .../overlays/actors/ovl_En_Ossan/z_en_ossan.c | 1 + soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c | 2 + .../actors/ovl_En_Partner/z_en_partner.c | 2 + .../actors/ovl_En_Peehat/z_en_peehat.c | 1 + .../actors/ovl_En_Po_Desert/z_en_po_desert.c | 1 + .../actors/ovl_En_Po_Field/z_en_po_field.c | 1 + .../actors/ovl_En_Po_Relay/z_en_po_relay.c | 1 + .../ovl_En_Po_Sisters/z_en_po_sisters.c | 2 + soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c | 1 + soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c | 1 + .../overlays/actors/ovl_En_Reeba/z_en_reeba.c | 1 + soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 1 + soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c | 1 + soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c | 2 + .../actors/ovl_En_Shopnuts/z_en_shopnuts.c | 2 + soh/src/overlays/actors/ovl_En_Si/z_en_si.c | 1 + soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c | 1 + soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c | 2 + soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c | 2 + soh/src/overlays/actors/ovl_En_St/z_en_st.c | 1 + soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c | 2 + soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c | 1 + .../ovl_En_Syateki_Man/z_en_syateki_man.c | 2 + .../ovl_En_Syateki_Niw/z_en_syateki_niw.c | 1 + soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c | 2 + .../ovl_En_Takara_Man/z_en_takara_man.c | 2 + .../overlays/actors/ovl_En_Test/z_en_test.c | 1 + .../overlays/actors/ovl_En_Tite/z_en_tite.c | 1 + soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c | 1 + .../overlays/actors/ovl_En_Toryo/z_en_toryo.c | 3 + soh/src/overlays/actors/ovl_En_Tr/z_en_tr.c | 1 + .../overlays/actors/ovl_En_Vali/z_en_vali.c | 1 + soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c | 1 + .../actors/ovl_En_Wallmas/z_en_wallmas.c | 1 + .../actors/ovl_En_Weiyer/z_en_weiyer.c | 1 + soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c | 1 + soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c | 2 + soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c | 1 + soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c | 1 + soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c | 2 + soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c | 1 + .../overlays/actors/ovl_Fishing/z_fishing.c | 1 + .../actors/ovl_Item_B_Heart/z_item_b_heart.c | 1 + .../ovl_Item_Etcetera/z_item_etcetera.c | 1 + .../actors/ovl_Item_Ocarina/z_item_ocarina.c | 1 + .../actors/ovl_Magic_Fire/z_magic_fire.c | 1 + .../actors/ovl_Magic_Wind/z_magic_wind.c | 1 + .../ovl_Obj_Lightswitch/z_obj_lightswitch.c | 1 + .../actors/ovl_Obj_Mure2/z_obj_mure2.c | 1 + .../actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c | 1 + .../actors/ovl_Oceff_Storm/z_oceff_storm.c | 2 + .../actors/ovl_Oceff_Wipe/z_oceff_wipe.c | 1 + .../actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c | 1 + .../actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c | 1 + .../actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c | 1 + .../actors/ovl_player_actor/z_player.c | 3 +- .../ovl_file_choose/z_file_choose.c | 3 + .../ovl_file_choose/z_file_copy_erase.c | 1 + .../ovl_file_choose/z_file_nameset_PAL.c | 3 + .../overlays/gamestates/ovl_select/z_select.c | 2 + .../overlays/gamestates/ovl_title/z_title.c | 1 + .../misc/ovl_kaleido_scope/z_kaleido_item.c | 1 + .../ovl_kaleido_scope/z_kaleido_scope_PAL.c | 3 + .../misc/ovl_kaleido_scope/z_lmap_mark.c | 1 + 258 files changed, 989 insertions(+), 639 deletions(-) create mode 100644 soh/soh/ResourceManagerHelpers.cpp create mode 100644 soh/soh/ResourceManagerHelpers.h create mode 100644 soh/soh/cvar_prefixes.h diff --git a/soh/include/global.h b/soh/include/global.h index 43f56ed0e99..b453439fd3f 100644 --- a/soh/include/global.h +++ b/soh/include/global.h @@ -8,7 +8,7 @@ #include "functions.h" #include "variables.h" #include "macros.h" -#include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" #include "soh/Enhancements/gameconsole.h" #include "soh/Enhancements/gameplaystats.h" #include diff --git a/soh/soh/Enhancements/audio/AudioCollection.cpp b/soh/soh/Enhancements/audio/AudioCollection.cpp index dadcbf2aca3..5b0165637dd 100644 --- a/soh/soh/Enhancements/audio/AudioCollection.cpp +++ b/soh/soh/Enhancements/audio/AudioCollection.cpp @@ -1,6 +1,7 @@ #include "AudioCollection.h" #include "sequence.h" #include "sfx.h" +#include "soh/cvar_prefixes.h" #include #include #include diff --git a/soh/soh/Enhancements/audio/AudioEditor.cpp b/soh/soh/Enhancements/audio/AudioEditor.cpp index a9fefbe7197..954baa6813e 100644 --- a/soh/soh/Enhancements/audio/AudioEditor.cpp +++ b/soh/soh/Enhancements/audio/AudioEditor.cpp @@ -8,9 +8,10 @@ #include #include #include "../randomizer/3drando/random.hpp" -#include "../../OTRGlobals.h" +#include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" #include -#include "../../UIWidgets.hpp" +#include "soh/UIWidgets.hpp" #include "AudioCollection.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" diff --git a/soh/soh/Enhancements/bootcommands.c b/soh/soh/Enhancements/bootcommands.c index 16ad651fcf2..c010067da07 100644 --- a/soh/soh/Enhancements/bootcommands.c +++ b/soh/soh/Enhancements/bootcommands.c @@ -10,6 +10,7 @@ #include #include #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" uint8_t gLoadFileSelect = 0, gSkipLogoTest = 0; diff --git a/soh/soh/Enhancements/controls/InputViewer.cpp b/soh/soh/Enhancements/controls/InputViewer.cpp index 75a1ea5e7d5..6abaed44615 100644 --- a/soh/soh/Enhancements/controls/InputViewer.cpp +++ b/soh/soh/Enhancements/controls/InputViewer.cpp @@ -4,6 +4,7 @@ #include "libultraship/libultra/controller.h" #include "Context.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" #ifndef IMGUI_DEFINE_MATH_OPERATORS #define IMGUI_DEFINE_MATH_OPERATORS #endif diff --git a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp index 4aa163d0d03..14c89142410 100644 --- a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp +++ b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp @@ -3,6 +3,7 @@ #include "soh/OTRGlobals.h" #include "../../UIWidgets.hpp" #include "z64.h" +#include "soh/cvar_prefixes.h" #ifndef __WIIU__ #include "controller/controldevice/controller/mapping/sdl/SDLAxisDirectionToButtonMapping.h" #endif diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp index 9ee220dbbe6..be06e0d945f 100644 --- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp @@ -14,10 +14,12 @@ #include "soh/UIWidgets.hpp" #include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" extern "C" { #include #include "macros.h" +#include "soh/cvar_prefixes.h" extern PlayState* gPlayState; #include "objects/object_link_boy/object_link_boy.h" #include "objects/object_link_child/object_link_child.h" @@ -48,9 +50,6 @@ extern PlayState* gPlayState; #include "objects/object_gjyo_objects/object_gjyo_objects.h" #include "textures/nintendo_rogo_static/nintendo_rogo_static.h" #include "objects/object_gi_rabit_mask/object_gi_rabit_mask.h" -void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction); -void ResourceMgr_PatchGfxCopyCommandByName(const char* path, const char* patchName, int destinationIndex, int sourceIndex); -void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName); u8 Randomizer_GetSettingValue(RandomizerSettingKey randoSettingKey); } diff --git a/soh/soh/Enhancements/cosmetics/authenticGfxPatches.cpp b/soh/soh/Enhancements/cosmetics/authenticGfxPatches.cpp index 6b74769c120..75f6bd35d3b 100644 --- a/soh/soh/Enhancements/cosmetics/authenticGfxPatches.cpp +++ b/soh/soh/Enhancements/cosmetics/authenticGfxPatches.cpp @@ -1,6 +1,8 @@ #include #include #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" +#include "soh/ResourceManagerHelpers.h" extern "C" { #include @@ -9,11 +11,6 @@ extern "C" { #include "objects/object_gi_soldout/object_gi_soldout.h" #include "objects/object_ik/object_ik.h" #include "objects/object_link_child/object_link_child.h" - -uint32_t ResourceMgr_GameHasMasterQuest(); -uint32_t ResourceMgr_GameHasOriginal(); -void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction); -void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName); } typedef struct { diff --git a/soh/soh/Enhancements/debugconsole.cpp b/soh/soh/Enhancements/debugconsole.cpp index 9a4bd0449f6..4f65ef9a5e0 100644 --- a/soh/soh/Enhancements/debugconsole.cpp +++ b/soh/soh/Enhancements/debugconsole.cpp @@ -6,6 +6,7 @@ #include #include #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" #include #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/cosmetics/CosmeticsEditor.h" diff --git a/soh/soh/Enhancements/debugger/MessageViewer.cpp b/soh/soh/Enhancements/debugger/MessageViewer.cpp index 5b23c1876e5..7ae34b4a862 100644 --- a/soh/soh/Enhancements/debugger/MessageViewer.cpp +++ b/soh/soh/Enhancements/debugger/MessageViewer.cpp @@ -6,6 +6,7 @@ #include "../custom-message/CustomMessageManager.h" #include "functions.h" #include "macros.h" +#include "soh/cvar_prefixes.h" #include "message_data_static.h" #include "variables.h" #include "soh/util.h" diff --git a/soh/soh/Enhancements/debugger/actorViewer.cpp b/soh/soh/Enhancements/debugger/actorViewer.cpp index 9992f1ecd21..c6ac49a74f5 100644 --- a/soh/soh/Enhancements/debugger/actorViewer.cpp +++ b/soh/soh/Enhancements/debugger/actorViewer.cpp @@ -13,6 +13,7 @@ #include #include #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" extern "C" { #include diff --git a/soh/soh/Enhancements/debugger/colViewer.cpp b/soh/soh/Enhancements/debugger/colViewer.cpp index 5139576ce73..57df9a4a2f1 100644 --- a/soh/soh/Enhancements/debugger/colViewer.cpp +++ b/soh/soh/Enhancements/debugger/colViewer.cpp @@ -15,6 +15,7 @@ extern "C" { #include "variables.h" #include "functions.h" #include "macros.h" +#include "soh/cvar_prefixes.h" extern PlayState* gPlayState; } diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index 2a1cf9f49c1..807c269d3f3 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -18,6 +18,7 @@ extern "C" { #include "variables.h" #include "functions.h" #include "macros.h" +#include "soh/cvar_prefixes.h" #include "soh/Enhancements/randomizer/adult_trade_shuffle.h" extern PlayState* gPlayState; diff --git a/soh/soh/Enhancements/debugger/valueViewer.cpp b/soh/soh/Enhancements/debugger/valueViewer.cpp index c03be8ee1c7..a58512ea34c 100644 --- a/soh/soh/Enhancements/debugger/valueViewer.cpp +++ b/soh/soh/Enhancements/debugger/valueViewer.cpp @@ -7,6 +7,7 @@ extern "C" { #include "variables.h" #include "functions.h" #include "macros.h" +#include "soh/cvar_prefixes.h" extern PlayState* gPlayState; void GfxPrint_SetColor(GfxPrint* printer, u32 r, u32 g, u32 b, u32 a); void GfxPrint_SetPos(GfxPrint* printer, s32 x, s32 y); diff --git a/soh/soh/Enhancements/enemyrandomizer.cpp b/soh/soh/Enhancements/enemyrandomizer.cpp index e0f82062c51..89aab7e000a 100644 --- a/soh/soh/Enhancements/enemyrandomizer.cpp +++ b/soh/soh/Enhancements/enemyrandomizer.cpp @@ -6,13 +6,13 @@ #include "soh/Enhancements/enhancementTypes.h" #include "variables.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" +#include "soh/ResourceManagerHelpers.h" extern "C" { #include } -extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum); - const char* enemyCVarList[] = { CVAR_ENHANCEMENT("RandomizedEnemyList.Armos"), CVAR_ENHANCEMENT("RandomizedEnemyList.Arwing"), CVAR_ENHANCEMENT("RandomizedEnemyList.BabyDodongo"), CVAR_ENHANCEMENT("RandomizedEnemyList.Bari"), diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp index 9f7a73ad3ed..24e38d9b4ae 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp @@ -8,6 +8,7 @@ extern "C" { #include "variables.h" #include "macros.h" +#include "soh/cvar_prefixes.h" #include "functions.h" extern PlayState* gPlayState; } diff --git a/soh/soh/Enhancements/gameplaystats.cpp b/soh/soh/Enhancements/gameplaystats.cpp index 82a4b3b6e17..3f769174100 100644 --- a/soh/soh/Enhancements/gameplaystats.cpp +++ b/soh/soh/Enhancements/gameplaystats.cpp @@ -1,11 +1,10 @@ -extern "C" { #include "gameplaystats.h" -} #include "gameplaystatswindow.h" #include "soh/SaveManager.h" #include "functions.h" #include "macros.h" +#include "soh/cvar_prefixes.h" #include "../UIWidgets.hpp" #include "soh/util.h" diff --git a/soh/soh/Enhancements/gameplaystats.h b/soh/soh/Enhancements/gameplaystats.h index 528da33f93f..9d41f2560c8 100644 --- a/soh/soh/Enhancements/gameplaystats.h +++ b/soh/soh/Enhancements/gameplaystats.h @@ -1,5 +1,17 @@ #pragma once +#include "soh/cvar_prefixes.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + uint64_t GetUnixTimestamp(void); + char* GameplayStats_GetCurrentTime(); +#ifdef __cplusplus +}; +#endif + // When using RTA timing // get the diff since the save was created, // unless the game is complete in which we use the defeated ganon timestamp @@ -17,7 +29,6 @@ gSaveContext.sohStats.sceneTimer) void InitStatTracker(); -char* GameplayStats_GetCurrentTime(); typedef enum { // 0x00 to 0x9B (0 to 155) used for getting items, diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index 0dacbef423e..8c18daa00f6 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -3,6 +3,9 @@ #include "game-interactor/GameInteractor.h" #include "tts/tts.h" #include "soh/OTRGlobals.h" +#include "soh/SaveManager.h" +#include "soh/ResourceManagerHelpers.h" +#include "soh/Enhancements/boss-rush/BossRushTypes.h" #include "soh/Enhancements/boss-rush/BossRush.h" #include "soh/Enhancements/enhancementTypes.h" #include "soh/Enhancements/randomizer/3drando/random.hpp" @@ -41,17 +44,15 @@ extern "C" { #include #include "align_asset_macro.h" #include "macros.h" +#include "soh/cvar_prefixes.h" #include "functions.h" #include "variables.h" #include "functions.h" #include "src/overlays/actors/ovl_En_Door/z_en_door.h" -void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction); -void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName); extern SaveContext gSaveContext; extern PlayState* gPlayState; extern void Overlay_DisplayText(float duration, const char* text); -uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum); } // GreyScaleEndDlist diff --git a/soh/soh/Enhancements/nametag.cpp b/soh/soh/Enhancements/nametag.cpp index fa88c9aeb57..c2d72eae097 100644 --- a/soh/soh/Enhancements/nametag.cpp +++ b/soh/soh/Enhancements/nametag.cpp @@ -10,6 +10,7 @@ extern "C" { #include "z64.h" #include "macros.h" +#include "soh/cvar_prefixes.h" #include "functions.h" #include "variables.h" #include "textures/message_static/message_static.h" diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h index 6543e1a7cf5..96b39ba303f 100644 --- a/soh/soh/Enhancements/presets.h +++ b/soh/soh/Enhancements/presets.h @@ -8,6 +8,7 @@ #include "soh/Enhancements/randomizer/randomizerTypes.h" #include "soh/Enhancements/enhancementTypes.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" enum PresetEntryType { PRESET_ENTRY_TYPE_S32, diff --git a/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp b/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp index 0d4f39c5c3a..e789b16cfa0 100644 --- a/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp @@ -10,6 +10,7 @@ #include "soh/Enhancements/randomizer/randomizerTypes.h" #include "variables.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" #include "../option.h" #include "soh/Enhancements/debugger/performanceTimer.h" diff --git a/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp b/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp index d4d7ebdd7e5..0558b26e1d7 100644 --- a/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp @@ -9,6 +9,7 @@ #include #include #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" void RandoMain::GenerateRando(std::set excludedLocations, std::set enabledTricks, std::string seedString) { diff --git a/soh/soh/Enhancements/randomizer/draw.cpp b/soh/soh/Enhancements/randomizer/draw.cpp index e643acd7072..f4eef9b9bb5 100644 --- a/soh/soh/Enhancements/randomizer/draw.cpp +++ b/soh/soh/Enhancements/randomizer/draw.cpp @@ -5,6 +5,7 @@ #include "functions.h" #include "variables.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" #include "randomizerTypes.h" #include #include "objects/object_gi_key/object_gi_key.h" diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 27813cffe19..c4e0639c922 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -1,5 +1,6 @@ #include #include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/enhancementTypes.h" #include "soh/Enhancements/custom-message/CustomMessageTypes.h" #include "soh/Enhancements/item-tables/ItemTableManager.h" @@ -10,6 +11,7 @@ #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/ImGuiUtils.h" #include "soh/Notification/Notification.h" +#include "soh/SaveManager.h" extern "C" { #include "macros.h" @@ -1834,7 +1836,7 @@ void RandomizerOnActorInitHandler(void* actorRef) { if ( actor->id == ACTOR_OBJ_OSHIHIKI && LINK_IS_CHILD && - IsGameMasterQuest() && + ResourceMgr_IsGameMasterQuest() && gPlayState->sceneNum == SCENE_SPIRIT_TEMPLE && actor->room == 6 && // Spirit Temple silver block hallway actor->params == 0x9C7 // Silver block that is marked as in the hole ) { diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index aefc7d4fdcb..eb748dae9ab 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -10,7 +10,9 @@ #include #include "3drando/rando_main.hpp" #include "3drando/random.hpp" -#include "3drando/custom_messages.hpp" +#include "soh/ResourceManagerHelpers.h" +#include "soh/UIWidgets.hpp" +#include "3drando/custom_messages.hpp" #include "../../UIWidgets.hpp" #ifndef IMGUI_DEFINE_MATH_OPERATORS #define IMGUI_DEFINE_MATH_OPERATORS @@ -41,9 +43,6 @@ #include "fishsanity.h" #include "randomizerTypes.h" -extern "C" uint32_t ResourceMgr_IsGameMasterQuest(); -extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum); - extern std::map rcAreaNames; using json = nlohmann::json; diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp index 4e50eddddc3..5d3a62b86aa 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp @@ -6,6 +6,7 @@ #include #include "z64.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" #include "fishsanity.h" std::map rcAreaNames = { diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp index 0d5e6d2ed36..4cd6fc844b4 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp @@ -2,9 +2,12 @@ #include "randomizer_entrance_tracker.h" #include "randomizer_item_tracker.h" #include "randomizerTypes.h" +#include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" +#include "soh/SaveManager.h" +#include "soh/ResourceManagerHelpers.h" +#include "soh/UIWidgets.hpp" #include "dungeon.h" -#include "../../OTRGlobals.h" -#include "../../UIWidgets.hpp" #include "3drando/location_access.hpp" #include @@ -24,7 +27,6 @@ extern "C" { #include "macros.h" extern PlayState* gPlayState; } -extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum); extern "C" GetItemEntry ItemTable_RetrieveEntry(s16 modIndex, s16 getItemID); extern std::vector dungeonRewardStones; diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance.c b/soh/soh/Enhancements/randomizer/randomizer_entrance.c index 5c0f8971f80..aa839cc3e8e 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance.c +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance.c @@ -9,6 +9,8 @@ #include "randomizer_entrance.h" #include "randomizer_grotto.h" +#include "soh/OTRGlobals.h" +#include "soh/SaveManager.h" #include #include "global.h" diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp index 2fce8ae797a..3db2cd1ec36 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp @@ -1,5 +1,6 @@ #include "randomizer_entrance_tracker.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" #include "soh/UIWidgets.hpp" #include diff --git a/soh/soh/Enhancements/randomizer/randomizer_grotto.c b/soh/soh/Enhancements/randomizer/randomizer_grotto.c index cb8eacb1aa1..180f4ca84da 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_grotto.c +++ b/soh/soh/Enhancements/randomizer/randomizer_grotto.c @@ -4,6 +4,7 @@ */ #include "randomizer_grotto.h" +#include "soh/OTRGlobals.h" #include "global.h" diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index 3be937cc9bd..3657cd2f156 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -1,7 +1,10 @@ #include "randomizer_item_tracker.h" -#include "../../util.h" -#include "../../OTRGlobals.h" -#include "../../UIWidgets.hpp" +#include "soh/util.h" +#include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" +#include "soh/SaveManager.h" +#include "soh/ResourceManagerHelpers.h" +#include "soh/UIWidgets.hpp" #include "randomizerTypes.h" #include @@ -22,7 +25,6 @@ extern PlayState* gPlayState; #include "textures/icon_item_static/icon_item_static.h" #include "textures/icon_item_24_static/icon_item_24_static.h" } -extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum); void DrawEquip(ItemTrackerItem item); void DrawItem(ItemTrackerItem item); diff --git a/soh/soh/Enhancements/randomizer/savefile.cpp b/soh/soh/Enhancements/randomizer/savefile.cpp index 2fc16dc82a1..dd6c2725750 100644 --- a/soh/soh/Enhancements/randomizer/savefile.cpp +++ b/soh/soh/Enhancements/randomizer/savefile.cpp @@ -1,5 +1,6 @@ #include "savefile.h" #include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" extern "C" { @@ -8,7 +9,6 @@ extern "C" { #include "functions.h" #include "macros.h" -uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum); uint8_t Randomizer_GetSettingValue(RandomizerSettingKey randoSettingKey); GetItemEntry Randomizer_GetItemFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId); } diff --git a/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp b/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp index 21d99194ef7..c15f0436496 100644 --- a/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp +++ b/soh/soh/Enhancements/resolution-editor/ResolutionEditor.cpp @@ -5,6 +5,7 @@ #include #include #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" /* Console Variables are grouped under gAdvancedResolution. (e.g. CVAR_PREFIX_ADVANCED_RESOLUTION ".Enabled") diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index c89228667dc..7f300476f83 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -6,17 +6,14 @@ #include #include -#include +#include "ResourceManagerHelpers.h" #include "graphic/Fast3D/Fast3dWindow.h" #include #include #include #include -#include "z64animation.h" -#include "z64bgcheck.h" #include "Enhancements/gameconsole.h" -#include #ifdef _WIN32 #include #else @@ -27,7 +24,6 @@ #include "Enhancements/controls/SohInputEditorWindow.h" #include "Enhancements/cosmetics/CosmeticsEditor.h" #include "Enhancements/audio/AudioCollection.h" -#include "Enhancements/audio/AudioEditor.h" #include "Enhancements/enhancementTypes.h" #include "Enhancements/debugconsole.h" #include "Enhancements/randomizer/randomizer.h" @@ -56,7 +52,6 @@ #endif #include -#include #ifdef __APPLE__ #include @@ -77,6 +72,7 @@ #include "Enhancements/item-tables/ItemTableManager.h" #include "SohGui.hpp" #include "ActorDB.h" +#include "SaveManager.h" #ifdef ENABLE_REMOTE_CONTROL #include "soh/Network/CrowdControl/CrowdControl.h" @@ -506,18 +502,11 @@ uint32_t OTRGlobals::GetInterpolationFPS() { return std::min(Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), CVarGetInteger(CVAR_SETTING("InterpolationFPS"), 20)); } -struct ExtensionEntry { - std::string path; - std::string ext; -}; - extern "C" void OTRMessage_Init(); extern "C" void AudioMgr_CreateNextAudioBuffer(s16* samples, u32 num_samples); extern "C" void AudioPlayer_Play(const uint8_t* buf, uint32_t len); extern "C" int AudioPlayer_Buffered(void); extern "C" int AudioPlayer_GetDesiredBuffered(void); -extern "C" void ResourceMgr_LoadDirectory(const char* resName); -extern "C" SequenceData ResourceMgr_LoadSeqByName(const char* path); std::unordered_map ExtensionCache; void OTRAudio_Thread() { @@ -1478,269 +1467,7 @@ extern "C" uint16_t OTRGetPixelDepth(float x, float y) { return wnd->GetPixelDepth(x, y); } -extern "C" uint32_t ResourceMgr_GetNumGameVersions() { - return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions().size(); -} - -extern "C" uint32_t ResourceMgr_GetGameVersion(int index) { - return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; -} - -extern "C" uint32_t ResourceMgr_GetGamePlatform(int index) { - uint32_t version = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; - - switch (version) { - case OOT_NTSC_US_10: - case OOT_NTSC_US_11: - case OOT_NTSC_US_12: - case OOT_PAL_10: - case OOT_PAL_11: - return GAME_PLATFORM_N64; - case OOT_NTSC_JP_GC: - case OOT_NTSC_US_GC: - case OOT_PAL_GC: - case OOT_NTSC_JP_MQ: - case OOT_NTSC_US_MQ: - case OOT_PAL_MQ: - case OOT_PAL_GC_DBG1: - case OOT_PAL_GC_DBG2: - case OOT_PAL_GC_MQ_DBG: - return GAME_PLATFORM_GC; - } -} - -extern "C" uint32_t ResourceMgr_GetGameRegion(int index) { - uint32_t version = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; - - switch (version) { - case OOT_NTSC_US_10: - case OOT_NTSC_US_11: - case OOT_NTSC_US_12: - case OOT_NTSC_JP_GC: - case OOT_NTSC_US_GC: - case OOT_NTSC_JP_MQ: - case OOT_NTSC_US_MQ: - return GAME_REGION_NTSC; - case OOT_PAL_10: - case OOT_PAL_11: - case OOT_PAL_GC: - case OOT_PAL_MQ: - case OOT_PAL_GC_DBG1: - case OOT_PAL_GC_DBG2: - case OOT_PAL_GC_MQ_DBG: - return GAME_REGION_PAL; - } -} - -uint32_t IsSceneMasterQuest(s16 sceneNum) { - uint32_t value = 0; - uint8_t mqMode = CVarGetInteger(CVAR_GENERAL("BetterDebugWarpScreenMQMode"), WARP_MODE_OVERRIDE_OFF); - if (mqMode == WARP_MODE_OVERRIDE_MQ_AS_VANILLA) { - return 1; - } else if (mqMode == WARP_MODE_OVERRIDE_VANILLA_AS_MQ) { - return 0; - } else { - if (OTRGlobals::Instance->HasMasterQuest()) { - if (!OTRGlobals::Instance->HasOriginal()) { - value = 1; - } else if (IS_MASTER_QUEST) { - value = 1; - } else { - value = 0; - if (IS_RANDO) { - auto dungeon = OTRGlobals::Instance->gRandoContext->GetDungeons()->GetDungeonFromScene(sceneNum); - if (dungeon != nullptr && dungeon->IsMQ()) { - value = 1; - } - } - } - } - } - return value; -} - -uint32_t IsGameMasterQuest() { - return gPlayState != NULL ? IsSceneMasterQuest(gPlayState->sceneNum) : 0; -} - -extern "C" uint32_t ResourceMgr_GameHasMasterQuest() { - return OTRGlobals::Instance->HasMasterQuest(); -} - -extern "C" uint32_t ResourceMgr_GameHasOriginal() { - return OTRGlobals::Instance->HasOriginal(); -} - -extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum) { - return IsSceneMasterQuest(sceneNum); -} - -extern "C" uint32_t ResourceMgr_IsGameMasterQuest() { - return IsGameMasterQuest(); -} - -extern "C" void ResourceMgr_LoadDirectory(const char* resName) { - Ship::Context::GetInstance()->GetResourceManager()->LoadDirectory(resName); -} -extern "C" void ResourceMgr_DirtyDirectory(const char* resName) { - Ship::Context::GetInstance()->GetResourceManager()->DirtyDirectory(resName); -} - -extern "C" void ResourceMgr_UnloadResource(const char* resName) { - std::string path = resName; - if (path.substr(0, 7) == "__OTR__") { - path = path.substr(7); - } - auto res = Ship::Context::GetInstance()->GetResourceManager()->UnloadResource(path); -} - -// OTRTODO: There is probably a more elegant way to go about this... -// Kenix: This is definitely leaking memory when it's called. -extern "C" char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize) { - auto lst = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles(searchMask); - char** result = (char**)malloc(lst->size() * sizeof(char*)); - - for (size_t i = 0; i < lst->size(); i++) { - char* str = (char*)malloc(lst.get()[0][i].size() + 1); - memcpy(str, lst.get()[0][i].data(), lst.get()[0][i].size()); - str[lst.get()[0][i].size()] = '\0'; - result[i] = str; - } - *resultSize = lst->size(); - - return result; -} - -extern "C" uint8_t ResourceMgr_FileExists(const char* filePath) { - std::string path = filePath; - if(path.substr(0, 7) == "__OTR__"){ - path = path.substr(7); - } - - return ExtensionCache.contains(path); -} - -extern "C" uint8_t ResourceMgr_FileAltExists(const char* filePath) { - std::string path = filePath; - if (path.substr(0, 7) == "__OTR__") { - path = path.substr(7); - } - - if (path.substr(0, 4) != "alt/") { - path = "alt/" + path; - } - - return ExtensionCache.contains(path); -} - -extern "C" bool ResourceMgr_IsAltAssetsEnabled() { - return Ship::Context::GetInstance()->GetResourceManager()->IsAltAssetsEnabled(); -} - -// Unloads a resource if an alternate version exists when alt assets are enabled -// The resource is only removed from the internal cache to prevent it from used in the next resource lookup -extern "C" void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName) { - if (ResourceMgr_IsAltAssetsEnabled() && ResourceMgr_FileAltExists((char*)resName)) { - ResourceMgr_UnloadResource((char*) resName); - } -} - -std::shared_ptr GetResourceByNameHandlingMQ(const char* path) { - std::string Path = path; - if (ResourceMgr_IsGameMasterQuest()) { - size_t pos = 0; - if ((pos = Path.find("/nonmq/", 0)) != std::string::npos) { - Path.replace(pos, 7, "/mq/"); - } - } - return Ship::Context::GetInstance()->GetResourceManager()->LoadResource(Path.c_str()); -} - -extern "C" char* GetResourceDataByNameHandlingMQ(const char* path) { - auto res = GetResourceByNameHandlingMQ(path); - - if (res == nullptr) { - return nullptr; - } - - return (char*)res->GetRawPointer(); -} - -extern "C" uint8_t ResourceMgr_TexIsRaw(const char* texPath) { - auto res = std::static_pointer_cast(GetResourceByNameHandlingMQ(texPath)); - return res->Flags & TEX_FLAG_LOAD_AS_RAW; -} - -extern "C" uint8_t ResourceMgr_ResourceIsBackground(char* texPath) { - auto res = GetResourceByNameHandlingMQ(texPath); - return res->GetInitData()->Type == static_cast(SOH::ResourceType::SOH_Background); -} - -extern "C" char* ResourceMgr_LoadJPEG(char* data, size_t dataSize) -{ - static char* finalBuffer = 0; - - if (finalBuffer == 0) - finalBuffer = (char*)malloc(dataSize); - - int w; - int h; - int comp; - - unsigned char* pixels = stbi_load_from_memory((const unsigned char*)data, 320 * 240 * 2, &w, &h, &comp, STBI_rgb_alpha); - //unsigned char* pixels = stbi_load_from_memory((const unsigned char*)data, 480 * 240 * 2, &w, &h, &comp, STBI_rgb_alpha); - int idx = 0; - - for (int y = 0; y < h; y++) - { - for (int x = 0; x < w; x++) - { - uint16_t* bufferTest = (uint16_t*)finalBuffer; - int pixelIdx = ((y * w) + x) * 4; - - uint8_t r = pixels[pixelIdx + 0] / 8; - uint8_t g = pixels[pixelIdx + 1] / 8; - uint8_t b = pixels[pixelIdx + 2] / 8; - - uint8_t alphaBit = pixels[pixelIdx + 3] != 0; - - uint16_t data = (r << 11) + (g << 6) + (b << 1) + alphaBit; - - finalBuffer[idx++] = (data & 0xFF00) >> 8; - finalBuffer[idx++] = (data & 0x00FF); - } - } - - return (char*)finalBuffer; -} - -extern "C" uint16_t ResourceMgr_LoadTexWidthByName(char* texPath); - -extern "C" uint16_t ResourceMgr_LoadTexHeightByName(char* texPath); - -extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) { - auto res = GetResourceByNameHandlingMQ(filePath); - - if (res->GetInitData()->Type == static_cast(LUS::ResourceType::DisplayList)) - return (char*)&((std::static_pointer_cast(res))->Instructions[0]); - else if (res->GetInitData()->Type == static_cast(SOH::ResourceType::SOH_Array)) - return (char*)(std::static_pointer_cast(res))->Vertices.data(); - else { - return (char*)GetResourceDataByNameHandlingMQ(filePath); - } -} - -extern "C" char* ResourceMgr_LoadIfDListByName(const char* filePath) { - auto res = GetResourceByNameHandlingMQ(filePath); - - if (res->GetInitData()->Type == static_cast(LUS::ResourceType::DisplayList)) - return (char*)&((std::static_pointer_cast(res))->Instructions[0]); - - return nullptr; -} - extern "C" Sprite* GetSeedTexture(uint8_t index) { - return OTRGlobals::Instance->gRandoContext->GetSeedTexture(index); } @@ -1748,157 +1475,6 @@ extern "C" uint8_t GetSeedIconIndex(uint8_t index) { return OTRGlobals::Instance->gRandoContext->hashIconIndexes[index]; } -extern "C" char* ResourceMgr_LoadPlayerAnimByName(const char* animPath) { - auto anim = std::static_pointer_cast(GetResourceByNameHandlingMQ(animPath)); - - return (char*)&anim->limbRotData[0]; -} - -extern "C" void ResourceMgr_PushCurrentDirectory(char* path) -{ - gfx_push_current_dir(path); -} - -extern "C" Gfx* ResourceMgr_LoadGfxByName(const char* path) -{ - // When an alt resource exists for the DL, we need to unload the original asset - // to clear the cache so the alt asset will be loaded instead - // OTRTODO: If Alt loading over original cache is fixed, this line can most likely be removed - ResourceMgr_UnloadOriginalWhenAltExists(path); - - auto res = std::static_pointer_cast(GetResourceByNameHandlingMQ(path)); - return (Gfx*)&res->Instructions[0]; -} - -extern "C" uint8_t ResourceMgr_FileIsCustomByName(const char* path) { - auto res = std::static_pointer_cast(GetResourceByNameHandlingMQ(path)); - return res->GetInitData()->IsCustom; -} - -typedef struct { - int index; - Gfx instruction; -} GfxPatch; - -std::unordered_map> originalGfx; - -// Attention! This is primarily for cosmetics & bug fixes. For things like mods and model replacement you should be using OTRs -// instead (When that is available). Index can be found using the commented out section below. -extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction) { - auto res = std::static_pointer_cast( - Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); - - // Leaving this here for people attempting to find the correct Dlist index to patch - /*if (strcmp("__OTR__objects/object_gi_longsword/gGiBiggoronSwordDL", path) == 0) { - for (int i = 0; i < res->instructions.size(); i++) { - Gfx* gfx = (Gfx*)&res->instructions[i]; - // Log all commands - // SPDLOG_INFO("index:{} command:{}", i, gfx->words.w0 >> 24); - // Log only SetPrimColors - if (gfx->words.w0 >> 24 == 250) { - SPDLOG_INFO("index:{} r:{} g:{} b:{} a:{}", i, _SHIFTR(gfx->words.w1, 24, 8), _SHIFTR(gfx->words.w1, 16, 8), _SHIFTR(gfx->words.w1, 8, 8), _SHIFTR(gfx->words.w1, 0, 8)); - } - } - }*/ - - // Index refers to individual gfx words, which are half the size on 32-bit - // if (sizeof(uintptr_t) < 8) { - // index /= 2; - // } - - // Do not patch custom assets as they most likely do not have the same instructions as authentic assets - if (res->GetInitData()->IsCustom) { - return; - } - - Gfx* gfx = (Gfx*)&res->Instructions[index]; - - if (!originalGfx.contains(path) || !originalGfx[path].contains(patchName)) { - originalGfx[path][patchName] = { - index, - *gfx - }; - } - - *gfx = instruction; -} - -extern "C" void ResourceMgr_PatchGfxCopyCommandByName(const char* path, const char* patchName, int destinationIndex, int sourceIndex) { - auto res = std::static_pointer_cast( - Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); - - // Do not patch custom assets as they most likely do not have the same instructions as authentic assets - if (res->GetInitData()->IsCustom) { - return; - } - - Gfx* destinationGfx = (Gfx*)&res->Instructions[destinationIndex]; - Gfx sourceGfx = *(Gfx*)&res->Instructions[sourceIndex]; - - if (!originalGfx.contains(path) || !originalGfx[path].contains(patchName)) { - originalGfx[path][patchName] = { - destinationIndex, - *destinationGfx - }; - } - - *destinationGfx = sourceGfx; -} - -extern "C" void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName) { - if (originalGfx.contains(path) && originalGfx[path].contains(patchName)) { - auto res = std::static_pointer_cast( - Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); - - Gfx* gfx = (Gfx*)&res->Instructions[originalGfx[path][patchName].index]; - *gfx = originalGfx[path][patchName].instruction; - - originalGfx[path].erase(patchName); - } -} - -extern "C" char* ResourceMgr_LoadArrayByName(const char* path) -{ - auto res = std::static_pointer_cast(GetResourceByNameHandlingMQ(path)); - - return (char*)res->Scalars.data(); -} - -// Return of LoadArrayByNameAsVec3s must be freed by the caller -extern "C" char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path) { - auto res = std::static_pointer_cast(GetResourceByNameHandlingMQ(path)); - - // if (res->CachedGameAsset != nullptr) - // return (char*)res->CachedGameAsset; - // else - // { - Vec3s* data = (Vec3s*)malloc(sizeof(Vec3s) * res->Scalars.size()); - - for (size_t i = 0; i < res->Scalars.size(); i += 3) { - data[(i / 3)].x = res->Scalars[i + 0].s16; - data[(i / 3)].y = res->Scalars[i + 1].s16; - data[(i / 3)].z = res->Scalars[i + 2].s16; - } - - // res->CachedGameAsset = data; - - return (char*)data; - // } -} - -extern "C" CollisionHeader* ResourceMgr_LoadColByName(const char* path) { - return (CollisionHeader*) ResourceGetDataByName(path); -} - -extern "C" Vtx* ResourceMgr_LoadVtxByName(char* path) { - return (Vtx*) ResourceGetDataByName(path); -} - -extern "C" SequenceData ResourceMgr_LoadSeqByName(const char* path) { - SequenceData* sequence = (SequenceData*) ResourceGetDataByName(path); - return *sequence; -} - std::map cachedCustomSFs; extern "C" SoundFontSample* ReadCustomSample(const char* path) { @@ -1959,81 +1535,6 @@ extern "C" SoundFontSample* ReadCustomSample(const char* path) { */ } -extern "C" SoundFontSample* ResourceMgr_LoadAudioSample(const char* path) { - return (SoundFontSample*) ResourceGetDataByName(path); -} - -extern "C" SoundFont* ResourceMgr_LoadAudioSoundFont(const char* path) { - return (SoundFont*) ResourceGetDataByName(path); -} - -extern "C" int ResourceMgr_OTRSigCheck(char* imgData) -{ - uintptr_t i = (uintptr_t)(imgData); - -// if (i == 0xD9000000 || i == 0xE7000000 || (i & 1) == 1) - if ((i & 1) == 1) - return 0; - -// if ((i & 0xFF000000) != 0xAB000000 && (i & 0xFF000000) != 0xCD000000 && i != 0) { - if (i != 0) { - if (imgData[0] == '_' && imgData[1] == '_' && imgData[2] == 'O' && imgData[3] == 'T' && imgData[4] == 'R' && - imgData[5] == '_' && imgData[6] == '_') - return 1; - } - - return 0; -} - -extern "C" AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path) { - return (AnimationHeaderCommon*) ResourceGetDataByName(path); -} - -extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, SkelAnime* skelAnime) { - std::string pathStr = std::string(path); - static const std::string sOtr = "__OTR__"; - - if (pathStr.starts_with(sOtr)) { - pathStr = pathStr.substr(sOtr.length()); - } - - bool isAlt = ResourceMgr_IsAltAssetsEnabled(); - - if (isAlt) { - pathStr = Ship::IResource::gAltAssetPrefix + pathStr; - } - - SkeletonHeader* skelHeader = (SkeletonHeader*) ResourceGetDataByName(pathStr.c_str()); - - // If there isn't an alternate model, load the regular one - if (isAlt && skelHeader == NULL) { - skelHeader = (SkeletonHeader*) ResourceGetDataByName(path); - } - - // This function is only called when a skeleton is initialized. - // Therefore we can take this oppurtunity to take note of the Skeleton that is created... - if (skelAnime != nullptr) { - auto stringPath = std::string(path); - SOH::SkeletonPatcher::RegisterSkeleton(stringPath, skelAnime); - } - - return skelHeader; -} - -extern "C" void ResourceMgr_UnregisterSkeleton(SkelAnime* skelAnime) { - if (skelAnime != nullptr) - SOH::SkeletonPatcher::UnregisterSkeleton(skelAnime); -} - -extern "C" void ResourceMgr_ClearSkeletons(SkelAnime* skelAnime) { - if (skelAnime != nullptr) - SOH::SkeletonPatcher::ClearSkeletons(); -} - -extern "C" s32* ResourceMgr_LoadCSByName(const char* path) { - return (s32*)GetResourceDataByNameHandlingMQ(path); -} - std::filesystem::path GetSaveFile(std::shared_ptr Conf) { const std::string fileName = Conf->GetString("Game.SaveName", Ship::Context::GetPathRelativeToAppDirectory("oot_save.sav")); std::filesystem::path saveFile = std::filesystem::absolute(fileName); @@ -2884,7 +2385,7 @@ extern "C" void Gfx_TextureCacheDelete(const uint8_t* texAddr) { } if (ResourceMgr_OTRSigCheck(imgName)) { - texAddr = (const uint8_t*)GetResourceDataByNameHandlingMQ(imgName); + texAddr = (const uint8_t*)ResourceMgr_GetResourceDataByNameHandlingMQ(imgName); } gfx_texture_cache_delete(texAddr); diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h index 86e411ba9da..854ef5b8fc2 100644 --- a/soh/soh/OTRGlobals.h +++ b/soh/soh/OTRGlobals.h @@ -3,15 +3,6 @@ #pragma once -#include "SaveManager.h" -#include - -#define GAME_REGION_NTSC 0 -#define GAME_REGION_PAL 1 - -#define GAME_PLATFORM_N64 0 -#define GAME_PLATFORM_GC 1 - #define BTN_CUSTOM_MODIFIER1 0x0040 #define BTN_CUSTOM_MODIFIER2 0x0080 @@ -29,6 +20,14 @@ #include "Enhancements/savestates.h" #include "Enhancements/randomizer/randomizer.h" #include +#include + +struct ExtensionEntry { + std::string path; + std::string ext; +}; + +extern std::unordered_map ExtensionCache; #include "Enhancements/randomizer/context.h" const std::string customMessageTableID = "BaseGameOverrides"; @@ -42,60 +41,39 @@ const uint32_t defaultImGuiScale = 1; const float imguiScaleOptionToValue[4] = { 0.75f, 1.0f, 1.5f, 2.0f }; -class OTRGlobals -{ -public: - static OTRGlobals* Instance; +class OTRGlobals { + public: + static OTRGlobals* Instance; std::shared_ptr context; std::shared_ptr gSaveStateMgr; std::shared_ptr gRandomizer; std::shared_ptr gRandoContext; - ImFont* defaultFontSmaller; - ImFont* defaultFontLarger; - ImFont* defaultFontLargest; - - OTRGlobals(); - ~OTRGlobals(); - - void ScaleImGui(); - - bool HasMasterQuest(); - bool HasOriginal(); - uint32_t GetInterpolationFPS(); - std::shared_ptr> ListFiles(std::string path); - -private: - void CheckSaveFile(size_t sramSize) const; - bool hasMasterQuest; - bool hasOriginal; - ImFont* CreateDefaultFontWithSize(float size); -}; + ImFont* defaultFontSmaller; + ImFont* defaultFontLarger; + ImFont* defaultFontLargest; -uint32_t IsGameMasterQuest(); -#endif + OTRGlobals(); + ~OTRGlobals(); + + void ScaleImGui(); + + bool HasMasterQuest(); + bool HasOriginal(); + uint32_t GetInterpolationFPS(); + std::shared_ptr> ListFiles(std::string path); -#define CVAR_RANDOMIZER_ENHANCEMENT(var) CVAR_PREFIX_RANDOMIZER_ENHANCEMENT "." var -#define CVAR_RANDOMIZER_SETTING(var) CVAR_PREFIX_RANDOMIZER_SETTING "." var -#define CVAR_COSMETIC(var) CVAR_PREFIX_COSMETIC "." var -#define CVAR_AUDIO(var) CVAR_PREFIX_AUDIO "." var -#define CVAR_CHEAT(var) CVAR_PREFIX_CHEAT "." var -#define CVAR_ENHANCEMENT(var) CVAR_PREFIX_ENHANCEMENT "." var -#define CVAR_SETTING(var) CVAR_PREFIX_SETTING "." var -#define CVAR_WINDOW(var) CVAR_PREFIX_WINDOW "." var -#define CVAR_TRACKER(var) CVAR_PREFIX_TRACKER "." var -#define CVAR_TRACKER_ITEM(var) CVAR_TRACKER(".ItemTracker." var) -#define CVAR_TRACKER_CHECK(var) CVAR_TRACKER(".CheckTracker." var) -#define CVAR_TRACKER_ENTRANCE(var) CVAR_TRACKER(".EntranceTracker." var) -#define CVAR_DEVELOPER_TOOLS(var) CVAR_PREFIX_DEVELOPER_TOOLS "." var -#define CVAR_GENERAL(var) CVAR_PREFIX_GENERAL "." var -#define CVAR_REMOTE(var) CVAR_PREFIX_REMOTE "." var -#define CVAR_REMOTE_CROWD_CONTROL(var) CVAR_REMOTE(".CrowdControl." var) -#define CVAR_REMOTE_SAIL(var) CVAR_REMOTE(".Sail." var) + private: + void CheckSaveFile(size_t sramSize) const; + bool hasMasterQuest; + bool hasOriginal; + ImFont* CreateDefaultFontWithSize(float size); +}; +#endif #ifndef __cplusplus - void InitOTR(void); +void InitOTR(void); void DeinitOTR(void); void VanillaItemTable_Init(); void OTRAudio_Init(); @@ -109,53 +87,12 @@ void OTRGfxPrint(const char* str, void* printer, void (*printImpl)(void*, char)) void OTRGetPixelDepthPrepare(float x, float y); uint16_t OTRGetPixelDepth(float x, float y); int32_t OTRGetLastScancode(); -uint32_t ResourceMgr_IsGameMasterQuest(); -uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum); -uint32_t ResourceMgr_GameHasMasterQuest(); -uint32_t ResourceMgr_GameHasOriginal(); -uint32_t ResourceMgr_GetNumGameVersions(); -uint32_t ResourceMgr_GetGameVersion(int index); -uint32_t ResourceMgr_GetGamePlatform(int index); -uint32_t ResourceMgr_GetGameRegion(int index); -void ResourceMgr_LoadDirectory(const char* resName); -void ResourceMgr_UnloadResource(const char* resName); -char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize); -uint8_t ResourceMgr_FileExists(const char* resName); -uint8_t ResourceMgr_FileAltExists(const char* resName); -void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName); char* GetResourceDataByNameHandlingMQ(const char* path); -uint8_t ResourceMgr_TexIsRaw(const char* texPath); -uint8_t ResourceMgr_ResourceIsBackground(char* texPath); -char* ResourceMgr_LoadJPEG(char* data, size_t dataSize); -uint16_t ResourceMgr_LoadTexWidthByName(char* texPath); -uint16_t ResourceMgr_LoadTexHeightByName(char* texPath); -char* ResourceMgr_LoadTexOrDListByName(const char* filePath); -char* ResourceMgr_LoadPlayerAnimByName(const char* animPath); -AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path); -char* ResourceMgr_GetNameByCRC(uint64_t crc, char* alloc); -Gfx* ResourceMgr_LoadGfxByCRC(uint64_t crc); -Gfx* ResourceMgr_LoadGfxByName(const char* path); -uint8_t ResourceMgr_FileIsCustomByName(const char* path); -void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction); -void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName); -char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path); -Vtx* ResourceMgr_LoadVtxByCRC(uint64_t crc); - -Vtx* ResourceMgr_LoadVtxByName(char* path); -SoundFont* ResourceMgr_LoadAudioSoundFont(const char* path); -SequenceData ResourceMgr_LoadSeqByName(const char* path); -SoundFontSample* ResourceMgr_LoadAudioSample(const char* path); -CollisionHeader* ResourceMgr_LoadColByName(const char* path); + void Ctx_ReadSaveFile(uintptr_t addr, void* dramAddr, size_t size); void Ctx_WriteSaveFile(uintptr_t addr, void* dramAddr, size_t size); uint64_t GetPerfCounter(); -bool ResourceMgr_IsAltAssetsEnabled(); -struct SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, SkelAnime* skelAnime); -void ResourceMgr_UnregisterSkeleton(SkelAnime* skelAnime); -void ResourceMgr_ClearSkeletons(); -s32* ResourceMgr_LoadCSByName(const char* path); -int ResourceMgr_OTRSigCheck(char* imgData); uint64_t osGetTime(void); uint32_t osGetCount(void); uint32_t OTRGetCurrentWidth(void); diff --git a/soh/soh/ResourceManagerHelpers.cpp b/soh/soh/ResourceManagerHelpers.cpp new file mode 100644 index 00000000000..45ed269f7f5 --- /dev/null +++ b/soh/soh/ResourceManagerHelpers.cpp @@ -0,0 +1,505 @@ +#include "ResourceManagerHelpers.h" +#include "OTRGlobals.h" +#include "variables.h" +#include "z64.h" +#include "cvar_prefixes.h" +#include "Enhancements/enhancementTypes.h" +#include "Enhancements/randomizer/dungeon.h" +#include +#include +#include "resource/type/SohResourceType.h" +#include "resource/type/Array.h" +#include "resource/type/Skeleton.h" +#include "resource/type/PlayerAnimation.h" +#include +#include + +extern "C" PlayState* gPlayState; + +extern "C" uint32_t ResourceMgr_GetNumGameVersions() { + return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions().size(); +} + +extern "C" uint32_t ResourceMgr_GetGameVersion(int index) { + return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; +} + +extern "C" uint32_t ResourceMgr_GetGamePlatform(int index) { + uint32_t version = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; + + switch (version) { + case OOT_NTSC_US_10: + case OOT_NTSC_US_11: + case OOT_NTSC_US_12: + case OOT_PAL_10: + case OOT_PAL_11: + return GAME_PLATFORM_N64; + case OOT_NTSC_JP_GC: + case OOT_NTSC_US_GC: + case OOT_PAL_GC: + case OOT_NTSC_JP_MQ: + case OOT_NTSC_US_MQ: + case OOT_PAL_MQ: + case OOT_PAL_GC_DBG1: + case OOT_PAL_GC_DBG2: + case OOT_PAL_GC_MQ_DBG: + return GAME_PLATFORM_GC; + } +} + +extern "C" uint32_t ResourceMgr_GetGameRegion(int index) { + uint32_t version = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index]; + + switch (version) { + case OOT_NTSC_US_10: + case OOT_NTSC_US_11: + case OOT_NTSC_US_12: + case OOT_NTSC_JP_GC: + case OOT_NTSC_US_GC: + case OOT_NTSC_JP_MQ: + case OOT_NTSC_US_MQ: + return GAME_REGION_NTSC; + case OOT_PAL_10: + case OOT_PAL_11: + case OOT_PAL_GC: + case OOT_PAL_MQ: + case OOT_PAL_GC_DBG1: + case OOT_PAL_GC_DBG2: + case OOT_PAL_GC_MQ_DBG: + return GAME_REGION_PAL; + } +} + +u32 IsSceneMasterQuest(s16 sceneNum) { + u8 mqMode = CVarGetInteger(CVAR_GENERAL("BetterDebugWarpScreenMQMode"), WARP_MODE_OVERRIDE_OFF); + if (mqMode == WARP_MODE_OVERRIDE_MQ_AS_VANILLA) { + return true; + } + + if (mqMode == WARP_MODE_OVERRIDE_VANILLA_AS_MQ) { + return false; + } + + if (OTRGlobals::Instance->HasMasterQuest()) { + if (!OTRGlobals::Instance->HasOriginal()) { + return true; + } + + if (IS_MASTER_QUEST) { + return true; + } + + if (IS_RANDO) { + auto dungeon = OTRGlobals::Instance->gRandoContext->GetDungeons()->GetDungeonFromScene(sceneNum); + if (dungeon != nullptr && dungeon->IsMQ()) { + return true; + } + } + } + + return false; +} + +extern "C" uint32_t ResourceMgr_GameHasMasterQuest() { + return OTRGlobals::Instance->HasMasterQuest(); +} + +extern "C" uint32_t ResourceMgr_GameHasOriginal() { + return OTRGlobals::Instance->HasOriginal(); +} + +extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum) { + return IsSceneMasterQuest(sceneNum); +} + +extern "C" uint32_t ResourceMgr_IsGameMasterQuest() { + return gPlayState != NULL ? IsSceneMasterQuest(gPlayState->sceneNum) : 0; +} + +extern "C" void ResourceMgr_LoadDirectory(const char* resName) { + Ship::Context::GetInstance()->GetResourceManager()->LoadDirectory(resName); +} + +extern "C" void ResourceMgr_DirtyDirectory(const char* resName) { + Ship::Context::GetInstance()->GetResourceManager()->DirtyDirectory(resName); +} + +extern "C" void ResourceMgr_UnloadResource(const char* resName) { + std::string path = resName; + if (path.substr(0, 7) == "__OTR__") { + path = path.substr(7); + } + auto res = Ship::Context::GetInstance()->GetResourceManager()->UnloadResource(path); +} + +// OTRTODO: There is probably a more elegant way to go about this... +// Kenix: This is definitely leaking memory when it's called. +extern "C" char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize) { + auto lst = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles(searchMask); + char** result = (char**)malloc(lst->size() * sizeof(char*)); + + for (size_t i = 0; i < lst->size(); i++) { + char* str = (char*)malloc(lst.get()[0][i].size() + 1); + memcpy(str, lst.get()[0][i].data(), lst.get()[0][i].size()); + str[lst.get()[0][i].size()] = '\0'; + result[i] = str; + } + *resultSize = lst->size(); + + return result; +} + +extern "C" uint8_t ResourceMgr_FileExists(const char* filePath) { + std::string path = filePath; + if(path.substr(0, 7) == "__OTR__"){ + path = path.substr(7); + } + + return ExtensionCache.contains(path); +} + +extern "C" uint8_t ResourceMgr_FileAltExists(const char* filePath) { + std::string path = filePath; + if (path.substr(0, 7) == "__OTR__") { + path = path.substr(7); + } + + if (path.substr(0, 4) != "alt/") { + path = "alt/" + path; + } + + return ExtensionCache.contains(path); +} + +extern "C" bool ResourceMgr_IsAltAssetsEnabled() { + return Ship::Context::GetInstance()->GetResourceManager()->IsAltAssetsEnabled(); +} + +// Unloads a resource if an alternate version exists when alt assets are enabled +// The resource is only removed from the internal cache to prevent it from used in the next resource lookup +extern "C" void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName) { + if (ResourceMgr_IsAltAssetsEnabled() && ResourceMgr_FileAltExists((char*)resName)) { + ResourceMgr_UnloadResource((char*) resName); + } +} + +std::shared_ptr ResourceMgr_GetResourceByNameHandlingMQ(const char* path) { + std::string Path = path; + if (ResourceMgr_IsGameMasterQuest()) { + size_t pos = 0; + if ((pos = Path.find("/nonmq/", 0)) != std::string::npos) { + Path.replace(pos, 7, "/mq/"); + } + } + return Ship::Context::GetInstance()->GetResourceManager()->LoadResource(Path.c_str()); +} + +extern "C" char* ResourceMgr_GetResourceDataByNameHandlingMQ(const char* path) { + auto res = ResourceMgr_GetResourceByNameHandlingMQ(path); + + if (res == nullptr) { + return nullptr; + } + + return (char*)res->GetRawPointer(); +} + +extern "C" uint8_t ResourceMgr_TexIsRaw(const char* texPath) { + auto res = std::static_pointer_cast(ResourceMgr_GetResourceByNameHandlingMQ(texPath)); + return res->Flags & TEX_FLAG_LOAD_AS_RAW; +} + +extern "C" uint8_t ResourceMgr_ResourceIsBackground(char* texPath) { + auto res = ResourceMgr_GetResourceByNameHandlingMQ(texPath); + return res->GetInitData()->Type == static_cast(SOH::ResourceType::SOH_Background); +} + +extern "C" char* ResourceMgr_LoadJPEG(char* data, size_t dataSize) { + static char* finalBuffer = 0; + + if (finalBuffer == 0) { + finalBuffer = (char*)malloc(dataSize); + } + + int w; + int h; + int comp; + + unsigned char* pixels = stbi_load_from_memory((const unsigned char*)data, 320 * 240 * 2, &w, &h, &comp, STBI_rgb_alpha); + //unsigned char* pixels = stbi_load_from_memory((const unsigned char*)data, 480 * 240 * 2, &w, &h, &comp, STBI_rgb_alpha); + int idx = 0; + + for (int y = 0; y < h; y++) { + for (int x = 0; x < w; x++) { + uint16_t* bufferTest = (uint16_t*)finalBuffer; + int pixelIdx = ((y * w) + x) * 4; + + uint8_t r = pixels[pixelIdx + 0] / 8; + uint8_t g = pixels[pixelIdx + 1] / 8; + uint8_t b = pixels[pixelIdx + 2] / 8; + + uint8_t alphaBit = pixels[pixelIdx + 3] != 0; + + uint16_t data = (r << 11) + (g << 6) + (b << 1) + alphaBit; + + finalBuffer[idx++] = (data & 0xFF00) >> 8; + finalBuffer[idx++] = (data & 0x00FF); + } + } + + return (char*)finalBuffer; +} + +extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) { + auto res = ResourceMgr_GetResourceByNameHandlingMQ(filePath); + + if (res->GetInitData()->Type == static_cast(LUS::ResourceType::DisplayList)) { + return (char*)&((std::static_pointer_cast(res))->Instructions[0]); + } + + if (res->GetInitData()->Type == static_cast(SOH::ResourceType::SOH_Array)) { + return (char*)(std::static_pointer_cast(res))->Vertices.data(); + } + + return (char*)ResourceMgr_GetResourceDataByNameHandlingMQ(filePath); +} + +extern "C" char* ResourceMgr_LoadIfDListByName(const char* filePath) { + auto res = ResourceMgr_GetResourceByNameHandlingMQ(filePath); + + if (res->GetInitData()->Type == static_cast(LUS::ResourceType::DisplayList)) { + return (char*)&((std::static_pointer_cast(res))->Instructions[0]); + } + + return nullptr; +} + +extern "C" char* ResourceMgr_LoadPlayerAnimByName(const char* animPath) { + auto anim = std::static_pointer_cast(ResourceMgr_GetResourceByNameHandlingMQ(animPath)); + + return (char*)&anim->limbRotData[0]; +} + +extern "C" void ResourceMgr_PushCurrentDirectory(char* path) { + gfx_push_current_dir(path); +} + +extern "C" Gfx* ResourceMgr_LoadGfxByName(const char* path) { + // When an alt resource exists for the DL, we need to unload the original asset + // to clear the cache so the alt asset will be loaded instead + // OTRTODO: If Alt loading over original cache is fixed, this line can most likely be removed + ResourceMgr_UnloadOriginalWhenAltExists(path); + + auto res = std::static_pointer_cast(ResourceMgr_GetResourceByNameHandlingMQ(path)); + return (Gfx*)&res->Instructions[0]; +} + +extern "C" uint8_t ResourceMgr_FileIsCustomByName(const char* path) { + auto res = std::static_pointer_cast(ResourceMgr_GetResourceByNameHandlingMQ(path)); + return res->GetInitData()->IsCustom; +} + +typedef struct { + int index; + Gfx instruction; +} GfxPatch; + +std::unordered_map> originalGfx; + +// Attention! This is primarily for cosmetics & bug fixes. For things like mods and model replacement you should be using OTRs +// instead (When that is available). Index can be found using the commented out section below. +extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction) { + auto res = std::static_pointer_cast( + Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); + + // Leaving this here for people attempting to find the correct Dlist index to patch + /*if (strcmp("__OTR__objects/object_gi_longsword/gGiBiggoronSwordDL", path) == 0) { + for (int i = 0; i < res->instructions.size(); i++) { + Gfx* gfx = (Gfx*)&res->instructions[i]; + // Log all commands + // SPDLOG_INFO("index:{} command:{}", i, gfx->words.w0 >> 24); + // Log only SetPrimColors + if (gfx->words.w0 >> 24 == 250) { + SPDLOG_INFO("index:{} r:{} g:{} b:{} a:{}", i, _SHIFTR(gfx->words.w1, 24, 8), _SHIFTR(gfx->words.w1, 16, 8), _SHIFTR(gfx->words.w1, 8, 8), _SHIFTR(gfx->words.w1, 0, 8)); + } + } + }*/ + + // Index refers to individual gfx words, which are half the size on 32-bit + // if (sizeof(uintptr_t) < 8) { + // index /= 2; + // } + + // Do not patch custom assets as they most likely do not have the same instructions as authentic assets + if (res->GetInitData()->IsCustom) { + return; + } + + Gfx* gfx = (Gfx*)&res->Instructions[index]; + + if (!originalGfx.contains(path) || !originalGfx[path].contains(patchName)) { + originalGfx[path][patchName] = { + index, + *gfx + }; + } + + *gfx = instruction; +} + +extern "C" void ResourceMgr_PatchGfxCopyCommandByName(const char* path, const char* patchName, int destinationIndex, int sourceIndex) { + auto res = std::static_pointer_cast( + Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); + + // Do not patch custom assets as they most likely do not have the same instructions as authentic assets + if (res->GetInitData()->IsCustom) { + return; + } + + Gfx* destinationGfx = (Gfx*)&res->Instructions[destinationIndex]; + Gfx sourceGfx = *(Gfx*)&res->Instructions[sourceIndex]; + + if (!originalGfx.contains(path) || !originalGfx[path].contains(patchName)) { + originalGfx[path][patchName] = { + destinationIndex, + *destinationGfx + }; + } + + *destinationGfx = sourceGfx; +} + +extern "C" void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName) { + if (originalGfx.contains(path) && originalGfx[path].contains(patchName)) { + auto res = std::static_pointer_cast( + Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path)); + + Gfx* gfx = (Gfx*)&res->Instructions[originalGfx[path][patchName].index]; + *gfx = originalGfx[path][patchName].instruction; + + originalGfx[path].erase(patchName); + } +} + +extern "C" char* ResourceMgr_LoadArrayByName(const char* path) { + auto res = std::static_pointer_cast(ResourceMgr_GetResourceByNameHandlingMQ(path)); + + return (char*)res->Scalars.data(); +} + +// Return of LoadArrayByNameAsVec3s must be freed by the caller +extern "C" char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path) { + auto res = std::static_pointer_cast(ResourceMgr_GetResourceByNameHandlingMQ(path)); + + // if (res->CachedGameAsset != nullptr) + // return (char*)res->CachedGameAsset; + // else + // { + Vec3s* data = (Vec3s*)malloc(sizeof(Vec3s) * res->Scalars.size()); + + for (size_t i = 0; i < res->Scalars.size(); i += 3) { + data[(i / 3)].x = res->Scalars[i + 0].s16; + data[(i / 3)].y = res->Scalars[i + 1].s16; + data[(i / 3)].z = res->Scalars[i + 2].s16; + } + + // res->CachedGameAsset = data; + + return (char*)data; + // } +} + +extern "C" CollisionHeader* ResourceMgr_LoadColByName(const char* path) { + return (CollisionHeader*) ResourceGetDataByName(path); +} + +extern "C" Vtx* ResourceMgr_LoadVtxByName(char* path) { + return (Vtx*) ResourceGetDataByName(path); +} + +extern "C" SequenceData ResourceMgr_LoadSeqByName(const char* path) { + SequenceData* sequence = (SequenceData*) ResourceGetDataByName(path); + return *sequence; +} + +extern "C" SoundFontSample* ResourceMgr_LoadAudioSample(const char* path) { + return (SoundFontSample*) ResourceGetDataByName(path); +} + +extern "C" SoundFont* ResourceMgr_LoadAudioSoundFont(const char* path) { + return (SoundFont*) ResourceGetDataByName(path); +} + +extern "C" int ResourceMgr_OTRSigCheck(char* imgData) { + uintptr_t i = (uintptr_t)(imgData); + +// if (i == 0xD9000000 || i == 0xE7000000 || (i & 1) == 1) + if ((i & 1) == 1) + return 0; + +// if ((i & 0xFF000000) != 0xAB000000 && (i & 0xFF000000) != 0xCD000000 && i != 0) { + if (i != 0) { + if ( + imgData[0] == '_' && + imgData[1] == '_' && + imgData[2] == 'O' && + imgData[3] == 'T' && + imgData[4] == 'R' && + imgData[5] == '_' && + imgData[6] == '_' + ) { + return 1; + } + } + + return 0; +} + +extern "C" AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path) { + return (AnimationHeaderCommon*) ResourceGetDataByName(path); +} + +extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, SkelAnime* skelAnime) { + std::string pathStr = std::string(path); + static const std::string sOtr = "__OTR__"; + + if (pathStr.starts_with(sOtr)) { + pathStr = pathStr.substr(sOtr.length()); + } + + bool isAlt = ResourceMgr_IsAltAssetsEnabled(); + + if (isAlt) { + pathStr = Ship::IResource::gAltAssetPrefix + pathStr; + } + + SkeletonHeader* skelHeader = (SkeletonHeader*) ResourceGetDataByName(pathStr.c_str()); + + // If there isn't an alternate model, load the regular one + if (isAlt && skelHeader == NULL) { + skelHeader = (SkeletonHeader*) ResourceGetDataByName(path); + } + + // This function is only called when a skeleton is initialized. + // Therefore we can take this oppurtunity to take note of the Skeleton that is created... + if (skelAnime != nullptr) { + auto stringPath = std::string(path); + SOH::SkeletonPatcher::RegisterSkeleton(stringPath, skelAnime); + } + + return skelHeader; +} + +extern "C" void ResourceMgr_UnregisterSkeleton(SkelAnime* skelAnime) { + if (skelAnime != nullptr) { + SOH::SkeletonPatcher::UnregisterSkeleton(skelAnime); + } +} + +extern "C" void ResourceMgr_ClearSkeletons() { + SOH::SkeletonPatcher::ClearSkeletons(); +} + +extern "C" s32* ResourceMgr_LoadCSByName(const char* path) { + return (s32*)ResourceMgr_GetResourceDataByNameHandlingMQ(path); +} diff --git a/soh/soh/ResourceManagerHelpers.h b/soh/soh/ResourceManagerHelpers.h new file mode 100644 index 00000000000..3b14188b759 --- /dev/null +++ b/soh/soh/ResourceManagerHelpers.h @@ -0,0 +1,66 @@ +#pragma once + +#include "libultraship/libultra/types.h" + +#define GAME_REGION_NTSC 0 +#define GAME_REGION_PAL 1 + +#define GAME_PLATFORM_N64 0 +#define GAME_PLATFORM_GC 1 + +#ifdef __cplusplus +#include +#include + +std::shared_ptr ResourceMgr_GetResourceByNameHandlingMQ(const char* path); + +extern "C" { +#endif // __cplusplus + #include "z64animation.h" + #include "z64audio.h" + #include "z64bgcheck.h" + uint32_t ResourceMgr_IsGameMasterQuest(); + uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum); + uint32_t ResourceMgr_GameHasMasterQuest(); + uint32_t ResourceMgr_GameHasOriginal(); + uint32_t ResourceMgr_GetNumGameVersions(); + uint32_t ResourceMgr_GetGameVersion(int index); + uint32_t ResourceMgr_GetGamePlatform(int index); + uint32_t ResourceMgr_GetGameRegion(int index); + void ResourceMgr_LoadDirectory(const char* resName); + void ResourceMgr_UnloadResource(const char* resName); + char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize); + uint8_t ResourceMgr_FileExists(const char* resName); + uint8_t ResourceMgr_FileAltExists(const char* resName); + void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName); + uint8_t ResourceMgr_TexIsRaw(const char* texPath); + uint8_t ResourceMgr_ResourceIsBackground(char* texPath); + char* ResourceMgr_LoadJPEG(char* data, size_t dataSize); + uint16_t ResourceMgr_LoadTexWidthByName(char* texPath); + uint16_t ResourceMgr_LoadTexHeightByName(char* texPath); + char* ResourceMgr_LoadTexOrDListByName(const char* filePath); + char* ResourceMgr_LoadPlayerAnimByName(const char* animPath); + AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path); + char* ResourceMgr_GetNameByCRC(uint64_t crc, char* alloc); + Gfx* ResourceMgr_LoadGfxByCRC(uint64_t crc); + Gfx* ResourceMgr_LoadGfxByName(const char* path); + uint8_t ResourceMgr_FileIsCustomByName(const char* path); + void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction); + void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName); + char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path); + Vtx* ResourceMgr_LoadVtxByCRC(uint64_t crc); + Vtx* ResourceMgr_LoadVtxByName(char* path); + SoundFont* ResourceMgr_LoadAudioSoundFont(const char* path); + SequenceData ResourceMgr_LoadSeqByName(const char* path); + SoundFontSample* ResourceMgr_LoadAudioSample(const char* path); + CollisionHeader* ResourceMgr_LoadColByName(const char* path); + bool ResourceMgr_IsAltAssetsEnabled(); + SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, SkelAnime* skelAnime); + void ResourceMgr_UnregisterSkeleton(SkelAnime* skelAnime); + void ResourceMgr_ClearSkeletons(); + s32* ResourceMgr_LoadCSByName(const char* path); + int ResourceMgr_OTRSigCheck(char* imgData); + char* ResourceMgr_GetResourceDataByNameHandlingMQ(const char* path); +#ifdef __cplusplus +} +#endif // __cplusplus \ No newline at end of file diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index 4073725757c..1d2ce5a6f3f 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -10,6 +10,7 @@ #include "Enhancements/randomizer/item.h" #include "z64.h" +#include "cvar_prefixes.h" #include "functions.h" #include "macros.h" #include diff --git a/soh/soh/SaveManager.h b/soh/soh/SaveManager.h index c17f3d125a7..1eb6ee87ab3 100644 --- a/soh/soh/SaveManager.h +++ b/soh/soh/SaveManager.h @@ -1,6 +1,7 @@ #pragma once #include +#include "z64save.h" #define SECTION_PARENT_NONE -1 typedef struct { @@ -45,8 +46,6 @@ typedef struct { #define BS_THREAD_POOL_ENABLE_PAUSE #include -#include "z64save.h" - #include class SaveManager { diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index beadebfae57..28a0c1c266e 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -10,7 +10,9 @@ #include "include/z64audio.h" #include "graphic/Fast3D/gfx_rendering_api.h" #include "OTRGlobals.h" +#include "SaveManager.h" #include "z64.h" +#include "cvar_prefixes.h" #include "macros.h" #include "Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/presets.h" diff --git a/soh/soh/cvar_prefixes.h b/soh/soh/cvar_prefixes.h new file mode 100644 index 00000000000..6ddde97bdcc --- /dev/null +++ b/soh/soh/cvar_prefixes.h @@ -0,0 +1,17 @@ +#define CVAR_RANDOMIZER_ENHANCEMENT(var) CVAR_PREFIX_RANDOMIZER_ENHANCEMENT "." var +#define CVAR_RANDOMIZER_SETTING(var) CVAR_PREFIX_RANDOMIZER_SETTING "." var +#define CVAR_COSMETIC(var) CVAR_PREFIX_COSMETIC "." var +#define CVAR_AUDIO(var) CVAR_PREFIX_AUDIO "." var +#define CVAR_CHEAT(var) CVAR_PREFIX_CHEAT "." var +#define CVAR_ENHANCEMENT(var) CVAR_PREFIX_ENHANCEMENT "." var +#define CVAR_SETTING(var) CVAR_PREFIX_SETTING "." var +#define CVAR_WINDOW(var) CVAR_PREFIX_WINDOW "." var +#define CVAR_TRACKER(var) CVAR_PREFIX_TRACKER "." var +#define CVAR_TRACKER_ITEM(var) CVAR_TRACKER(".ItemTracker." var) +#define CVAR_TRACKER_CHECK(var) CVAR_TRACKER(".CheckTracker." var) +#define CVAR_TRACKER_ENTRANCE(var) CVAR_TRACKER(".EntranceTracker." var) +#define CVAR_DEVELOPER_TOOLS(var) CVAR_PREFIX_DEVELOPER_TOOLS "." var +#define CVAR_GENERAL(var) CVAR_PREFIX_GENERAL "." var +#define CVAR_REMOTE(var) CVAR_PREFIX_REMOTE "." var +#define CVAR_REMOTE_CROWD_CONTROL(var) CVAR_REMOTE(".CrowdControl." var) +#define CVAR_REMOTE_SAIL(var) CVAR_REMOTE(".Sail." var) \ No newline at end of file diff --git a/soh/soh/resource/logging/PathLogger.h b/soh/soh/resource/logging/PathLogger.h index a5e42aeaf85..91274db768b 100644 --- a/soh/soh/resource/logging/PathLogger.h +++ b/soh/soh/resource/logging/PathLogger.h @@ -1,5 +1,6 @@ #include "Resource.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" namespace SOH { void LogPathAsXML(std::shared_ptr resource); diff --git a/soh/soh/resource/logging/SceneCommandLoggers.h b/soh/soh/resource/logging/SceneCommandLoggers.h index f952ac766bd..d8a7ac2d54a 100644 --- a/soh/soh/resource/logging/SceneCommandLoggers.h +++ b/soh/soh/resource/logging/SceneCommandLoggers.h @@ -1,5 +1,6 @@ #include "Resource.h" #include "soh/OTRGlobals.h" +#include "soh/cvar_prefixes.h" namespace SOH { diff --git a/soh/soh/z_play_otr.cpp b/soh/soh/z_play_otr.cpp index 22345af88c6..279b4e696cb 100644 --- a/soh/soh/z_play_otr.cpp +++ b/soh/soh/z_play_otr.cpp @@ -1,4 +1,5 @@ #include "OTRGlobals.h" +#include "ResourceManagerHelpers.h" #include #include "soh/resource/type/Scene.h" #include @@ -35,7 +36,7 @@ extern "C" void OTRPlay_SpawnScene(PlayState* play, s32 sceneId, s32 spawn) { std::string sceneVersion = "shared"; if (inNonSharedScene) { - sceneVersion = IsGameMasterQuest() ? "mq" : "nonmq"; + sceneVersion = ResourceMgr_IsGameMasterQuest() ? "mq" : "nonmq"; } std::string scenePath = StringHelper::Sprintf("scenes/%s/%s/%s", sceneVersion.c_str(), scene->sceneFile.fileName, scene->sceneFile.fileName); diff --git a/soh/soh/z_scene_otr.cpp b/soh/soh/z_scene_otr.cpp index 7422ee6e11b..4e05cd7a8cd 100644 --- a/soh/soh/z_scene_otr.cpp +++ b/soh/soh/z_scene_otr.cpp @@ -1,4 +1,5 @@ #include "OTRGlobals.h" +#include "ResourceManagerHelpers.h" #include #include "soh/resource/type/Scene.h" #include @@ -39,9 +40,6 @@ extern "C" s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId); extern "C" RomFile sNaviMsgFiles[]; s32 OTRScene_ExecuteCommands(PlayState* play, SOH::Scene* scene); -// Forward Declaration of function declared in OTRGlobals.cpp -std::shared_ptr GetResourceByNameHandlingMQ(const char* path); - bool Scene_CommandSpawnList(PlayState* play, SOH::ISceneCommand* cmd) { // SOH::SetStartPositionList* cmdStartPos = std::static_pointer_cast(cmd); SOH::SetStartPositionList* cmdStartPos = (SOH::SetStartPositionList*)cmd; @@ -512,7 +510,7 @@ extern "C" s32 OTRfunc_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomN //&roomCtx->loadQueue, NULL, __FILE__, __LINE__); auto roomData = - std::static_pointer_cast(GetResourceByNameHandlingMQ(play->roomList[roomNum].fileName)); + std::static_pointer_cast(ResourceMgr_GetResourceByNameHandlingMQ(play->roomList[roomNum].fileName)); roomCtx->status = 1; roomCtx->roomToLoad = roomData.get(); diff --git a/soh/src/code/audio_load.c b/soh/src/code/audio_load.c index cb7ba60bb88..3c722461273 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 39be0c3a75f..3b3089e2c02 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 extern bool gUseLegacySD; diff --git a/soh/src/code/audio_seqplayer.c b/soh/src/code/audio_seqplayer.c index 8d484575db7..e194fd28b7e 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 90e49bbd32f..d8da87bb4df 100644 --- a/soh/src/code/code_800EC960.c +++ b/soh/src/code/code_800EC960.c @@ -1,5 +1,6 @@ #include #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 90438b5db1c..a1426671993 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 6d8686074eb..42e9c3e161a 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 57dd2c6f706..8665fb44882 100644 --- a/soh/src/code/padmgr.c +++ b/soh/src/code/padmgr.c @@ -3,6 +3,8 @@ #include #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 f69e18f1c4a..a9f5aeab05e 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 #include diff --git a/soh/src/code/z_bgcheck.c b/soh/src/code/z_bgcheck.c index 2a385f9662e..df7dd0600c3 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 +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include #define SS_NULL 0xFFFF diff --git a/soh/src/code/z_cheap_proc.c b/soh/src/code/z_cheap_proc.c index cf52db2d35e..4af2867e5a0 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 5c234882977..2129dbf1014 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 e586c1bcce0..91f00105fb1 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 +#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 9e2ec53cf77..93e5fad42ab 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 8d92b03f9fc..f077d517114 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 +#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 c75450be206..3daa6528a25 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 +#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 2d46a1899b9..a2bdfc1a542 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 e573b0f5776..6e3736b77ba 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 15d136eab8a..52742bc627c 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 aed55eda036..d45d10cc909 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 637823b579a..be358f07521 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 +#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 df8ef44643d..1831b8fddf8 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 a9fa846d29c..2c180c584a0 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 83bffcd27e4..219b3a448d5 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -11,6 +11,8 @@ #include #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 diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index 6def1f4101b..7afa6fdd354 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 diff --git a/soh/src/code/z_rcp.c b/soh/src/code/z_rcp.c index 978c04d3cee..767772949be 100644 --- a/soh/src/code/z_rcp.c +++ b/soh/src/code/z_rcp.c @@ -1,5 +1,6 @@ #include "global.h" #include +#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 1478d50f857..2e8cdc655fa 100644 --- a/soh/src/code/z_room.c +++ b/soh/src/code/z_room.c @@ -9,6 +9,8 @@ #include #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 9cb9a31d774..c7d76db01ad 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 0bcf392368c..e91de847b3c 100644 --- a/soh/src/code/z_skelanime.c +++ b/soh/src/code/z_skelanime.c @@ -3,6 +3,8 @@ #include #include #include +#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 d0ebe75b4a0..3627797b43b 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 +#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 388d59ec9ec..e7e43a823bf 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 51f28a06877..8cea4b5d43c 100644 --- a/soh/src/code/z_ss_sram.c +++ b/soh/src/code/z_ss_sram.c @@ -1,5 +1,6 @@ #include #include "global.h" +#include "soh/OTRGlobals.h" #include #include diff --git a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index ba75c10e867..9f89e7980bf 100644 --- a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -8,6 +8,7 @@ #include "scenes/dungeons/ddan/ddan_scene.h" #include "objects/object_bwall/object_bwall.h" #include "objects/object_kingdodongo/object_kingdodongo.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" diff --git a/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index 799a46c62a4..fecb650bf39 100644 --- a/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -11,6 +11,8 @@ #include "scenes/indoors/yousei_izumi_yoko/yousei_izumi_yoko_scene.h" #include "scenes/indoors/daiyousei_izumi/daiyousei_izumi_scene.h" #include "soh/frame_interpolation.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index 3307b61488a..2c4ef32ec65 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -7,6 +7,7 @@ #include "z_bg_gate_shutter.h" #include "objects/object_spot01_matoyab/object_spot01_matoyab.h" #include "vt.h" +#include "soh/OTRGlobals.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c b/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c index 18eae69fb3c..59c72119f78 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c +++ b/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c @@ -7,6 +7,7 @@ #include "z_bg_gjyo_bridge.h" #include "objects/object_gjyo_objects/object_gjyo_objects.h" #include "scenes/dungeons/ganon_tou/ganon_tou_scene.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index ab832198ed7..9810f27495a 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -1,5 +1,6 @@ #include "z_bg_ice_shelter.h" #include "objects/object_ice_objects/object_ice_objects.h" +#include "soh/OTRGlobals.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c b/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c index 19bef1b67fc..f8dea0c01b3 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c @@ -6,6 +6,7 @@ #include "z_bg_jya_lift.h" #include "objects/object_jya_obj/object_jya_obj.h" +#include "soh/OTRGlobals.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c b/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c index 905106dce3a..a914c204c7f 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c @@ -6,6 +6,7 @@ #include "z_bg_spot01_idosoko.h" #include "objects/object_spot01_matoya/object_spot01_matoya.h" +#include "soh/OTRGlobals.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c b/soh/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c index 71341097bad..28c2769f401 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c @@ -6,6 +6,7 @@ #include "z_bg_spot03_taki.h" #include "objects/object_spot03_object/object_spot03_object.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index 5d73c277f72..10c6ac55948 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -6,6 +6,7 @@ #include "z_bg_spot12_saku.h" #include "objects/object_spot12_obj/object_spot12_obj.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c b/soh/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c index f62f0912819..af63fdcd248 100644 --- a/soh/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c +++ b/soh/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.c @@ -6,6 +6,7 @@ #include "z_bg_sst_floor.h" #include "objects/object_sst/object_sst.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 621ed0e7fa3..671831539c0 100644 --- a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -6,6 +6,7 @@ #include "z_bg_toki_swd.h" #include "objects/object_toki_objects/object_toki_objects.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c index b6bd559d2fa..334161c2d53 100644 --- a/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -7,6 +7,7 @@ #include "z_bg_treemouth.h" #include "objects/object_spot04_objects/object_spot04_objects.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c b/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c index f197bff4da4..e8a757d0451 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c +++ b/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c @@ -6,6 +6,7 @@ #include "z_bg_ydan_sp.h" #include "objects/object_ydan_objects/object_ydan_objects.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index 484b8d4bda6..710d0b95f9d 100644 --- a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -5,6 +5,8 @@ #include "scenes/dungeons/ddan_boss/ddan_boss_room_1.h" #include "soh/frame_interpolation.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include // malloc #include // memcpy diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index e3543315c5b..2860b68f675 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -11,6 +11,7 @@ #include "assets/scenes/dungeons/ganon_boss/ganon_boss_scene.h" #include "soh/frame_interpolation.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 1323afe3249..c065a245074 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -7,6 +7,8 @@ #include "objects/object_ganon_anime3/object_ganon_anime3.h" #include "objects/object_geff/object_geff.h" #include "soh/frame_interpolation.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include diff --git a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 45b8302dc83..a582a8d0c06 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -11,6 +11,7 @@ #include "overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 0644f73a829..e3551d90f5e 100644 --- a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -4,6 +4,7 @@ #include "overlays/actors/ovl_En_Goma/z_en_goma.h" #include "overlays/actors/ovl_Door_Shutter/z_door_shutter.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" diff --git a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 7eede228bdd..005a8a08948 100644 --- a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -11,6 +11,7 @@ #include "overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "soh/frame_interpolation.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" diff --git a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index 1d21a0372d5..8a7368647d0 100644 --- a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -14,6 +14,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" +#include "soh/OTRGlobals.h" #include "soh/frame_interpolation.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" diff --git a/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c b/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c index c7f74ed39c4..8b68506f2c6 100644 --- a/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c +++ b/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c @@ -12,6 +12,7 @@ #include "overlays/actors/ovl_Eff_Dust/z_eff_dust.h" #include "soh/frame_interpolation.h" #include +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index 79fcad87304..46102096ab2 100644 --- a/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -10,6 +10,8 @@ #include "objects/object_efc_tw/object_efc_tw.h" #include "objects/object_gi_jewel/object_gi_jewel.h" #include +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c b/soh/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c index 9e7bad0e1d6..c641f72bf60 100644 --- a/soh/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c +++ b/soh/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c @@ -1,6 +1,7 @@ #include "z_demo_ik.h" #include "vt.h" #include "objects/object_ik/object_ik.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index d67e1cb9fd3..9be3093220d 100644 --- a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -10,6 +10,8 @@ #include "scenes/indoors/nakaniwa/nakaniwa_scene.h" #include "objects/object_im/object_im.h" #include "vt.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index c90ec323734..a7a637d3e85 100644 --- a/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -5,6 +5,7 @@ #include "objects/object_toki_objects/object_toki_objects.h" #include "soh/frame_interpolation.h" #include +#include "soh/OTRGlobals.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c b/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c index 40164012dc7..b85ccf744f6 100644 --- a/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c +++ b/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c @@ -7,6 +7,7 @@ #include "z_demo_kekkai.h" #include "objects/object_demo_kekkai/object_demo_kekkai.h" #include "scenes/dungeons/ganontika/ganontika_scene.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 431734de22a..d4d3d8b60e4 100644 --- a/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -8,6 +8,7 @@ #include "objects/gameplay_field_keep/gameplay_field_keep.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/randomizer/randomizer_grotto.h" +#include "soh/OTRGlobals.h" #define FLAGS ACTOR_FLAG_NO_FREEZE_OCARINA diff --git a/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index 058b5cb23d6..aeb3e1f33bc 100644 --- a/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -11,6 +11,7 @@ #include "objects/object_haka_door/object_haka_door.h" #include "objects/object_door_killer/object_door_killer.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 61e97a560f0..e767135e3de 100644 --- a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -2,6 +2,7 @@ #include "objects/object_warp1/object_warp1.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/boss-rush/BossRush.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Am/z_en_am.c b/soh/src/overlays/actors/ovl_En_Am/z_en_am.c index c62e3a8fa12..91c853e7258 100644 --- a/soh/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/soh/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -8,6 +8,7 @@ #include "objects/object_am/object_am.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_CAN_PRESS_SWITCH) diff --git a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c index c6184e2df31..d00970e50ff 100644 --- a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -6,6 +6,8 @@ #include "z_en_ani.h" #include "objects/object_ani/object_ani.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index 07a47e5bded..8b7cc4edd61 100644 --- a/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -10,6 +10,7 @@ #include "overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h" #include "vt.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c b/soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c index 0fd7a83e191..1fb194dcca5 100644 --- a/soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c +++ b/soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.c @@ -7,6 +7,7 @@ #include "z_en_attack_niw.h" #include "objects/object_niw/object_niw.h" #include "overlays/actors/ovl_En_Niw/z_en_niw.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 39c0e54e952..c85b553193a 100644 --- a/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -8,6 +8,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_Bb/object_Bb.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_PLAY_HIT_SFX) diff --git a/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 2f1c4abe4bd..ca210b62bc2 100644 --- a/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -1,6 +1,7 @@ #include "z_en_bigokuta.h" #include "objects/object_bigokuta/object_bigokuta.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c index a50dabe0107..f1edce83b9d 100644 --- a/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -7,6 +7,7 @@ #include "z_en_bili.h" #include "objects/object_bl/object_bl.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_ARROW_DRAGGABLE) diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 9e3c9c1b2f7..2cb1087039d 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -3,6 +3,8 @@ #include "overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h" #include "overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h" #include "objects/object_bg/object_bg.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c index 5e94f3fa89a..6c68b3831f6 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c @@ -2,6 +2,7 @@ #include "vt.h" #include "overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h" #include "overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Box/z_en_box.c b/soh/src/overlays/actors/ovl_En_Box/z_en_box.c index 6b822363d16..f3c7e86ffac 100644 --- a/soh/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/soh/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -3,6 +3,8 @@ #include "soh_assets.h" #include "soh/Enhancements/enhancementTypes.h" #include +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Brob/z_en_brob.c b/soh/src/overlays/actors/ovl_En_Brob/z_en_brob.c index a7d1b7a6c14..4d7243455e1 100644 --- a/soh/src/overlays/actors/ovl_En_Brob/z_en_brob.c +++ b/soh/src/overlays/actors/ovl_En_Brob/z_en_brob.c @@ -6,6 +6,7 @@ #include "z_en_brob.h" #include "objects/object_brob/object_brob.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c index 7dac97580a4..36cd8195d3b 100644 --- a/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Elf/z_en_elf.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/gameplay_field_keep/gameplay_field_keep.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 501c7ec9e6c..2dd6a7ae346 100644 --- a/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -8,6 +8,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_bw/object_bw.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c index c01ac30b556..512a9ce8058 100644 --- a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -6,6 +6,8 @@ #include "z_en_cow.h" #include "objects/object_cow/object_cow.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c index bb7236e045f..22f4857ecf4 100644 --- a/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -1,6 +1,7 @@ #include "z_en_crow.h" #include "objects/object_crow/object_crow.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_ARROW_DRAGGABLE) diff --git a/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c index 4c2f8dc143d..7ef4b5ca6b4 100644 --- a/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -1,6 +1,7 @@ #include "z_en_cs.h" #include "objects/object_cs/object_cs.h" #include "objects/object_link_child/object_link_child.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index 50ec1532e8e..be43c9194ce 100644 --- a/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -2,6 +2,7 @@ #include "overlays/actors/ovl_En_GeldB/z_en_geldb.h" #include "objects/object_daiku/object_daiku.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/soh/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index 6cc91e0c725..2aa2d563f36 100644 --- a/soh/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/soh/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -6,6 +6,7 @@ #include "z_en_daiku_kakariko.h" #include "objects/object_daiku/object_daiku.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index 2b4344f68ce..ec74e88b48f 100644 --- a/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -3,6 +3,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 79ed4433e85..22b2e5a06aa 100644 --- a/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -8,6 +8,7 @@ #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "objects/object_dekunuts/object_dekunuts.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c index 997d9aaa50a..456e7bd201b 100644 --- a/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -1,6 +1,7 @@ #include "z_en_dh.h" #include "objects/object_dh/object_dh.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAGGED_BY_HOOKSHOT) diff --git a/soh/src/overlays/actors/ovl_En_Dha/z_en_dha.c b/soh/src/overlays/actors/ovl_En_Dha/z_en_dha.c index da6f433885d..2b6b036b23b 100644 --- a/soh/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/soh/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -7,6 +7,7 @@ #include "z_en_dha.h" #include "overlays/actors/ovl_En_Dh/z_en_dh.h" #include "objects/object_dh/object_dh.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index a0ba0ad6692..40663941bbe 100644 --- a/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -8,6 +8,8 @@ #include "overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h" #include "objects/object_zo/object_zo.h" #include "vt.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c index d2d8963c376..75be32652c4 100644 --- a/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -8,6 +8,8 @@ #include "objects/object_shopnuts/object_shopnuts.h" #include "vt.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index 40a34073b0d..ef9228dc2fc 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -9,6 +9,7 @@ #include "overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h" #include "overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h" #include "vt.h" +#include "soh/OTRGlobals.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index 95dbb144a0d..aff1f146e09 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -9,6 +9,7 @@ #include "overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index 76dd0af70bb..1990abd45d8 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -12,6 +12,7 @@ #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "objects/object_hintnuts/object_hintnuts.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c b/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c index 96b18b372ae..f0f9ff7464b 100644 --- a/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "objects/object_dodojr/object_dodojr.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index 359477614b7..166e9398a5d 100644 --- a/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -3,6 +3,7 @@ #include "overlays/actors/ovl_En_Bombf/z_en_bombf.h" #include "objects/object_dodongo/object_dodongo.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c index b226d00f207..57979074945 100644 --- a/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -6,6 +6,7 @@ #include "z_en_dog.h" #include "objects/object_dog/object_dog.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Door/z_en_door.c b/soh/src/overlays/actors/ovl_En_Door/z_en_door.c index cbfd5f0188d..56f1f5b1ebb 100644 --- a/soh/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/soh/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -10,6 +10,7 @@ #include "objects/object_hidan_objects/object_hidan_objects.h" #include "objects/object_mizu_objects/object_mizu_objects.h" #include "objects/object_haka_door/object_haka_door.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 97cfac5f799..497ba938847 100644 --- a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -6,6 +6,9 @@ #include "z_en_ds.h" #include "objects/object_ds/object_ds.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c index beb86ee95c1..e2f3b24deb4 100644 --- a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -1,6 +1,7 @@ #include "z_en_du.h" #include "objects/object_du/object_du.h" #include "scenes/overworld/spot18/spot18_scene.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c b/soh/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c index 7018da6ca02..2ba1972e4d7 100644 --- a/soh/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c +++ b/soh/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.c @@ -7,6 +7,7 @@ #include "z_en_dy_extra.h" #include "objects/object_dy_obj/object_dy_obj.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index 7340d9cf5d6..6e764cedc6d 100644 --- a/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -1,6 +1,7 @@ #include "z_en_eiyer.h" #include "objects/object_ei/object_ei.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c index e5ac4f81f0f..d5d0877a717 100644 --- a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -7,6 +7,7 @@ #include "z_en_elf.h" #include "objects/gameplay_keep/gameplay_keep.h" #include +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index 65a030485f6..c85154c7f1f 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -8,6 +8,7 @@ #include "overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "vt.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c index 277ee851a93..ea55ad85589 100644 --- a/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -9,6 +9,7 @@ #include "objects/object_fw/object_fw.h" #include "soh/frame_interpolation.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_HOOKSHOT_DRAGS) diff --git a/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index 7797cba9ce5..5b23ce7eb57 100644 --- a/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -8,6 +8,7 @@ #include "objects/object_firefly/object_firefly.h" #include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_ARROW_DRAGGABLE) diff --git a/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.c index 766b15640e9..aa21e3ef141 100644 --- a/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -7,6 +7,7 @@ #include "z_en_fish.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 1a906e5b7e9..b09bf8f074a 100644 --- a/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -7,6 +7,7 @@ #include "z_en_floormas.h" #include "objects/object_wallmaster/object_wallmaster.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_DRAGGED_BY_HOOKSHOT) diff --git a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c index f1b2998079e..1a65cd579a6 100644 --- a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -4,6 +4,8 @@ #include "objects/object_fr/object_fr.h" #include #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 619ea0d2e8d..ab087b18291 100644 --- a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -7,6 +7,8 @@ #include "z_en_fu.h" #include "objects/object_fu/object_fu.h" #include "scenes/indoors/hakasitarelay/hakasitarelay_scene.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Fw/z_en_fw.c b/soh/src/overlays/actors/ovl_En_Fw/z_en_fw.c index 61f009e4781..d69582e6a57 100644 --- a/soh/src/overlays/actors/ovl_En_Fw/z_en_fw.c +++ b/soh/src/overlays/actors/ovl_En_Fw/z_en_fw.c @@ -9,6 +9,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "soh/frame_interpolation.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_HOOKSHOT_DRAGS) diff --git a/soh/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c b/soh/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c index 0fc08ba4aff..3c3b402954e 100644 --- a/soh/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c +++ b/soh/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c @@ -6,6 +6,8 @@ #include "z_en_ganon_mant.h" #include "overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c index 8fd732aeb6c..935e3dc400e 100644 --- a/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -7,6 +7,8 @@ #include "z_en_gb.h" #include "objects/object_ps/object_ps.h" #include "soh/frame_interpolation.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 1038a701425..235320ff461 100644 --- a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -8,6 +8,8 @@ #include "vt.h" #include "objects/object_ge1/object_ge1.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 3abbf7533d1..deb29c3a83e 100644 --- a/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -10,6 +10,8 @@ #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index eb3042dd37c..e2f037cdbcf 100644 --- a/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -6,6 +6,8 @@ #include "z_en_ge3.h" #include "objects/object_geldb/object_geldb.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 47b045e53c3..cd7c9207552 100644 --- a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -8,6 +8,7 @@ #include "objects/object_geldb/object_geldb.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 5ca4596723e..2a653edc9e7 100644 --- a/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -10,6 +10,8 @@ #include "vt.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c index c3d74e1c302..e538949b826 100644 --- a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -3,6 +3,8 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_oF1d_map/object_oF1d_map.h" #include "soh/frame_interpolation.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 3edec1ebeb2..a483de7d53e 100644 --- a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -3,6 +3,9 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_oF1d_map/object_oF1d_map.h" #include "soh/frame_interpolation.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c index 8ba162f77bf..0bb7409a3ec 100644 --- a/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -4,6 +4,7 @@ #include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Guest/z_en_guest.c b/soh/src/overlays/actors/ovl_En_Guest/z_en_guest.c index 2d09ea01674..e69e4e61024 100644 --- a/soh/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/soh/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -9,6 +9,7 @@ #include "objects/object_boj/object_boj.h" #include "vt.h" #include +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 837c0ec0fff..90d47b09814 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -7,6 +7,7 @@ #include "z_en_heishi1.h" #include "objects/object_sd/object_sd.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 9c37164a641..763f73df404 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -11,6 +11,7 @@ #include "overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index 1ac928e8142..755c687bf59 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -7,6 +7,7 @@ #include "z_en_heishi3.h" #include "objects/object_sd/object_sd.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index 981824bd277..b1463a8ea3b 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -1,6 +1,8 @@ #include "z_en_heishi4.h" #include "objects/object_sd/object_sd.h" #include "vt.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index e956457da1c..27daeff0c0a 100644 --- a/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -7,6 +7,7 @@ #include "z_en_hintnuts.h" #include "objects/object_hintnuts/object_hintnuts.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c index f816870a5ad..c5998ea367d 100644 --- a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -7,6 +7,9 @@ #include "z_en_hs.h" #include "vt.h" #include "objects/object_hs/object_hs.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c b/soh/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c index 3f8e61481a0..4b92328bda0 100644 --- a/soh/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c +++ b/soh/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c @@ -7,6 +7,7 @@ #include "z_en_hs2.h" #include "vt.h" #include "objects/object_hs/object_hs.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c index 4f4f3059106..0ac829898a0 100644 --- a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -14,6 +14,8 @@ #include "objects/object_cne/object_cne.h" #include "objects/object_cob/object_cob.h" #include "objects/object_os_anime/object_os_anime.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c index aebcc4dafb2..19c45987da6 100644 --- a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -9,6 +9,7 @@ #include "objects/object_ik/object_ik.h" #include "vt.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_In/z_en_in.c b/soh/src/overlays/actors/ovl_En_In/z_en_in.c index 0426d127bfb..7bfc68dbeac 100644 --- a/soh/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/soh/src/overlays/actors/ovl_En_In/z_en_in.c @@ -1,6 +1,7 @@ #include "z_en_in.h" #include "overlays/actors/ovl_En_Horse/z_en_horse.h" #include "objects/object_in/object_in.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) @@ -1007,4 +1008,4 @@ void EnIn_Draw(Actor* thisx, PlayState* play) { void EnIn_Reset(void) { D_80A7B998 = 0; -} \ No newline at end of file +} diff --git a/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c index c207a631060..74df5975634 100644 --- a/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -7,6 +7,7 @@ #include "z_en_insect.h" #include "vt.h" #include "objects/gameplay_keep/gameplay_keep.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index c79033250eb..55cd4001e53 100644 --- a/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -7,6 +7,7 @@ #include "z_en_ishi.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "objects/gameplay_field_keep/gameplay_field_keep.h" +#include "soh/OTRGlobals.h" #include "vt.h" diff --git a/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c b/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c index ba748df63d7..12863e4c6c3 100644 --- a/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c +++ b/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c @@ -7,6 +7,7 @@ #include "z_en_jj.h" #include "objects/object_jj/object_jj.h" #include "overlays/actors/ovl_Eff_Dust/z_eff_dust.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Js/z_en_js.c b/soh/src/overlays/actors/ovl_En_Js/z_en_js.c index ef6646bbdb7..8a31b85883d 100644 --- a/soh/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/soh/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -6,6 +6,8 @@ #include "z_en_js.h" #include "objects/object_js/object_js.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c b/soh/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c index 8af7f4d83b4..ffd428f21be 100644 --- a/soh/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c +++ b/soh/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.c @@ -6,6 +6,7 @@ #include "z_en_jsjutan.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index e8ce00c6a7f..efc324678af 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -7,6 +7,7 @@ #include "z_en_kakasi2.h" #include "vt.h" #include "objects/object_ka/object_ka.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" diff --git a/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index d78cf0820b0..0e36e476a00 100644 --- a/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -9,6 +9,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 58fc0635006..b0e26c90600 100644 --- a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -10,6 +10,9 @@ #include "objects/object_km1/object_km1.h" #include "objects/object_kw1/object_kw1.h" #include "vt.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c index 882bc3f5d64..d5f14c95953 100644 --- a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -6,6 +6,9 @@ #include "z_en_kz.h" #include "objects/object_kz/object_kz.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index bc164e0c7a9..e4ceacfb26d 100644 --- a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -6,6 +6,7 @@ #include "z_en_ma1.h" #include "objects/object_ma1/object_ma1.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c index 21b4c5f942e..bad7e9b527f 100644 --- a/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -7,6 +7,7 @@ #include "z_en_mag.h" #include "objects/object_mag/object_mag.h" #include +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c index b0aff37509b..979cc8d6836 100644 --- a/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -7,6 +7,7 @@ #include "z_en_mb.h" #include "objects/object_mb/object_mb.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" /* * This actor can have three behaviors: diff --git a/soh/src/overlays/actors/ovl_En_Md/z_en_md.c b/soh/src/overlays/actors/ovl_En_Md/z_en_md.c index d6264ee80e6..7902b1bb861 100644 --- a/soh/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/soh/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -7,6 +7,7 @@ #include "z_en_md.h" #include "objects/object_md/object_md.h" #include "overlays/actors/ovl_En_Elf/z_en_elf.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c index 81d62df5068..f5549f86ee5 100644 --- a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -6,6 +6,9 @@ #include "z_en_mk.h" #include "objects/object_mk/object_mk.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c index d1d495093b9..520d66f92aa 100644 --- a/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -7,6 +7,7 @@ #include "z_en_mm.h" #include "objects/object_mm/object_mm.h" #include "objects/object_link_child/object_link_child.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c index b1bbc09a5e6..32fffa9e26a 100644 --- a/soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -7,6 +7,7 @@ #include "z_en_mm2.h" #include "vt.h" #include "objects/object_mm/object_mm.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c index c2798dae7f7..89011a59c23 100644 --- a/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -6,6 +6,8 @@ #include "z_en_ms.h" #include "objects/object_ms/object_ms.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c index f5f66dbf639..ace23084e1d 100644 --- a/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -8,6 +8,7 @@ #include "vt.h" #include "objects/object_nb/object_nb.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 45433afd607..3d8fb45c3c4 100644 --- a/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -9,6 +9,7 @@ #include "overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h" #include "vt.h" #include "soh/frame_interpolation.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_ALWAYS_THROWN) diff --git a/soh/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/soh/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c index 5113b8a6894..27f076134de 100644 --- a/soh/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c +++ b/soh/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c @@ -7,6 +7,7 @@ #include "z_en_niw_girl.h" #include "objects/object_gr/object_gr.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index cbbce167ea2..63d4104dee2 100644 --- a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -3,6 +3,9 @@ #include "objects/object_os_anime/object_os_anime.h" #include "overlays/actors/ovl_En_Niw/z_en_niw.h" #include "vt.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index b205e61c527..b0d9ecda4ef 100644 --- a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -8,6 +8,7 @@ #include "scenes/misc/hakaana_ouke/hakaana_ouke_scene.h" #include "scenes/overworld/spot02/spot02_scene.h" #include "vt.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 54fc2d2fa21..9fda3ec83ab 100644 --- a/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -2,6 +2,7 @@ #include "objects/object_okuta/object_okuta.h" #include "objects/gameplay_field_keep/gameplay_field_keep.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 272245cbfc3..b821131e193 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -17,6 +17,7 @@ #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include +#include "soh/OTRGlobals.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c index fb03af25ca0..f5d981031c5 100644 --- a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -10,6 +10,8 @@ #include "scenes/overworld/spot16/spot16_scene.h" #include "vt.h" #include +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c b/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c index a1dd91e6fd7..c155052f17a 100644 --- a/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c +++ b/soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c @@ -11,6 +11,8 @@ #include #include #include +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_DRAGGED_BY_HOOKSHOT | ACTOR_FLAG_CAN_PRESS_SWITCH) diff --git a/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index 5526ad49c13..2084dc5e702 100644 --- a/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -3,6 +3,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_PLAY_HIT_SFX) diff --git a/soh/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c b/soh/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c index 2c00b284b79..a40ae376efe 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c +++ b/soh/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c @@ -6,6 +6,7 @@ #include "z_en_po_desert.h" #include "objects/object_po_field/object_po_field.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_LENS | ACTOR_FLAG_IGNORE_QUAKE) diff --git a/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index 33add9d1b92..e1bb232f866 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -8,6 +8,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_po_field/object_po_field.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #include diff --git a/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c index 8489b10326f..5bf2c6a8484 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c +++ b/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c @@ -7,6 +7,7 @@ #include "z_en_po_relay.h" #include "overlays/actors/ovl_En_Honotrap/z_en_honotrap.h" #include "objects/object_tk/object_tk.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_WILL_TALK) diff --git a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 13ace88998b..c667a67e1ec 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -9,6 +9,8 @@ #include "objects/object_po_sisters/object_po_sisters.h" #include "soh/frame_interpolation.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_HOOKSHOT_DRAGS | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_ARROW_DRAGGABLE) diff --git a/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c index 2c7e904160a..c1e4c28eb65 100644 --- a/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -8,6 +8,7 @@ #include "objects/object_poh/object_poh.h" #include "objects/object_po_composer/object_po_composer.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_IGNORE_QUAKE) diff --git a/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 8990f67ea6f..db65300d8ea 100644 --- a/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -1,6 +1,7 @@ #include "z_en_rd.h" #include "objects/object_rd/object_rd.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAGGED_BY_HOOKSHOT) diff --git a/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index 76e5ae87153..7a1293178f5 100644 --- a/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -10,6 +10,7 @@ #include "vt.h" #include "objects/object_reeba/object_reeba.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_LOCKON) diff --git a/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 8257df479bb..9b6e4601e4f 100644 --- a/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -7,6 +7,7 @@ #include "z_en_ru1.h" #include "objects/object_ru1/object_ru1.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_CAN_PRESS_SWITCH) diff --git a/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index ac777f7de35..162db0512d7 100644 --- a/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -8,6 +8,7 @@ #include "objects/object_ru2/object_ru2.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c index 664e29d1d25..ed09470a0fa 100644 --- a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -3,6 +3,8 @@ #include "objects/object_sa/object_sa.h" #include "scenes/overworld/spot04/spot04_scene.h" #include "scenes/overworld/spot05/spot05_scene.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c b/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c index c6aa6d56af8..e099480b574 100644 --- a/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c +++ b/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c @@ -1,5 +1,7 @@ #include "z_en_shopnuts.h" #include "objects/object_shopnuts/object_shopnuts.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c index 832e3c45d3e..246cbcd11c5 100644 --- a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -7,6 +7,7 @@ #include "z_en_si.h" #include "soh/Enhancements/custom-message/CustomMessageTypes.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOOKSHOT_DRAGS) diff --git a/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c index e985fe862ec..9fa3e25eeda 100644 --- a/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -2,6 +2,7 @@ #include "overlays/actors/ovl_En_Encount1/z_en_encount1.h" #include "objects/object_skb/object_skb.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c index c21465736cc..aa0df870eba 100644 --- a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -2,6 +2,8 @@ #include "overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h" #include "objects/object_skj/object_skj.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c b/soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c index fc814f915fd..e179324963a 100644 --- a/soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c +++ b/soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c @@ -1,5 +1,7 @@ #include "z_en_ssh.h" #include "objects/object_ssh/object_ssh.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_St/z_en_st.c b/soh/src/overlays/actors/ovl_En_St/z_en_st.c index 59d4be6f36c..a330cca946a 100644 --- a/soh/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/soh/src/overlays/actors/ovl_En_St/z_en_st.c @@ -7,6 +7,7 @@ #include "z_en_st.h" #include "objects/object_st/object_st.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c index c55af5cd477..c66f1d076fa 100644 --- a/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -10,6 +10,8 @@ #include "objects/object_boj/object_boj.h" #include #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c index caa07d1d661..212bec00f19 100644 --- a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -1,6 +1,7 @@ #include "z_en_sw.h" #include "objects/object_st/object_st.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index dcaaa897b1c..60955727b28 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -4,6 +4,8 @@ #include "objects/object_ossan/object_ossan.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/custom-message/CustomMessageTypes.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_LOCKON) diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index afe9ce537ba..41b4bdb5ff7 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -8,6 +8,7 @@ #include "objects/object_niw/object_niw.h" #include "vt.h" #include "soh/frame_interpolation.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c index 821ec3f9b07..6e04554d9a9 100644 --- a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -7,6 +7,8 @@ #include "z_en_ta.h" #include "vt.h" #include "objects/object_ta/object_ta.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c b/soh/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c index e15d481fd0b..3afae38cf87 100644 --- a/soh/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c +++ b/soh/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c @@ -7,6 +7,8 @@ #include "z_en_takara_man.h" #include "vt.h" #include "objects/object_ts/object_ts.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_NO_LOCKON) diff --git a/soh/src/overlays/actors/ovl_En_Test/z_en_test.c b/soh/src/overlays/actors/ovl_En_Test/z_en_test.c index 75c4f6c6a2f..931f8cd6206 100644 --- a/soh/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/soh/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -7,6 +7,7 @@ #include "z_en_test.h" #include "objects/object_sk2/object_sk2.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c index ba583c155ce..f87465fb818 100644 --- a/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -10,6 +10,7 @@ #include "vt.h" #include "objects/object_tite/object_tite.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 261e4892ce8..b26a00b9317 100644 --- a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -8,6 +8,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_tk/object_tk.h" #include "soh/frame_interpolation.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index ef53f4727c5..f0abb973f61 100644 --- a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -6,6 +6,9 @@ #include "z_en_toryo.h" #include "objects/object_toryo/object_toryo.h" +#include "soh/Enhancements/randomizer/adult_trade_shuffle.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Tr/z_en_tr.c b/soh/src/overlays/actors/ovl_En_Tr/z_en_tr.c index 6790f8b74a7..989a482448b 100644 --- a/soh/src/overlays/actors/ovl_En_Tr/z_en_tr.c +++ b/soh/src/overlays/actors/ovl_En_Tr/z_en_tr.c @@ -7,6 +7,7 @@ #include "z_en_tr.h" #include "objects/object_tr/object_tr.h" #include +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c index 11772cd905f..e6c62d961cb 100644 --- a/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -8,6 +8,7 @@ #include "objects/object_vali/object_vali.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_IGNORE_QUAKE) diff --git a/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c index ba0a7561341..68e7311c2cb 100644 --- a/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -9,6 +9,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 56950809d4f..8b7157e7806 100644 --- a/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -8,6 +8,7 @@ #include "objects/object_wallmaster/object_wallmaster.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index e3f19a3ed5b..3ed75bd4d1c 100644 --- a/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -7,6 +7,7 @@ #include "z_en_weiyer.h" #include "objects/object_ei/object_ei.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c index 2c243e25404..7681b499fcc 100644 --- a/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -9,6 +9,7 @@ #include "overlays/actors/ovl_En_Encount1/z_en_encount1.h" #include "objects/object_wf/object_wf.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c index 9a9c94e212c..546ec24f84c 100644 --- a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -13,6 +13,8 @@ #include "scenes/indoors/tokinoma/tokinoma_scene.h" #include "scenes/dungeons/ice_doukutu/ice_doukutu_scene.h" #include "vt.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c index 4ecf2afee9f..bdd603760d7 100644 --- a/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -7,6 +7,7 @@ #include "z_en_zf.h" #include "objects/object_zf/object_zf.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index af1d0dc7560..125b7351a7e 100644 --- a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -11,6 +11,7 @@ #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "objects/object_zl2/object_zl2.h" #include "objects/object_zl2_anime2/object_zl2_anime2.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index cdb88cc48c4..a50d647661a 100644 --- a/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -7,6 +7,8 @@ #include "z_en_zl4.h" #include "objects/object_zl4/object_zl4.h" #include "scenes/indoors/nakaniwa/nakaniwa_scene.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) diff --git a/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 57ac15ecf1a..09a12ec8cf9 100644 --- a/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -8,6 +8,7 @@ #include "objects/object_zo/object_zo.h" #include "soh/frame_interpolation.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c index 5f185b02d79..042ac0f7ca5 100644 --- a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -11,6 +11,7 @@ #include "vt.h" #include "soh/frame_interpolation.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c b/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c index 85a81af8573..9d3c9c240b9 100644 --- a/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c +++ b/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c @@ -6,6 +6,7 @@ #include "z_item_b_heart.h" #include "objects/object_gi_hearts/object_gi_hearts.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index 5aa223290fa..d2bbff4b78b 100644 --- a/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -6,6 +6,7 @@ #include "z_item_etcetera.h" #include +#include "soh/OTRGlobals.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index 7a16f2a7158..c1dd7f781f9 100644 --- a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -6,6 +6,7 @@ #include "z_item_ocarina.h" #include "scenes/overworld/spot00/spot00_scene.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c b/soh/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c index f785124f42b..46fdccaa681 100644 --- a/soh/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c +++ b/soh/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.c @@ -5,6 +5,7 @@ */ #include "z_magic_fire.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c b/soh/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c index ac7a3503676..3d8d0cff05f 100644 --- a/soh/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c +++ b/soh/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.c @@ -5,6 +5,7 @@ */ #include "z_magic_wind.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index 18c898547d4..59d1b620322 100644 --- a/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -8,6 +8,7 @@ #include "vt.h" #include "overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h" #include "objects/object_lightswitch/object_lightswitch.h" +#include "soh/OTRGlobals.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c b/soh/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c index 5b1eecbd49a..2be6ea478f0 100644 --- a/soh/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c +++ b/soh/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c @@ -5,6 +5,7 @@ */ #include "z_obj_mure2.h" +#include "soh/OTRGlobals.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index 026598ac923..78c39649ab1 100644 --- a/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -7,6 +7,7 @@ #include "z_obj_oshihiki.h" #include "overlays/actors/ovl_Obj_Switch/z_obj_switch.h" #include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED diff --git a/soh/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c b/soh/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c index 3869fa6e4f6..228e13d21be 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c +++ b/soh/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c @@ -5,6 +5,8 @@ */ #include "z_oceff_storm.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index dfc2362517d..052de7f0d3a 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -6,6 +6,7 @@ #include "z_oceff_wipe.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c index a6b42206283..a9eabca24b5 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -6,6 +6,7 @@ #include "z_oceff_wipe2.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c index 28f02100d44..e0ceadeb4ba 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -6,6 +6,7 @@ #include "z_oceff_wipe3.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c b/soh/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c index 6c96e639fc7..5a1cb54ce98 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c @@ -6,6 +6,7 @@ #include "z_oceff_wipe4.h" #include "vt.h" +#include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 28ef6e29de9..135c66e89a1 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -30,7 +30,8 @@ #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/Enhancements/randomizer/randomizer_grotto.h" #include "soh/frame_interpolation.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" #include #include diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 18c57d6ffc6..8d37ea58da4 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -22,6 +22,9 @@ #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include #include "z64save.h" +#include "soh/SaveManager.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" typedef struct { s16 left; diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c index 1ca66eb129b..89092e77cfc 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c @@ -1,5 +1,6 @@ #include "file_choose.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/SaveManager.h" // when choosing a file to copy or erase, the 6 main menu buttons are placed at these offsets static s16 sChooseFileYOffsets[] = { -48, -48, -48, -24, -24, 0 }; diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c index 6d73b00143a..fba1f4a7043 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c @@ -3,6 +3,9 @@ #include "assets/overlays/ovl_File_Choose/ovl_file_choose.h" #include "assets/soh_assets.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" +#include "soh/SaveManager.h" static s16 D_808124C0[] = { diff --git a/soh/src/overlays/gamestates/ovl_select/z_select.c b/soh/src/overlays/gamestates/ovl_select/z_select.c index 051aa3c007f..6d826dd619a 100644 --- a/soh/src/overlays/gamestates/ovl_select/z_select.c +++ b/soh/src/overlays/gamestates/ovl_select/z_select.c @@ -11,6 +11,8 @@ #include "soh/Enhancements/enhancementTypes.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/randomizer/randomizer_grotto.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" void Select_SwitchBetterWarpMode(SelectContext* this, u8 isBetterWarpMode); void Sram_InitDebugSave(void); diff --git a/soh/src/overlays/gamestates/ovl_title/z_title.c b/soh/src/overlays/gamestates/ovl_title/z_title.c index 5a3181a3625..23243a84ca4 100644 --- a/soh/src/overlays/gamestates/ovl_title/z_title.c +++ b/soh/src/overlays/gamestates/ovl_title/z_title.c @@ -13,6 +13,7 @@ #include #include #include +#include "soh/ResourceManagerHelpers.h" #include #include "time.h" diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index 105b59e03cf..91051f5f3ff 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -5,6 +5,7 @@ #include "soh/Enhancements/randomizer/randomizerTypes.h" #include "soh/Enhancements/enhancementTypes.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" +#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 903d781737e..217ec24e3fa 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -18,6 +18,9 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" +#include "soh/ResourceManagerHelpers.h" +#include "soh/SaveManager.h" #include "soh/Enhancements/kaleido.h" diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c index 0de1d117ad8..f884d5a2845 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark.c @@ -1,5 +1,6 @@ #include "z_kaleido_scope.h" #include "textures/parameter_static/parameter_static.h" +#include "soh/ResourceManagerHelpers.h" typedef struct { /* 0x00 */ void* texture;