diff --git a/OTRExporter/OTRExporter/AnimationExporter.cpp b/OTRExporter/OTRExporter/AnimationExporter.cpp index 74fa8a7e6..2d1039947 100644 --- a/OTRExporter/OTRExporter/AnimationExporter.cpp +++ b/OTRExporter/OTRExporter/AnimationExporter.cpp @@ -1,11 +1,11 @@ #include "AnimationExporter.h" -#include +#include void OTRExporter_Animation::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) { ZAnimation* anim = (ZAnimation*)res; - WriteHeader(res, outPath, writer, Ship::ResourceType::Animation); + WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Animation); ZNormalAnimation* normalAnim = dynamic_cast(anim); ZCurveAnimation* curveAnim = dynamic_cast(anim); diff --git a/OTRExporter/OTRExporter/AudioExporter.cpp b/OTRExporter/OTRExporter/AudioExporter.cpp index fb06708f1..f2fc75928 100644 --- a/OTRExporter/OTRExporter/AudioExporter.cpp +++ b/OTRExporter/OTRExporter/AudioExporter.cpp @@ -1,6 +1,5 @@ #include "AudioExporter.h" #include "Main.h" -#include #include #include #include @@ -30,7 +29,7 @@ void OTRExporter_Audio::WriteSampleEntryReference(ZAudio* audio, SampleEntry* en void OTRExporter_Audio::WriteSampleEntry(SampleEntry* entry, BinaryWriter* writer) { - WriteHeader(nullptr, "", writer, Ship::ResourceType::AudioSample, Ship::Version::Rachael); + WriteHeader(nullptr, "", writer, Ship::ResourceType::SOH_AudioSample, Ship::Version::Rachael); writer->Write(entry->codec); writer->Write(entry->medium); @@ -82,7 +81,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit { ZAudio* audio = (ZAudio*)res; - WriteHeader(res, outPath, writer, Ship::ResourceType::Audio, Ship::Version::Rachael); + WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Audio, Ship::Version::Rachael); // Write Samples as individual files for (auto pair : audio->samples) @@ -115,7 +114,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit MemoryStream* fntStream = new MemoryStream(); BinaryWriter fntWriter = BinaryWriter(fntStream); - WriteHeader(nullptr, "", &fntWriter, Ship::ResourceType::AudioSoundFont, Ship::Version::Rachael); + WriteHeader(nullptr, "", &fntWriter, Ship::ResourceType::SOH_AudioSoundFont, Ship::Version::Rachael); fntWriter.Write((uint32_t)i); fntWriter.Write(audio->soundFontTable[i].medium); @@ -174,7 +173,7 @@ void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWrit MemoryStream* seqStream = new MemoryStream(); BinaryWriter seqWriter = BinaryWriter(seqStream); - WriteHeader(nullptr, "", &seqWriter, Ship::ResourceType::AudioSequence, Ship::Version::Rachael); + WriteHeader(nullptr, "", &seqWriter, Ship::ResourceType::SOH_AudioSequence, Ship::Version::Rachael); seqWriter.Write((uint32_t)seq.size()); seqWriter.Write(seq.data(), seq.size()); diff --git a/OTRExporter/OTRExporter/BackgroundExporter.cpp b/OTRExporter/OTRExporter/BackgroundExporter.cpp index bf68255b7..ced388d43 100644 --- a/OTRExporter/OTRExporter/BackgroundExporter.cpp +++ b/OTRExporter/OTRExporter/BackgroundExporter.cpp @@ -4,6 +4,10 @@ void OTRExporter_Background::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) { ZBackground* bg = (ZBackground*)res; + + WriteHeader(bg, outPath, writer, Ship::ResourceType::SOH_Background); + + writer->Write((uint32_t)bg->GetRawDataSize()); auto data = bg->parent->GetRawData(); writer->Write((char*)data.data() + bg->GetRawDataIndex(), bg->GetRawDataSize()); diff --git a/OTRExporter/OTRExporter/CMakeLists.txt b/OTRExporter/OTRExporter/CMakeLists.txt index 60fb8343e..9d012af95 100644 --- a/OTRExporter/OTRExporter/CMakeLists.txt +++ b/OTRExporter/OTRExporter/CMakeLists.txt @@ -158,16 +158,19 @@ endif() target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../ZAPDTR/ZAPD/ - ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/ZAPDUtils - ${CMAKE_CURRENT_SOURCE_DIR}/../../ZAPDTR/lib/tinyxml2 - ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship + ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/include + # TODO: these should no longer be necessary if we were to link against LUS + ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src - ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src/resource - ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src/resource/types ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern - ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/spdlog/include - ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src/graphic/Fast3D/U64 + ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/Mercury + ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/tinyxml2 + ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/ZAPDUtils ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/StormLib/src + ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/spdlog/include + ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/nlohmann-json/include + ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src/resource + ${CMAKE_CURRENT_SOURCE_DIR}/../../soh/soh . ) diff --git a/OTRExporter/OTRExporter/CollisionExporter.cpp b/OTRExporter/OTRExporter/CollisionExporter.cpp index 02f20e674..21e4cc4c6 100644 --- a/OTRExporter/OTRExporter/CollisionExporter.cpp +++ b/OTRExporter/OTRExporter/CollisionExporter.cpp @@ -1,11 +1,11 @@ #include "CollisionExporter.h" -#include +#include void OTRExporter_Collision::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) { ZCollisionHeader* col = (ZCollisionHeader*)res; - WriteHeader(res, outPath, writer, Ship::ResourceType::CollisionHeader); + WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_CollisionHeader); writer->Write(col->absMinX); writer->Write(col->absMinY); diff --git a/OTRExporter/OTRExporter/CutsceneExporter.cpp b/OTRExporter/OTRExporter/CutsceneExporter.cpp index b52d73d8b..d08ff6c59 100644 --- a/OTRExporter/OTRExporter/CutsceneExporter.cpp +++ b/OTRExporter/OTRExporter/CutsceneExporter.cpp @@ -1,11 +1,11 @@ #include "CutsceneExporter.h" -#include +#include void OTRExporter_Cutscene::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) { ZCutscene* cs = (ZCutscene*)res; - WriteHeader(cs, outPath, writer, Ship::ResourceType::Cutscene); + WriteHeader(cs, outPath, writer, Ship::ResourceType::SOH_Cutscene); //writer->Write((uint32_t)cs->commands.size() + 2 + 2); writer->Write((uint32_t)0); diff --git a/OTRExporter/OTRExporter/DisplayListExporter.cpp b/OTRExporter/OTRExporter/DisplayListExporter.cpp index 9ed7a18c1..4bc5cd5bc 100644 --- a/OTRExporter/OTRExporter/DisplayListExporter.cpp +++ b/OTRExporter/OTRExporter/DisplayListExporter.cpp @@ -5,7 +5,7 @@ #include #include "StrHash64/StrHash64.h" #include "spdlog/spdlog.h" -#include "PR/ultra64/gbi.h" +#include #include #include #include diff --git a/OTRExporter/OTRExporter/Exporter.h b/OTRExporter/OTRExporter/Exporter.h index 103617ede..2f6f23916 100644 --- a/OTRExporter/OTRExporter/Exporter.h +++ b/OTRExporter/OTRExporter/Exporter.h @@ -3,7 +3,7 @@ #include "ZArray.h" //#include "OTRExporter.h" #include -#include +#include #include "VersionInfo.h" class OTRExporter : public ZResourceExporter diff --git a/OTRExporter/OTRExporter/Main.cpp b/OTRExporter/OTRExporter/Main.cpp index 011e8a94c..da7180b34 100644 --- a/OTRExporter/OTRExporter/Main.cpp +++ b/OTRExporter/OTRExporter/Main.cpp @@ -1,4 +1,4 @@ -#include +#include "Main.h" #include "BackgroundExporter.h" #include "TextureExporter.h" #include "RoomExporter.h" diff --git a/OTRExporter/OTRExporter/Main.h b/OTRExporter/OTRExporter/Main.h index df98bfe15..09485be36 100644 --- a/OTRExporter/OTRExporter/Main.h +++ b/OTRExporter/OTRExporter/Main.h @@ -1,6 +1,6 @@ #pragma once -#include +#include extern std::shared_ptr otrArchive; extern std::map> files; diff --git a/OTRExporter/OTRExporter/PathExporter.cpp b/OTRExporter/OTRExporter/PathExporter.cpp index 75f6b723f..e3f797d9c 100644 --- a/OTRExporter/OTRExporter/PathExporter.cpp +++ b/OTRExporter/OTRExporter/PathExporter.cpp @@ -5,7 +5,7 @@ void OTRExporter_Path::Save(ZResource* res, const fs::path& outPath, BinaryWrite { ZPath* path = (ZPath*)res; - WriteHeader(res, outPath, writer, Ship::ResourceType::Path); + WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Path); writer->Write((uint32_t)path->pathways.size()); diff --git a/OTRExporter/OTRExporter/PlayerAnimationExporter.cpp b/OTRExporter/OTRExporter/PlayerAnimationExporter.cpp index 9b65f199b..22d108c82 100644 --- a/OTRExporter/OTRExporter/PlayerAnimationExporter.cpp +++ b/OTRExporter/OTRExporter/PlayerAnimationExporter.cpp @@ -1,11 +1,11 @@ #include "PlayerAnimationExporter.h" -#include +#include void OTRExporter_PlayerAnimationExporter::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) { ZPlayerAnimationData* anim = (ZPlayerAnimationData*)res; - WriteHeader(res, outPath, writer, Ship::ResourceType::PlayerAnimation); + WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_PlayerAnimation); auto start = std::chrono::steady_clock::now(); diff --git a/OTRExporter/OTRExporter/RoomExporter.cpp b/OTRExporter/OTRExporter/RoomExporter.cpp index fe022a691..83bd3bbc6 100644 --- a/OTRExporter/OTRExporter/RoomExporter.cpp +++ b/OTRExporter/OTRExporter/RoomExporter.cpp @@ -23,7 +23,7 @@ #include #include "CollisionExporter.h" #include "DisplayListExporter.h" -#include "Resource.h" +#include #include #include #include @@ -39,7 +39,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite { ZRoom* room = (ZRoom*)res; - WriteHeader(res, outPath, writer, Ship::ResourceType::Room); + WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Room); writer->Write((uint32_t)room->commands.size()); diff --git a/OTRExporter/OTRExporter/SkeletonExporter.cpp b/OTRExporter/OTRExporter/SkeletonExporter.cpp index 3e0c58d06..f5e3ada80 100644 --- a/OTRExporter/OTRExporter/SkeletonExporter.cpp +++ b/OTRExporter/OTRExporter/SkeletonExporter.cpp @@ -1,5 +1,5 @@ #include "SkeletonExporter.h" -#include +#include #include #include "DisplayListExporter.h" @@ -7,7 +7,7 @@ void OTRExporter_Skeleton::Save(ZResource* res, const fs::path& outPath, BinaryW { ZSkeleton* skel = (ZSkeleton*)res; - WriteHeader(res, outPath, writer, Ship::ResourceType::Skeleton); + WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Skeleton); writer->Write((uint8_t)skel->type); writer->Write((uint8_t)skel->limbType); diff --git a/OTRExporter/OTRExporter/SkeletonLimbExporter.cpp b/OTRExporter/OTRExporter/SkeletonLimbExporter.cpp index e29c9a425..9b8742538 100644 --- a/OTRExporter/OTRExporter/SkeletonLimbExporter.cpp +++ b/OTRExporter/OTRExporter/SkeletonLimbExporter.cpp @@ -1,13 +1,13 @@ #include "SkeletonLimbExporter.h" #include "DisplayListExporter.h" -#include +#include #include void OTRExporter_SkeletonLimb::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) { ZLimb* limb = (ZLimb*)res; - WriteHeader(res, outPath, writer, Ship::ResourceType::SkeletonLimb); + WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_SkeletonLimb); writer->Write((uint8_t)limb->type); writer->Write((uint8_t)limb->skinSegmentType); diff --git a/OTRExporter/OTRExporter/TextExporter.cpp b/OTRExporter/OTRExporter/TextExporter.cpp index 5819b9b33..1e8c8da9d 100644 --- a/OTRExporter/OTRExporter/TextExporter.cpp +++ b/OTRExporter/OTRExporter/TextExporter.cpp @@ -5,7 +5,7 @@ void OTRExporter_Text::Save(ZResource* res, const fs::path& outPath, BinaryWrite { ZText* txt = (ZText*)res; - WriteHeader(txt, outPath, writer, Ship::ResourceType::Text); + WriteHeader(txt, outPath, writer, Ship::ResourceType::SOH_Text); writer->Write((uint32_t)txt->messages.size()); diff --git a/OTRExporter/OTRExporter/VersionInfo.cpp b/OTRExporter/OTRExporter/VersionInfo.cpp index ba0146d41..145aa86b9 100644 --- a/OTRExporter/OTRExporter/VersionInfo.cpp +++ b/OTRExporter/OTRExporter/VersionInfo.cpp @@ -1,27 +1,25 @@ #include "VersionInfo.h" -#include +#include std::map resourceVersions; void InitVersionInfo() { resourceVersions = std::map { - { Ship::ResourceType::Animation, 0 }, - { Ship::ResourceType::Model, 0 }, + { Ship::ResourceType::SOH_Animation, 0 }, { Ship::ResourceType::Texture, 0 }, - { Ship::ResourceType::Material, 0 }, - { Ship::ResourceType::PlayerAnimation, 0 }, + { Ship::ResourceType::SOH_PlayerAnimation, 0 }, { Ship::ResourceType::DisplayList, 0 }, - { Ship::ResourceType::Room, 0 }, - { Ship::ResourceType::CollisionHeader, 0 }, - { Ship::ResourceType::Skeleton, 0 }, - { Ship::ResourceType::SkeletonLimb, 0 }, + { Ship::ResourceType::SOH_Room, 0 }, + { Ship::ResourceType::SOH_CollisionHeader, 0 }, + { Ship::ResourceType::SOH_Skeleton, 0 }, + { Ship::ResourceType::SOH_SkeletonLimb, 0 }, { Ship::ResourceType::Matrix, 0 }, - { Ship::ResourceType::Path, 0 }, + { Ship::ResourceType::SOH_Path, 0 }, { Ship::ResourceType::Vertex, 0 }, - { Ship::ResourceType::Cutscene, 0 }, + { Ship::ResourceType::SOH_Cutscene, 0 }, { Ship::ResourceType::Array, 0 }, - { Ship::ResourceType::Text, 0 }, + { Ship::ResourceType::SOH_Text, 0 }, { Ship::ResourceType::Blob, 0 }, }; } diff --git a/OTRExporter/OTRExporter/VtxExporter.cpp b/OTRExporter/OTRExporter/VtxExporter.cpp index 10a13f424..5d8001d24 100644 --- a/OTRExporter/OTRExporter/VtxExporter.cpp +++ b/OTRExporter/OTRExporter/VtxExporter.cpp @@ -1,5 +1,5 @@ #include "VtxExporter.h" -#include "Resource.h" +#include #include "VersionInfo.h" diff --git a/OTRExporter/OTRExporter/z64cutscene.h b/OTRExporter/OTRExporter/z64cutscene.h index 4f44c1025..d5eb89482 100644 --- a/OTRExporter/OTRExporter/z64cutscene.h +++ b/OTRExporter/OTRExporter/z64cutscene.h @@ -2,7 +2,7 @@ #define Z64CUTSCENE_H #if 0 -#include "ultra64.h" +#include typedef struct { /* 0x00 */ u16 entrance; // entrance index upon which the cutscene should trigger diff --git a/ZAPDTR/ZAPD/CMakeLists.txt b/ZAPDTR/ZAPD/CMakeLists.txt index 93aaf7356..4b9110c32 100644 --- a/ZAPDTR/ZAPD/CMakeLists.txt +++ b/ZAPDTR/ZAPD/CMakeLists.txt @@ -336,6 +336,8 @@ find_package(PNG REQUIRED) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/ZAPDUtils + ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src/resource + ${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/include ${CMAKE_CURRENT_SOURCE_DIR}/../../ZAPDTR/lib/tinyxml2 ${CMAKE_CURRENT_SOURCE_DIR}/../../ZAPDTR/lib/libgfxd ${PNG_PNG_INCLUDE_DIR}/ diff --git a/ZAPDTR/ZAPD/ZResource.h b/ZAPDTR/ZAPD/ZResource.h index be272cf6b..59b074daf 100644 --- a/ZAPDTR/ZAPD/ZResource.h +++ b/ZAPDTR/ZAPD/ZResource.h @@ -7,8 +7,8 @@ #include #include #include "Declaration.h" -#include "Utils/BinaryWriter.h" -#include "Utils/Directory.h" +#include +#include #include "tinyxml2.h" #define SEGMENT_SCENE 2 diff --git a/libultraship b/libultraship index b1c75c86e..c5bab5aef 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit b1c75c86e902e5036ee1d36afad1a35313988fe7 +Subproject commit c5bab5aef8a9dd77047438718de64fb2e27eedfc diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 1994a2b99..b15e489ab 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -123,7 +123,7 @@ set(Header_Files__include #"include/stdbool_n64.h" #"include/stddef_n64.h" #"include/stdlib_n64.h" - "include/ultra64.h" + # "include/ultra64.h" "include/unk.h" "include/variables.h" "include/vt.h" @@ -288,6 +288,194 @@ set(Source_Files__soh ) source_group("Source Files\\soh" FILES ${Source_Files__soh}) +set(Header_Files__soh__resourceTypes + "soh/resource/type/Animation.h" + "soh/resource/type/AudioSample.h" + "soh/resource/type/AudioSequence.h" + "soh/resource/type/AudioSoundFont.h" + "soh/resource/type/CollisionHeader.h" + "soh/resource/type/Cutscene.h" + "soh/resource/type/Path.h" + "soh/resource/type/PlayerAnimation.h" + "soh/resource/type/Scene.h" + "soh/resource/type/Skeleton.h" + "soh/resource/type/SkeletonLimb.h" + "soh/resource/type/Text.h" + "soh/resource/type/Background.h" +) +source_group("Header Files\\soh\\resource\\type" FILES ${Header_Files__soh__resourceTypes}) + +set(Source_Files__soh__resourceTypes + "soh/resource/type/Animation.cpp" + "soh/resource/type/AudioSample.cpp" + "soh/resource/type/AudioSequence.cpp" + "soh/resource/type/AudioSoundFont.cpp" + "soh/resource/type/CollisionHeader.cpp" + "soh/resource/type/Cutscene.cpp" + "soh/resource/type/Path.cpp" + "soh/resource/type/PlayerAnimation.cpp" + "soh/resource/type/Scene.cpp" + "soh/resource/type/Skeleton.cpp" + "soh/resource/type/SkeletonLimb.cpp" + "soh/resource/type/Text.cpp" + "soh/resource/type/Background.cpp" +) +source_group("Source Files\\soh\\resource\\type" FILES ${Source_Files__soh__resourceTypes}) + +set(Header_Files__soh__resourceFactories + "soh/resource/importer/AnimationFactory.h" + "soh/resource/importer/AudioSampleFactory.h" + "soh/resource/importer/AudioSequenceFactory.h" + "soh/resource/importer/AudioSoundFontFactory.h" + "soh/resource/importer/CollisionHeaderFactory.h" + "soh/resource/importer/CutsceneFactory.h" + "soh/resource/importer/PathFactory.h" + "soh/resource/importer/PlayerAnimationFactory.h" + "soh/resource/importer/SceneFactory.h" + "soh/resource/importer/SkeletonFactory.h" + "soh/resource/importer/SkeletonLimbFactory.h" + "soh/resource/importer/TextFactory.h" + "soh/resource/importer/BackgroundFactory.h" +) +source_group("Header Files\\soh\\resource\\importer" FILES ${Header_Files__soh__resourceFactories}) + +set(Source_Files__soh__resourceFactories + "soh/resource/importer/AnimationFactory.cpp" + "soh/resource/importer/AudioSampleFactory.cpp" + "soh/resource/importer/AudioSequenceFactory.cpp" + "soh/resource/importer/AudioSoundFontFactory.cpp" + "soh/resource/importer/CollisionHeaderFactory.cpp" + "soh/resource/importer/CutsceneFactory.cpp" + "soh/resource/importer/PathFactory.cpp" + "soh/resource/importer/PlayerAnimationFactory.cpp" + "soh/resource/importer/SceneFactory.cpp" + "soh/resource/importer/SkeletonFactory.cpp" + "soh/resource/importer/SkeletonLimbFactory.cpp" + "soh/resource/importer/TextFactory.cpp" + "soh/resource/importer/BackgroundFactory.cpp" +) +source_group("Source Files\\soh\\resource\\importer" FILES ${Source_Files__soh__resourceFactories}) + +set(Header_Files__soh__scenecommandTypes + "soh/resource/type/scenecommand/EndMarker.h" + "soh/resource/type/scenecommand/RomFile.h" + "soh/resource/type/scenecommand/SceneCommand.h" + "soh/resource/type/scenecommand/SetActorList.h" + "soh/resource/type/scenecommand/SetAlternateHeaders.h" + "soh/resource/type/scenecommand/SetCameraSettings.h" + "soh/resource/type/scenecommand/SetCollisionHeader.h" + "soh/resource/type/scenecommand/SetCsCamera.h" + "soh/resource/type/scenecommand/SetCutscenes.h" + "soh/resource/type/scenecommand/SetEchoSettings.h" + "soh/resource/type/scenecommand/SetEntranceList.h" + "soh/resource/type/scenecommand/SetExitList.h" + "soh/resource/type/scenecommand/SetLightingSettings.h" + "soh/resource/type/scenecommand/SetLightList.h" + "soh/resource/type/scenecommand/SetMesh.h" + "soh/resource/type/scenecommand/SetObjectList.h" + "soh/resource/type/scenecommand/SetPathways.h" + "soh/resource/type/scenecommand/SetRoomBehavior.h" + "soh/resource/type/scenecommand/SetRoomList.h" + "soh/resource/type/scenecommand/SetSkyboxModifier.h" + "soh/resource/type/scenecommand/SetSkyboxSettings.h" + "soh/resource/type/scenecommand/SetSoundSettings.h" + "soh/resource/type/scenecommand/SetSpecialObjects.h" + "soh/resource/type/scenecommand/SetStartPositionList.h" + "soh/resource/type/scenecommand/SetTimeSettings.h" + "soh/resource/type/scenecommand/SetTransitionActorList.h" + "soh/resource/type/scenecommand/SetWindSettings.h" +) +source_group("Header Files\\soh\\resource\\type\\scenecommand" FILES ${Header_Files__soh__scenecommandTypes}) + +set(Source_Files__soh__scenecommandTypes + "soh/resource/type/scenecommand/EndMarker.cpp" + "soh/resource/type/scenecommand/SetActorList.cpp" + "soh/resource/type/scenecommand/SetAlternateHeaders.cpp" + "soh/resource/type/scenecommand/SetCameraSettings.cpp" + "soh/resource/type/scenecommand/SetCollisionHeader.cpp" + "soh/resource/type/scenecommand/SetCsCamera.cpp" + "soh/resource/type/scenecommand/SetCutscenes.cpp" + "soh/resource/type/scenecommand/SetEchoSettings.cpp" + "soh/resource/type/scenecommand/SetEntranceList.cpp" + "soh/resource/type/scenecommand/SetExitList.cpp" + "soh/resource/type/scenecommand/SetLightingSettings.cpp" + "soh/resource/type/scenecommand/SetLightList.cpp" + "soh/resource/type/scenecommand/SetMesh.cpp" + "soh/resource/type/scenecommand/SetObjectList.cpp" + "soh/resource/type/scenecommand/SetPathways.cpp" + "soh/resource/type/scenecommand/SetRoomBehavior.cpp" + "soh/resource/type/scenecommand/SetRoomList.cpp" + "soh/resource/type/scenecommand/SetSkyboxModifier.cpp" + "soh/resource/type/scenecommand/SetSkyboxSettings.cpp" + "soh/resource/type/scenecommand/SetSoundSettings.cpp" + "soh/resource/type/scenecommand/SetSpecialObjects.cpp" + "soh/resource/type/scenecommand/SetStartPositionList.cpp" + "soh/resource/type/scenecommand/SetTimeSettings.cpp" + "soh/resource/type/scenecommand/SetTransitionActorList.cpp" + "soh/resource/type/scenecommand/SetWindSettings.cpp" +) +source_group("Source Files\\soh\\resource\\type\\scenecommand" FILES ${Source_Files__soh__scenecommandTypes}) + +set(Header_Files__soh__scenecommandFactories + "soh/resource/importer/scenecommand/EndMarkerFactory.h" + "soh/resource/importer/scenecommand/SceneCommandFactory.h" + "soh/resource/importer/scenecommand/SetActorListFactory.h" + "soh/resource/importer/scenecommand/SetAlternateHeadersFactory.h" + "soh/resource/importer/scenecommand/SetCameraSettingsFactory.h" + "soh/resource/importer/scenecommand/SetCollisionHeaderFactory.h" + "soh/resource/importer/scenecommand/SetCsCameraFactory.h" + "soh/resource/importer/scenecommand/SetCutscenesFactory.h" + "soh/resource/importer/scenecommand/SetEchoSettingsFactory.h" + "soh/resource/importer/scenecommand/SetEntranceListFactory.h" + "soh/resource/importer/scenecommand/SetExitListFactory.h" + "soh/resource/importer/scenecommand/SetLightingSettingsFactory.h" + "soh/resource/importer/scenecommand/SetLightListFactory.h" + "soh/resource/importer/scenecommand/SetMeshFactory.h" + "soh/resource/importer/scenecommand/SetObjectListFactory.h" + "soh/resource/importer/scenecommand/SetPathwaysFactory.h" + "soh/resource/importer/scenecommand/SetRoomBehaviorFactory.h" + "soh/resource/importer/scenecommand/SetRoomListFactory.h" + "soh/resource/importer/scenecommand/SetSkyboxModifierFactory.h" + "soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.h" + "soh/resource/importer/scenecommand/SetSoundSettingsFactory.h" + "soh/resource/importer/scenecommand/SetSpecialObjectsFactory.h" + "soh/resource/importer/scenecommand/SetStartPositionListFactory.h" + "soh/resource/importer/scenecommand/SetTimeSettingsFactory.h" + "soh/resource/importer/scenecommand/SetTransitionActorListFactory.h" + "soh/resource/importer/scenecommand/SetWindSettingsFactory.h" +) +source_group("Header Files\\soh\\resource\\importer\\scenecommand" FILES ${Header_Files__soh__scenecommandFactories}) + +set(Source_Files__soh__scenecommandFactories + "soh/resource/importer/scenecommand/EndMarkerFactory.cpp" + "soh/resource/importer/scenecommand/SceneCommandFactory.cpp" + "soh/resource/importer/scenecommand/SetActorListFactory.cpp" + "soh/resource/importer/scenecommand/SetAlternateHeadersFactory.cpp" + "soh/resource/importer/scenecommand/SetCameraSettingsFactory.cpp" + "soh/resource/importer/scenecommand/SetCollisionHeaderFactory.cpp" + "soh/resource/importer/scenecommand/SetCsCameraFactory.cpp" + "soh/resource/importer/scenecommand/SetCutscenesFactory.cpp" + "soh/resource/importer/scenecommand/SetEchoSettingsFactory.cpp" + "soh/resource/importer/scenecommand/SetEntranceListFactory.cpp" + "soh/resource/importer/scenecommand/SetExitListFactory.cpp" + "soh/resource/importer/scenecommand/SetLightingSettingsFactory.cpp" + "soh/resource/importer/scenecommand/SetLightListFactory.cpp" + "soh/resource/importer/scenecommand/SetMeshFactory.cpp" + "soh/resource/importer/scenecommand/SetObjectListFactory.cpp" + "soh/resource/importer/scenecommand/SetPathwaysFactory.cpp" + "soh/resource/importer/scenecommand/SetRoomBehaviorFactory.cpp" + "soh/resource/importer/scenecommand/SetRoomListFactory.cpp" + "soh/resource/importer/scenecommand/SetSkyboxModifierFactory.cpp" + "soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.cpp" + "soh/resource/importer/scenecommand/SetSoundSettingsFactory.cpp" + "soh/resource/importer/scenecommand/SetSpecialObjectsFactory.cpp" + "soh/resource/importer/scenecommand/SetStartPositionListFactory.cpp" + "soh/resource/importer/scenecommand/SetTimeSettingsFactory.cpp" + "soh/resource/importer/scenecommand/SetTransitionActorListFactory.cpp" + "soh/resource/importer/scenecommand/SetWindSettingsFactory.cpp" +) +source_group("Source Files\\soh\\resource\\importer\\scenecommand" FILES ${Source_Files__soh__scenecommandFactories}) + set(Source_Files__soh__Enhancements "soh/Enhancements/bootcommands.c" "soh/Enhancements/debugconsole.cpp" @@ -1655,6 +1843,14 @@ set(ALL_FILES ${Source_Files__src__overlays__gamestates__ovl_title} ${Source_Files__src__overlays__misc__ovl_kaleido_scope} ${Source_Files__src__overlays__misc__ovl_map_mark_data} + ${Header_Files__soh__resourceTypes} + ${Source_Files__soh__resourceTypes} + ${Header_Files__soh__resourceFactories} + ${Source_Files__soh__resourceFactories} + ${Header_Files__soh__scenecommandTypes} + ${Source_Files__soh__scenecommandTypes} + ${Source_Files__soh__scenecommandFactories} + ${Header_Files__soh__scenecommandFactories} ) ################################################################################ @@ -1741,7 +1937,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE assets ${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/misc ${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/core ${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/resource - ${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/resource/types + ${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/resource/type ${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/audio ${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/extern ${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/extern/Mercury @@ -1752,6 +1948,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE assets ${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/graphic/Fast3D/U64/PR ${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/graphic ${CMAKE_CURRENT_SOURCE_DIR}/../ZAPDTR/ZAPDUtils + ${CMAKE_CURRENT_SOURCE_DIR}/../ZAPDTR/ZAPD/resource/type ${SDL2-INCLUDE} ${SDL2-NET-INCLUDE} ${CMAKE_CURRENT_SOURCE_DIR}/assets/ diff --git a/soh/include/fp.h b/soh/include/fp.h index c733be914..7ea6a7670 100644 --- a/soh/include/fp.h +++ b/soh/include/fp.h @@ -1,6 +1,6 @@ #ifndef FP_H #define FP_H -#include "ultra64.h" +#include extern f32 qNaN0x3FFFFF; extern f32 qNaN0x10000; diff --git a/soh/include/functions.h b/soh/include/functions.h index b077c59a3..7bf9028c6 100644 --- a/soh/include/functions.h +++ b/soh/include/functions.h @@ -2,6 +2,7 @@ #define FUNCTIONS_H #include "z64.h" +#include #ifdef __cplusplus #define this thisx @@ -97,8 +98,6 @@ void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, s3 void LogUtils_LogThreadId(const char* name, s32 line); void LogUtils_HungupThread(const char* name, s32 line); void LogUtils_ResetHungup(void); -s32 vsprintf(char* dst, const char* fmt, va_list args); -s32 sprintf(char* dst, const char* fmt, ...); void __osPiCreateAccessQueue(void); void __osPiGetAccess(void); void __osPiRelAccess(void); diff --git a/soh/include/global.h b/soh/include/global.h index dfef14f8a..3d989cacc 100644 --- a/soh/include/global.h +++ b/soh/include/global.h @@ -9,7 +9,7 @@ #include "soh/OTRGlobals.h" #include "soh/Enhancements/gameconsole.h" #include "soh/Enhancements/gameplaystats.h" -#include +#include #define _AudioseqSegmentRomStart "Audioseq" #define _AudiobankSegmentRomStart "Audiobank" @@ -38,4 +38,8 @@ #define _z_select_staticSegmentRomStart 0 #define _z_select_staticSegmentRomEnd 0 +// TODO: POSIX/BSD Bug, this is a hack to fix the build compilation on any BSD system (Switch, Wii-U, Vita, etc) +// defines quad as a macro, which conflicts with the quad parameter on z_collision_check.c +#undef quad + #endif diff --git a/soh/include/libc/math.h b/soh/include/libc/math.h index bceffad22..cad323823 100644 --- a/soh/include/libc/math.h +++ b/soh/include/libc/math.h @@ -1,7 +1,7 @@ #ifndef MATH_H #define MATH_H -#include "ultra64/types.h" +#include #define M_PI 3.14159265358979323846f #define M_SQRT2 1.41421356237309504880f diff --git a/soh/include/libc/stdlib.h b/soh/include/libc/stdlib.h index 00418278a..9028d104d 100644 --- a/soh/include/libc/stdlib.h +++ b/soh/include/libc/stdlib.h @@ -1,7 +1,7 @@ #ifndef STDLIB_H #define STDLIB_H -#include "ultra64.h" +#include #if 0 diff --git a/soh/include/macros.h b/soh/include/macros.h index 2d69b83ea..1641dc1ad 100644 --- a/soh/include/macros.h +++ b/soh/include/macros.h @@ -300,9 +300,9 @@ extern GraphicsContext* __gfxCtx; // #endregion // #region SOH [Enhancements] -#define CHECK_EQUIPMENT_AGE(i, j) (CVar_GetS32("gTimelessEquipment", 0) || (gEquipAgeReqs[i][j] == 9) || (gEquipAgeReqs[i][j] == ((void)0, gSaveContext.linkAge))) -#define CHECK_SLOT_AGE(slotIndex) (CVar_GetS32("gTimelessEquipment", 0) || (gSlotAgeReqs[slotIndex] == 9) || gSlotAgeReqs[slotIndex] == ((void)0, gSaveContext.linkAge)) -#define CHECK_ITEM_AGE(itemIndex) (CVar_GetS32("gTimelessEquipment", 0) || (gItemAgeReqs[itemIndex] == 9) || (gItemAgeReqs[itemIndex] == gSaveContext.linkAge)) +#define CHECK_EQUIPMENT_AGE(i, j) (CVarGetInteger("gTimelessEquipment", 0) || (gEquipAgeReqs[i][j] == 9) || (gEquipAgeReqs[i][j] == ((void)0, gSaveContext.linkAge))) +#define CHECK_SLOT_AGE(slotIndex) (CVarGetInteger("gTimelessEquipment", 0) || (gSlotAgeReqs[slotIndex] == 9) || gSlotAgeReqs[slotIndex] == ((void)0, gSaveContext.linkAge)) +#define CHECK_ITEM_AGE(itemIndex) (CVarGetInteger("gTimelessEquipment", 0) || (gItemAgeReqs[itemIndex] == 9) || (gItemAgeReqs[itemIndex] == gSaveContext.linkAge)) #define DPAD_ITEM(button) ((gSaveContext.buttonStatus[(button) + 5] != BTN_DISABLED) \ ? gSaveContext.equips.buttonItems[(button) + 4] \ diff --git a/soh/include/ultra64.h b/soh/include/ultra64.h deleted file mode 100644 index c2e0e9b29..000000000 --- a/soh/include/ultra64.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef ULTRA64_H -#define ULTRA64_H - -#include -#include -#include -#include "ultra64/types.h" -#include "unk.h" - -#include "libc/stdarg.h" -#include "libc/stdbool.h" -#include "libc/stddef.h" -#include "libc/stdlib.h" -#include "libc/math.h" - -#include "ultra64/exception.h" -#include "ultra64/rcp.h" -#include "ultra64/rdp.h" -#include "ultra64/rsp.h" -#include "ultra64/thread.h" -#include "ultra64/convert.h" -#include "ultra64/time.h" -#include "ultra64/message.h" -#include "ultra64/sptask.h" -#include "ultra64/gu.h" -#include "ultra64/vi.h" -#include "ultra64/pi.h" -#include "ultra64/controller.h" -#include "ultra64/printf.h" -#include "ultra64/mbi.h" -#include "ultra64/pfs.h" -#include "ultra64/motor.h" -#include "ultra64/r4300.h" - -#endif diff --git a/soh/include/z64.h b/soh/include/z64.h index a2efaf16a..7d548d69e 100644 --- a/soh/include/z64.h +++ b/soh/include/z64.h @@ -1,8 +1,8 @@ #ifndef Z64_H #define Z64_H -#include "ultra64.h" -#include "ultra64/gs2dex.h" +#include +#include "unk.h" // this used to get pulled in via ultra64.h #include "z64save.h" #include "z64light.h" #include "z64bgcheck.h" @@ -27,7 +27,7 @@ #include "alignment.h" #include "sequence.h" #include "sfx.h" -#include +#include #include "ichain.h" #include "regs.h" @@ -45,6 +45,7 @@ namespace Ship class Scene; class DisplayList; }; +#include #endif #define SCREEN_WIDTH 320 @@ -948,14 +949,6 @@ typedef struct { typedef struct { /* 0x00 */ Gfx* opa; /* 0x04 */ Gfx* xlu; - -#ifdef __cplusplus - Ship::DisplayList* opaDL; - Ship::DisplayList* xluDL; -#else -void* opaDL; -void* xluDL; -#endif } PolygonDlist; // size = 0x8 @@ -1016,14 +1009,6 @@ typedef struct { /* 0x06 */ s16 unk_06; /* 0x08 */ Gfx* opa; /* 0x0C */ Gfx* xlu; - -#ifdef __cplusplus - Ship::DisplayList* opaDL; - Ship::DisplayList* xluDL; -#else - void* opaDL; - void* xluDL; -#endif } PolygonDlist2; // size = 0x8 typedef struct { @@ -1087,12 +1072,7 @@ typedef struct { /* 0x58 */ OSMesgQueue loadQueue; /* 0x70 */ OSMesg loadMsg; /* 0x74 */ s16 unk_74[2]; // context-specific data used by the current scene draw config - -#ifdef __cplusplus - Ship::Scene* roomToLoad; -#else void* roomToLoad; -#endif } RoomContext; // size = 0x78 typedef struct { @@ -1310,13 +1290,7 @@ typedef struct PlayState { /* 0x000A4 */ s16 sceneNum; /* 0x000A6 */ u8 sceneConfig; /* 0x000A7 */ char unk_A7[0x9]; - -#ifdef __cplusplus - Ship::Scene* sceneSegment; -#else /* 0x000B0 */ void* sceneSegment; -#endif - /* 0x000B8 */ View view; /* 0x001E0 */ Camera mainCamera; /* 0x0034C */ Camera subCameras[NUM_CAMS - SUBCAM_FIRST]; diff --git a/soh/include/z64animation.h b/soh/include/z64animation.h index b0d8d40ef..e1ef1c073 100755 --- a/soh/include/z64animation.h +++ b/soh/include/z64animation.h @@ -1,7 +1,7 @@ #ifndef Z64_ANIMATION_H #define Z64_ANIMATION_H -#include "ultra64.h" +#include #include "z64dma.h" #include "z64math.h" diff --git a/soh/include/z64audio.h b/soh/include/z64audio.h index 2c0d41aad..0942772c4 100644 --- a/soh/include/z64audio.h +++ b/soh/include/z64audio.h @@ -127,7 +127,7 @@ typedef struct { typedef struct { /* 0x00 */ s32 order; /* 0x04 */ s32 npredictors; - /* 0x08 */ s16 book[]; // size 8 * order * npredictors. 8-byte aligned + /* 0x08 */ s16* book; // size 8 * order * npredictors. 8-byte aligned } AdpcmBook; // size >= 0x8 typedef struct @@ -137,7 +137,7 @@ typedef struct /* 0x00 */ u32 codec : 4; /* 0x00 */ u32 medium : 2; /* 0x00 */ u32 unk_bit26 : 1; - /* 0x00 */ u32 unk_bit25 : 1; + /* 0x00 */ u32 unk_bit25 : 1; // this has been named isRelocated in zret /* 0x01 */ u32 size : 24; }; u32 asU32; @@ -819,7 +819,7 @@ typedef struct { /* 0x0E */ u8 ttl; // duration after which the DMA can be discarded } SampleDma; // size = 0x10 -#include +#include typedef struct { /* 0x0000 */ char unk_0000; diff --git a/soh/include/z64camera.h b/soh/include/z64camera.h index 15ba1b0d9..cc873c2cf 100644 --- a/soh/include/z64camera.h +++ b/soh/include/z64camera.h @@ -1,7 +1,7 @@ #ifndef Z64CAMERA_H #define Z64CAMERA_H -#include "ultra64.h" +#include #include "z64cutscene.h" #define CAM_STAT_CUT 0 diff --git a/soh/include/z64cutscene.h b/soh/include/z64cutscene.h index 3794547b4..cea4e2fab 100644 --- a/soh/include/z64cutscene.h +++ b/soh/include/z64cutscene.h @@ -1,7 +1,7 @@ #ifndef Z64CUTSCENE_H #define Z64CUTSCENE_H -#include "ultra64.h" +#include typedef struct { /* 0x00 */ u16 entrance; // entrance index upon which the cutscene should trigger diff --git a/soh/include/z64dma.h b/soh/include/z64dma.h index df5703375..99a2d538a 100755 --- a/soh/include/z64dma.h +++ b/soh/include/z64dma.h @@ -1,7 +1,7 @@ #ifndef Z64_DMA_H #define Z64_DMA_H -#include "ultra64.h" +#include typedef struct { /* 0x00 */ uintptr_t vromAddr; // VROM address (source) diff --git a/soh/include/z64effect.h b/soh/include/z64effect.h index 973f149d8..d1d6b3329 100644 --- a/soh/include/z64effect.h +++ b/soh/include/z64effect.h @@ -1,7 +1,7 @@ #ifndef Z64EFFECT_H #define Z64EFFECT_H -#include +#include struct GraphicsContext; struct PlayState; diff --git a/soh/include/z64elf_message.h b/soh/include/z64elf_message.h index d6f545b3f..ed83bd048 100644 --- a/soh/include/z64elf_message.h +++ b/soh/include/z64elf_message.h @@ -1,7 +1,7 @@ #ifndef Z64ELF_MESSAGE_H #define Z64ELF_MESSAGE_H -#include "ultra64.h" +#include // Checks the condition and exits the script if the check passes #define ELF_MSG_TYPE_CHECK 0 diff --git a/soh/include/z64light.h b/soh/include/z64light.h index 3a4afd5fb..aa79f3c2a 100644 --- a/soh/include/z64light.h +++ b/soh/include/z64light.h @@ -1,10 +1,10 @@ #ifndef Z64LIGHT_H #define Z64LIGHT_H -#include "ultra64.h" -#include "ultra64/gbi.h" +#include +#include #include "z64math.h" -#include +#include typedef struct { /* 0x0 */ s16 x; diff --git a/soh/include/z64map_mark.h b/soh/include/z64map_mark.h index f44eea0d3..9f2a4272f 100644 --- a/soh/include/z64map_mark.h +++ b/soh/include/z64map_mark.h @@ -1,7 +1,7 @@ #ifndef Z64MAP_MARK_H #define Z64MAP_MARK_H -#include "ultra64.h" +#include #define MAP_MARK_NONE -1 #define MAP_MARK_CHEST 0 diff --git a/soh/include/z64math.h b/soh/include/z64math.h index 3e7813ada..9cffad73c 100644 --- a/soh/include/z64math.h +++ b/soh/include/z64math.h @@ -1,7 +1,8 @@ #ifndef Z64MATH_H #define Z64MATH_H -#include "ultra64.h" +#include +#include #define VEC_SET(V,X,Y,Z) (V).x=(X);(V).y=(Y);(V).z=(Z) diff --git a/soh/include/z64save.h b/soh/include/z64save.h index fa6df1cc7..f1dd4b2a0 100644 --- a/soh/include/z64save.h +++ b/soh/include/z64save.h @@ -1,7 +1,7 @@ #ifndef Z64SAVE_H #define Z64SAVE_H -#include "ultra64.h" +#include #include "z64math.h" #include "z64audio.h" #include "soh/Enhancements/randomizer/randomizerTypes.h" diff --git a/soh/include/z64transition.h b/soh/include/z64transition.h index 543afa23f..30b1246f5 100644 --- a/soh/include/z64transition.h +++ b/soh/include/z64transition.h @@ -1,8 +1,8 @@ #ifndef Z64TRANSITION_H #define Z64TRANSITION_H -#include "ultra64.h" -#include +#include +#include typedef struct { f32 unk_0; diff --git a/soh/soh/CrashHandlerExp.h b/soh/soh/CrashHandlerExp.h index aa820e463..fd57bba42 100644 --- a/soh/soh/CrashHandlerExp.h +++ b/soh/soh/CrashHandlerExp.h @@ -1,4 +1,4 @@ -#include +#include #ifdef __cplusplus @@ -9,4 +9,4 @@ void CrashHandler_PrintSohData(char* buffer, size_t* pos); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/soh/soh/Enhancements/bootcommands.c b/soh/soh/Enhancements/bootcommands.c index e81a810d1..9554b039d 100644 --- a/soh/soh/Enhancements/bootcommands.c +++ b/soh/soh/Enhancements/bootcommands.c @@ -2,15 +2,13 @@ #include "gameconsole.h" #include #include -#include +#include +#include #include #include #include #include #include -#include -#include -#include uint8_t gLoadFileSelect = 0, gSkipLogoTest = 0; @@ -22,12 +20,12 @@ static BootCommand sCommands[] = { { "--skiplogo", BootCommands_Command_SkipLogo void BootCommands_Init() { - CVar_RegisterS32("gDebugEnabled", 0); - CVar_RegisterS32("gLanguages", LANGUAGE_ENG); - CVar_RegisterS32("gInvertYAxis", 1); - CVar_SetS32("gRandoGenerating", 0); // Clear when a crash happened during rando seed generation + CVarRegisterInteger("gDebugEnabled", 0); + CVarRegisterInteger("gLanguages", LANGUAGE_ENG); + CVarRegisterInteger("gInvertYAxis", 1); + CVarSetInteger("gRandoGenerating", 0); // Clear when a crash happened during rando seed generation #if defined(__SWITCH__) || defined(__WIIU__) - CVar_RegisterS32("gControlNav", 1); // always enable controller nav on switch/wii u + CVarRegisterInteger("gControlNav", 1); // always enable controller nav on switch/wii u #endif } diff --git a/soh/soh/Enhancements/bootcommands.h b/soh/soh/Enhancements/bootcommands.h index 42877a499..fdf362e97 100644 --- a/soh/soh/Enhancements/bootcommands.h +++ b/soh/soh/Enhancements/bootcommands.h @@ -1,6 +1,6 @@ #ifndef _BOOTCOMMANDS_H_ #define _BOOTCOMMANDS_H_ -#include +#include #include typedef s32 (*BootCommandFunc)(char** argv, s32 argc); // Returns the number of arguments it read diff --git a/soh/soh/Enhancements/controls/GameControlEditor.cpp b/soh/soh/Enhancements/controls/GameControlEditor.cpp index 87f1826f8..6a2ce82de 100644 --- a/soh/soh/Enhancements/controls/GameControlEditor.cpp +++ b/soh/soh/Enhancements/controls/GameControlEditor.cpp @@ -8,8 +8,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -109,7 +109,7 @@ namespace GameControlEditor { // Draw a button mapping setting consisting of a padded label and button dropdown. // excludedButtons indicates which buttons are unavailable to choose from. void DrawMapping(CustomButtonMap& mapping, float labelWidth, N64ButtonMask excludedButtons) { - N64ButtonMask currentButton = CVar_GetS32(mapping.cVarName, mapping.defaultBtn); + N64ButtonMask currentButton = CVarGetInteger(mapping.cVarName, mapping.defaultBtn); const char* preview; if (buttonNames.contains(currentButton)) { @@ -134,7 +134,7 @@ namespace GameControlEditor { continue; } if (ImGui::Selectable(i->second, i->first == currentButton)) { - CVar_SetS32(mapping.cVarName, i->first); + CVarSetInteger(mapping.cVarName, i->first); } } ImGui::EndCombo(); @@ -158,11 +158,11 @@ namespace GameControlEditor { ImGui::SetCursorPos(ImVec2(cursor.x + 5, cursor.y + 5)); UIWidgets::EnhancementCheckbox("Customize Ocarina Controls", "gCustomOcarinaControls"); - if (CVar_GetS32("gCustomOcarinaControls", 0) == 1) { + if (CVarGetInteger("gCustomOcarinaControls", 0) == 1) { if (ImGui::BeginTable("tableCustomMainOcarinaControls", 2, ImGuiTableFlags_SizingStretchProp)) { float labelWidth; N64ButtonMask disableMask = BTN_B; - if (CVar_GetS32("gDpadOcarina", 0)) { + if (CVarGetInteger("gDpadOcarina", 0)) { disableMask |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT; } @@ -242,11 +242,11 @@ namespace GameControlEditor { UIWidgets::PaddedEnhancementCheckbox("Disable Auto-Centering in First-Person View", "gDisableAutoCenterViewFirstPerson"); DrawHelpIcon("Prevents the C-Up view from auto-centering, allowing for Gyro Aiming"); UIWidgets::PaddedEnhancementCheckbox("Enable Custom Aiming/First-Person sensitivity", "gEnableFirstPersonSensitivity", true, false); - if (CVar_GetS32("gEnableFirstPersonSensitivity", 0)) { + if (CVarGetInteger("gEnableFirstPersonSensitivity", 0)) { UIWidgets::EnhancementSliderFloat("Aiming/First-Person Sensitivity: %d %%", "##FirstPersonSensitivity", "gFirstPersonCameraSensitivity", 0.01f, 5.0f, "", 1.0f, true, true); } else { - CVar_SetFloat("gFirstPersonCameraSensitivity", 1.0f); + CVarSetFloat("gFirstPersonCameraSensitivity", 1.0f); } SohImGui::EndGroupPanel(); @@ -298,7 +298,7 @@ namespace GameControlEditor { SohImGui::BeginGroupPanel("Misc Controls", ImGui::GetContentRegionAvail()); UIWidgets::PaddedEnhancementCheckbox("Enable walk speed modifiers", "gEnableWalkModify", true, false); DrawHelpIcon("Hold the assigned button to change the maximum walking speed\nTo change the assigned button, go into the Ports tabs above"); - if (CVar_GetS32("gEnableWalkModify", 0)) { + if (CVarGetInteger("gEnableWalkModify", 0)) { UIWidgets::Spacer(5); SohImGui::BeginGroupPanel("Walk Modifier", ImGui::GetContentRegionAvail()); UIWidgets::PaddedEnhancementCheckbox("Toggle modifier instead of holding", "gWalkSpeedToggle", true, false); @@ -317,7 +317,7 @@ namespace GameControlEditor { void DrawUI(bool& open) { if (!open) { - CVar_SetS32("gGameControlEditorEnabled", false); + CVarSetInteger("gGameControlEditorEnabled", false); return; } diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp index a55dfd082..141f0da7e 100644 --- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp @@ -2,11 +2,11 @@ #include #include -#include +#include #include #include #include -#include +#include #include "soh/Enhancements/randomizer/3drando/random.hpp" #include "soh/UIWidgets.hpp" @@ -161,8 +161,8 @@ typedef struct { gDPSetEnvColor(POLY_OPA_DISP++, 80, 70, 20, alpha); // with cosmetics change - if (CVar_GetS32("gCosmetics.World_Moon.Changed", 0)) { - Color_RGB8 moonColor = CVar_GetRGB("gCosmetics.World_Moon.Value", (Color_RGB8){ 0, 0, 240 }); + if (CVarGetInteger("gCosmetics.World_Moon.Changed", 0)) { + Color_RGB8 moonColor = CVarGetColor24("gCosmetics.World_Moon.Value", (Color_RGB8){ 0, 0, 240 }); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, moonColor.r, moonColor.g, moonColor.b, alpha); gDPSetEnvColor(POLY_OPA_DISP++, moonColor.r / 2, moonColor.g / 2, moonColor.b / 2, alpha); } else { @@ -350,18 +350,18 @@ void SetMarginAll(const char* ButtonName, bool SetActivated) { std::string cvarName = MarginCvarList[s]; std::string cvarPosType = cvarName+"PosType"; std::string cvarNameMargins = cvarName+"UseMargins"; - if (CVar_GetS32(cvarPosType.c_str(),0) <= 2 && SetActivated) { //Our element is not Hidden or Non anchor + if (CVarGetInteger(cvarPosType.c_str(),0) <= 2 && SetActivated) { //Our element is not Hidden or Non anchor for(int i = 0; i < arrayLengthNonMargin; i++){ - if(MarginCvarNonAnchor[i] == cvarName && CVar_GetS32(cvarPosType.c_str(),0) == 0){ //Our element is both in original position and do not have anchor by default so we skip it. - CVar_SetS32(cvarNameMargins.c_str(), false); //force set off - } else if(MarginCvarNonAnchor[i] == cvarName && CVar_GetS32(cvarPosType.c_str(),0) != 0){ //Our element is not in original position regarless it has no anchor by default since player made it anchored we can toggle margins - CVar_SetS32(cvarNameMargins.c_str(), SetActivated); + if(MarginCvarNonAnchor[i] == cvarName && CVarGetInteger(cvarPosType.c_str(),0) == 0){ //Our element is both in original position and do not have anchor by default so we skip it. + CVarSetInteger(cvarNameMargins.c_str(), false); //force set off + } else if(MarginCvarNonAnchor[i] == cvarName && CVarGetInteger(cvarPosType.c_str(),0) != 0){ //Our element is not in original position regarless it has no anchor by default since player made it anchored we can toggle margins + CVarSetInteger(cvarNameMargins.c_str(), SetActivated); } else if(MarginCvarNonAnchor[i] != cvarName){ //Our elements has an anchor by default so regarless of it's position right now that okay to toggle margins. - CVar_SetS32(cvarNameMargins.c_str(), SetActivated); + CVarSetInteger(cvarNameMargins.c_str(), SetActivated); } } } else { //Since the user requested to turn all margin off no need to do any check there. - CVar_SetS32(cvarNameMargins.c_str(), SetActivated); + CVarSetInteger(cvarNameMargins.c_str(), SetActivated); } } } @@ -373,8 +373,8 @@ void ResetPositionAll() { std::string cvarName = MarginCvarList[s]; std::string cvarPosType = cvarName+"PosType"; std::string cvarNameMargins = cvarName+"UseMargins"; - CVar_SetS32(cvarPosType.c_str(), 0); - CVar_SetS32(cvarNameMargins.c_str(), false); //Turn margin off to everythings as that original position. + CVarSetInteger(cvarPosType.c_str(), 0); + CVarSetInteger(cvarNameMargins.c_str(), false); //Turn margin off to everythings as that original position. } } } @@ -385,8 +385,8 @@ int hue = 0; void CosmeticsUpdateTick(bool& open) { int index = 0; for (auto& [id, cosmeticOption] : cosmeticOptions) { - if (cosmeticOption.supportsRainbow && CVar_GetS32(cosmeticOption.rainbowCvar, 0)) { - float frequency = 2 * M_PI / (360 * CVar_GetFloat("gCosmetics.RainbowSpeed", 0.6f)); + if (cosmeticOption.supportsRainbow && CVarGetInteger(cosmeticOption.rainbowCvar, 0)) { + float frequency = 2 * M_PI / (360 * CVarGetFloat("gCosmetics.RainbowSpeed", 0.6f)); Color_RGBA8 newColor; newColor.r = sin(frequency * ((hue + index)) + 0) * 127 + 128; newColor.g = sin(frequency * ((hue + index)) + (2 * M_PI / 3)) * 127 + 128; @@ -398,13 +398,13 @@ void CosmeticsUpdateTick(bool& open) { cosmeticOption.currentColor.z = newColor.b / 255.0; cosmeticOption.currentColor.w = newColor.a / 255.0; - CVar_SetRGBA(cosmeticOption.cvar, newColor); + CVarSetColor(cosmeticOption.cvar, newColor); } // If we don't want the rainbow color on items to be synced, offset the index for each item in the loop. // Technically this would work if you replaced "60" with 1 but the hue would be so close it's // indistinguishable, 60 gives us a big enough gap to notice the difference. - if (!CVar_GetS32("gCosmetics.RainbowSync", 0)) { - index+= (60 * CVar_GetFloat("gCosmetics.RainbowSpeed", 0.6f)); + if (!CVarGetInteger("gCosmetics.RainbowSync", 0)) { + index+= (60 * CVarGetFloat("gCosmetics.RainbowSpeed", 0.6f)); } } ApplyOrResetCustomGfxPatches(false); @@ -423,180 +423,180 @@ void CosmeticsUpdateTick(bool& open) { */ void ApplyOrResetCustomGfxPatches(bool manualChange = true) { static CosmeticOption& linkGoronTunic = cosmeticOptions.at("Link_GoronTunic"); - if (manualChange || CVar_GetS32(linkGoronTunic.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(linkGoronTunic.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {linkGoronTunic.defaultColor.x, linkGoronTunic.defaultColor.y, linkGoronTunic.defaultColor.z, linkGoronTunic.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(linkGoronTunic.cvar, defaultColor); - PATCH_GFX(gGiGoronTunicColorDL, "Link_GoronTunic1", linkGoronTunic.changedCvar, 6, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiGoronCollarColorDL, "Link_GoronTunic2", linkGoronTunic.changedCvar, 6, gsDPSetPrimColor(0, 0, color.r / 2, color.g / 2, color.b / 2, 255)); - PATCH_GFX(gGiGoronTunicColorDL, "Link_GoronTunic3", linkGoronTunic.changedCvar, 8, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); - PATCH_GFX(gGiGoronCollarColorDL, "Link_GoronTunic4", linkGoronTunic.changedCvar, 8, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); + Color_RGBA8 color = CVarGetColor(linkGoronTunic.cvar, defaultColor); + PATCH_GFX(gGiGoronTunicColorDL, "Link_GoronTunic1", linkGoronTunic.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiGoronCollarColorDL, "Link_GoronTunic2", linkGoronTunic.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r / 2, color.g / 2, color.b / 2, 255)); + PATCH_GFX(gGiGoronTunicColorDL, "Link_GoronTunic3", linkGoronTunic.changedCvar, 4, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); + PATCH_GFX(gGiGoronCollarColorDL, "Link_GoronTunic4", linkGoronTunic.changedCvar, 4, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); } static CosmeticOption& linkZoraTunic = cosmeticOptions.at("Link_ZoraTunic"); - if (manualChange || CVar_GetS32(linkZoraTunic.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(linkZoraTunic.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {linkZoraTunic.defaultColor.x, linkZoraTunic.defaultColor.y, linkZoraTunic.defaultColor.z, linkZoraTunic.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(linkZoraTunic.cvar, defaultColor); - PATCH_GFX(gGiZoraTunicColorDL, "Link_ZoraTunic1", linkZoraTunic.changedCvar, 6, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiZoraCollarColorDL, "Link_ZoraTunic2", linkZoraTunic.changedCvar, 6, gsDPSetPrimColor(0, 0, color.r / 2, color.g / 2, color.b / 2, 255)); - PATCH_GFX(gGiZoraTunicColorDL, "Link_ZoraTunic3", linkZoraTunic.changedCvar, 8, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); - PATCH_GFX(gGiZoraCollarColorDL, "Link_ZoraTunic4", linkZoraTunic.changedCvar, 8, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); + Color_RGBA8 color = CVarGetColor(linkZoraTunic.cvar, defaultColor); + PATCH_GFX(gGiZoraTunicColorDL, "Link_ZoraTunic1", linkZoraTunic.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiZoraCollarColorDL, "Link_ZoraTunic2", linkZoraTunic.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r / 2, color.g / 2, color.b / 2, 255)); + PATCH_GFX(gGiZoraTunicColorDL, "Link_ZoraTunic3", linkZoraTunic.changedCvar, 4, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); + PATCH_GFX(gGiZoraCollarColorDL, "Link_ZoraTunic4", linkZoraTunic.changedCvar, 4, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); } static CosmeticOption& linkHair = cosmeticOptions.at("Link_Hair"); - if (manualChange || CVar_GetS32(linkHair.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(linkHair.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {linkHair.defaultColor.x, linkHair.defaultColor.y, linkHair.defaultColor.z, linkHair.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(linkHair.cvar, defaultColor); - PATCH_GFX(gLinkChildHeadNearDL, "Link_Hair1", linkHair.changedCvar, 20, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkChildHeadFarDL, "Link_Hair2", linkHair.changedCvar, 20, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultHeadNearDL, "Link_Hair3", linkHair.changedCvar, 20, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultHeadFarDL, "Link_Hair4", linkHair.changedCvar, 20, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(linkHair.cvar, defaultColor); + PATCH_GFX(gLinkChildHeadNearDL, "Link_Hair1", linkHair.changedCvar, 10, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkChildHeadFarDL, "Link_Hair2", linkHair.changedCvar, 10, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultHeadNearDL, "Link_Hair3", linkHair.changedCvar, 10, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultHeadFarDL, "Link_Hair4", linkHair.changedCvar, 10, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); if (manualChange) { - PATCH_GFX(gLinkChildHeadNearDL, "Link_Hair5", linkHair.changedCvar, 92, gsSPGrayscale(true)); - PATCH_GFX(gLinkChildHeadNearDL, "Link_Hair6", linkHair.changedCvar, 108, gsSPGrayscale(false)); - PATCH_GFX(gLinkChildHeadNearDL, "Link_Hair7", linkHair.changedCvar, 272, gsSPGrayscale(true)); - PATCH_GFX(gLinkChildHeadNearDL, "Link_Hair8", linkHair.changedCvar, 324, gsSPGrayscale(false)); - PATCH_GFX(gLinkChildHeadFarDL, "Link_Hair9", linkHair.changedCvar, 202, gsSPGrayscale(true)); - PATCH_GFX(gLinkChildHeadFarDL, "Link_Hair10", linkHair.changedCvar, 236, gsSPGrayscale(false)); - PATCH_GFX(gLinkAdultHeadNearDL, "Link_Hair11", linkHair.changedCvar, 250, gsSPGrayscale(true)); - PATCH_GFX(gLinkAdultHeadNearDL, "Link_Hair12", linkHair.changedCvar, 318, gsSPGrayscale(false)); - PATCH_GFX(gLinkAdultHeadFarDL, "Link_Hair13", linkHair.changedCvar, 204, gsSPGrayscale(true)); - PATCH_GFX(gLinkAdultHeadFarDL, "Link_Hair14", linkHair.changedCvar, 244, gsSPGrayscale(false)); + PATCH_GFX(gLinkChildHeadNearDL, "Link_Hair5", linkHair.changedCvar, 46, gsSPGrayscale(true)); + PATCH_GFX(gLinkChildHeadNearDL, "Link_Hair6", linkHair.changedCvar, 54, gsSPGrayscale(false)); + PATCH_GFX(gLinkChildHeadNearDL, "Link_Hair7", linkHair.changedCvar, 136, gsSPGrayscale(true)); + PATCH_GFX(gLinkChildHeadNearDL, "Link_Hair8", linkHair.changedCvar, 162, gsSPGrayscale(false)); + PATCH_GFX(gLinkChildHeadFarDL, "Link_Hair9", linkHair.changedCvar, 101, gsSPGrayscale(true)); + PATCH_GFX(gLinkChildHeadFarDL, "Link_Hair10", linkHair.changedCvar, 118, gsSPGrayscale(false)); + PATCH_GFX(gLinkAdultHeadNearDL, "Link_Hair11", linkHair.changedCvar, 125, gsSPGrayscale(true)); + PATCH_GFX(gLinkAdultHeadNearDL, "Link_Hair12", linkHair.changedCvar, 159, gsSPGrayscale(false)); + PATCH_GFX(gLinkAdultHeadFarDL, "Link_Hair13", linkHair.changedCvar, 102, gsSPGrayscale(true)); + PATCH_GFX(gLinkAdultHeadFarDL, "Link_Hair14", linkHair.changedCvar, 122, gsSPGrayscale(false)); } } static CosmeticOption& linkLinen = cosmeticOptions.at("Link_Linen"); - if (manualChange || CVar_GetS32(linkLinen.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(linkLinen.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {linkLinen.defaultColor.x, linkLinen.defaultColor.y, linkLinen.defaultColor.z, linkLinen.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(linkLinen.cvar, defaultColor); - PATCH_GFX(gLinkAdultLeftArmNearDL, "Link_Linen1", linkLinen.changedCvar, 60, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultLeftArmNearDL, "Link_Linen2", linkLinen.changedCvar, 166, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultLeftArmOutNearDL, "Link_Linen3", linkLinen.changedCvar, 50, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultLeftArmFarDL, "Link_Linen4", linkLinen.changedCvar, 60, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultLeftArmFarDL, "Link_Linen5", linkLinen.changedCvar, 140, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightArmFarDL, "Link_Linen6", linkLinen.changedCvar, 60, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightArmFarDL, "Link_Linen7", linkLinen.changedCvar, 140, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightArmNearDL, "Link_Linen8", linkLinen.changedCvar, 60, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultLeftShoulderFarDL, "Link_Linen9", linkLinen.changedCvar, 110, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultLeftShoulderNearDL, "Link_Linen10", linkLinen.changedCvar, 114, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightShoulderNearDL, "Link_Linen11", linkLinen.changedCvar, 114, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightShoulderFarDL, "Link_Linen12", linkLinen.changedCvar, 110, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultTorsoNearDL, "Link_Linen13", linkLinen.changedCvar, 132, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultTorsoFarDL, "Link_Linen14", linkLinen.changedCvar, 114, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightThighNearDL, "Link_Linen15", linkLinen.changedCvar, 106, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultLeftThighNearDL, "Link_Linen16", linkLinen.changedCvar, 106, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightThighFarDL, "Link_Linen17", linkLinen.changedCvar, 108, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultLeftThighFarDL, "Link_Linen18", linkLinen.changedCvar, 108, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightLegNearDL, "Link_Linen19", linkLinen.changedCvar, 60, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultLeftLegNearDL, "Link_Linen20", linkLinen.changedCvar, 60, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightLegFarDL, "Link_Linen21", linkLinen.changedCvar, 60, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultLeftLegFarDL, "Link_Linen22", linkLinen.changedCvar, 60, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(linkLinen.cvar, defaultColor); + PATCH_GFX(gLinkAdultLeftArmNearDL, "Link_Linen1", linkLinen.changedCvar, 30, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultLeftArmNearDL, "Link_Linen2", linkLinen.changedCvar, 83, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultLeftArmOutNearDL, "Link_Linen3", linkLinen.changedCvar, 25, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultLeftArmFarDL, "Link_Linen4", linkLinen.changedCvar, 30, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultLeftArmFarDL, "Link_Linen5", linkLinen.changedCvar, 70, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightArmFarDL, "Link_Linen6", linkLinen.changedCvar, 30, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightArmFarDL, "Link_Linen7", linkLinen.changedCvar, 70, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightArmNearDL, "Link_Linen8", linkLinen.changedCvar, 30, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultLeftShoulderFarDL, "Link_Linen9", linkLinen.changedCvar, 55, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultLeftShoulderNearDL, "Link_Linen10", linkLinen.changedCvar, 57, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightShoulderNearDL, "Link_Linen11", linkLinen.changedCvar, 57, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightShoulderFarDL, "Link_Linen12", linkLinen.changedCvar, 55, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultTorsoNearDL, "Link_Linen13", linkLinen.changedCvar, 66, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultTorsoFarDL, "Link_Linen14", linkLinen.changedCvar, 57, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightThighNearDL, "Link_Linen15", linkLinen.changedCvar, 53, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultLeftThighNearDL, "Link_Linen16", linkLinen.changedCvar, 53, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightThighFarDL, "Link_Linen17", linkLinen.changedCvar, 54, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultLeftThighFarDL, "Link_Linen18", linkLinen.changedCvar, 54, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightLegNearDL, "Link_Linen19", linkLinen.changedCvar, 30, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultLeftLegNearDL, "Link_Linen20", linkLinen.changedCvar, 30, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightLegFarDL, "Link_Linen21", linkLinen.changedCvar, 30, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultLeftLegFarDL, "Link_Linen22", linkLinen.changedCvar, 30, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); if (manualChange) { - PATCH_GFX(gLinkAdultLeftArmFarDL, "Link_Linen23", linkLinen.changedCvar, 70, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); - PATCH_GFX(gLinkAdultLeftArmOutNearDL, "Link_Linen24", linkLinen.changedCvar, 90, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); - PATCH_GFX(gLinkAdultLeftArmNearDL, "Link_Linen25", linkLinen.changedCvar, 80, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); - PATCH_GFX(gLinkAdultLeftArmFarDL, "Link_Linen26", linkLinen.changedCvar, 154, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); - PATCH_GFX(gLinkAdultRightArmFarDL, "Link_Linen27", linkLinen.changedCvar, 70, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); - PATCH_GFX(gLinkAdultRightArmFarDL, "Link_Linen28", linkLinen.changedCvar, 154, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); - PATCH_GFX(gLinkAdultRightArmNearDL, "Link_Linen29", linkLinen.changedCvar, 84, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); - PATCH_GFX(gLinkAdultRightLegNearDL, "Link_Linen30", linkLinen.changedCvar, 86, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); - PATCH_GFX(gLinkAdultLeftLegNearDL, "Link_Linen31", linkLinen.changedCvar, 86, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); - PATCH_GFX(gLinkAdultRightLegFarDL, "Link_Linen32", linkLinen.changedCvar, 76, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); - PATCH_GFX(gLinkAdultLeftLegFarDL, "Link_Linen33", linkLinen.changedCvar, 76, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); + PATCH_GFX(gLinkAdultLeftArmFarDL, "Link_Linen23", linkLinen.changedCvar, 35, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); + PATCH_GFX(gLinkAdultLeftArmOutNearDL, "Link_Linen24", linkLinen.changedCvar, 45, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); + PATCH_GFX(gLinkAdultLeftArmNearDL, "Link_Linen25", linkLinen.changedCvar, 40, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); + PATCH_GFX(gLinkAdultLeftArmFarDL, "Link_Linen26", linkLinen.changedCvar, 77, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); + PATCH_GFX(gLinkAdultRightArmFarDL, "Link_Linen27", linkLinen.changedCvar, 35, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); + PATCH_GFX(gLinkAdultRightArmFarDL, "Link_Linen28", linkLinen.changedCvar, 77, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); + PATCH_GFX(gLinkAdultRightArmNearDL, "Link_Linen29", linkLinen.changedCvar, 42, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); + PATCH_GFX(gLinkAdultRightLegNearDL, "Link_Linen30", linkLinen.changedCvar, 43, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); + PATCH_GFX(gLinkAdultLeftLegNearDL, "Link_Linen31", linkLinen.changedCvar, 43, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); + PATCH_GFX(gLinkAdultRightLegFarDL, "Link_Linen32", linkLinen.changedCvar, 38, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); + PATCH_GFX(gLinkAdultLeftLegFarDL, "Link_Linen33", linkLinen.changedCvar, 38, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)); } } static CosmeticOption& linkBoots = cosmeticOptions.at("Link_Boots"); - if (manualChange || CVar_GetS32(linkBoots.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(linkBoots.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {linkBoots.defaultColor.x, linkBoots.defaultColor.y, linkBoots.defaultColor.z, linkBoots.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(linkBoots.cvar, defaultColor); - PATCH_GFX(gLinkChildRightShinNearDL, "Link_Boots1", linkBoots.changedCvar, 20, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkChildRightShinFarDL, "Link_Boots2", linkBoots.changedCvar, 20, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightLegNearDL, "Link_Boots3", linkBoots.changedCvar, 20, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightLegFarDL, "Link_Boots4", linkBoots.changedCvar, 20, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(linkBoots.cvar, defaultColor); + PATCH_GFX(gLinkChildRightShinNearDL, "Link_Boots1", linkBoots.changedCvar, 10, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkChildRightShinFarDL, "Link_Boots2", linkBoots.changedCvar, 10, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightLegNearDL, "Link_Boots3", linkBoots.changedCvar, 10, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightLegFarDL, "Link_Boots4", linkBoots.changedCvar, 10, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); if (manualChange) { - PATCH_GFX(gLinkChildRightShinNearDL, "Link_Boots5", linkBoots.changedCvar, 106, gsSPGrayscale(true)); - PATCH_GFX(gLinkChildRightShinNearDL, "Link_Boots6", linkBoots.changedCvar, 138, gsSPGrayscale(false)); - PATCH_GFX(gLinkChildRightShinFarDL, "Link_Boots7", linkBoots.changedCvar, 104, gsSPGrayscale(true)); - PATCH_GFX(gLinkChildRightShinFarDL, "Link_Boots8", linkBoots.changedCvar, 122, gsSPGrayscale(false)); - PATCH_GFX(gLinkChildLeftShinNearDL, "Link_Boots9", linkBoots.changedCvar, 106, gsSPGrayscale(true)); - PATCH_GFX(gLinkChildLeftShinNearDL, "Link_Boots10", linkBoots.changedCvar, 138, gsSPGrayscale(false)); - PATCH_GFX(gLinkChildLeftShinFarDL, "Link_Boots11", linkBoots.changedCvar, 104, gsSPGrayscale(true)); - PATCH_GFX(gLinkChildLeftShinFarDL, "Link_Boots12", linkBoots.changedCvar, 122, gsSPGrayscale(false)); - PATCH_GFX(gLinkChildRightFootNearDL, "Link_Boots13", linkBoots.changedCvar, 60, gsSPGrayscale(true)); - PATCH_GFX(gLinkChildRightFootFarDL, "Link_Boots14", linkBoots.changedCvar, 60, gsSPGrayscale(true)); - PATCH_GFX(gLinkChildLeftFootNearDL, "Link_Boots15", linkBoots.changedCvar, 60, gsSPGrayscale(true)); - PATCH_GFX(gLinkChildLeftFootFarDL, "Link_Boots16", linkBoots.changedCvar, 60, gsSPGrayscale(true)); - PATCH_GFX(gLinkChildLeftThighNearDL, "Link_Boots17", linkBoots.changedCvar, 20, gsSPGrayscale(false)); - PATCH_GFX(gLinkChildLeftThighFarDL, "Link_Boots18", linkBoots.changedCvar, 20, gsSPGrayscale(false)); - PATCH_GFX(gLinkChildHeadNearDL, "Link_Boots19", linkBoots.changedCvar, 40, gsSPGrayscale(false)); - PATCH_GFX(gLinkChildHeadFarDL, "Link_Boots20", linkBoots.changedCvar, 40, gsSPGrayscale(false)); - PATCH_GFX(gLinkAdultRightLegNearDL, "Link_Boots21", linkBoots.changedCvar, 114, gsSPGrayscale(true)); - PATCH_GFX(gLinkAdultRightLegFarDL, "Link_Boots22", linkBoots.changedCvar, 104, gsSPGrayscale(true)); - PATCH_GFX(gLinkAdultLeftLegNearDL, "Link_Boots23", linkBoots.changedCvar, 114, gsSPGrayscale(true)); - PATCH_GFX(gLinkAdultLeftLegFarDL, "Link_Boots24", linkBoots.changedCvar, 104, gsSPGrayscale(true)); - PATCH_GFX(gLinkAdultLeftThighNearDL, "Link_Boots25", linkBoots.changedCvar, 20, gsSPGrayscale(false)); - PATCH_GFX(gLinkAdultLeftThighFarDL, "Link_Boots26", linkBoots.changedCvar, 20, gsSPGrayscale(false)); - PATCH_GFX(gLinkAdultHeadNearDL, "Link_Boots27", linkBoots.changedCvar, 40, gsSPGrayscale(false)); - PATCH_GFX(gLinkAdultHeadFarDL, "Link_Boots28", linkBoots.changedCvar, 40, gsSPGrayscale(false)); + PATCH_GFX(gLinkChildRightShinNearDL, "Link_Boots5", linkBoots.changedCvar, 53, gsSPGrayscale(true)); + PATCH_GFX(gLinkChildRightShinNearDL, "Link_Boots6", linkBoots.changedCvar, 69, gsSPGrayscale(false)); + PATCH_GFX(gLinkChildRightShinFarDL, "Link_Boots7", linkBoots.changedCvar, 52, gsSPGrayscale(true)); + PATCH_GFX(gLinkChildRightShinFarDL, "Link_Boots8", linkBoots.changedCvar, 61, gsSPGrayscale(false)); + PATCH_GFX(gLinkChildLeftShinNearDL, "Link_Boots9", linkBoots.changedCvar, 53, gsSPGrayscale(true)); + PATCH_GFX(gLinkChildLeftShinNearDL, "Link_Boots10", linkBoots.changedCvar, 69, gsSPGrayscale(false)); + PATCH_GFX(gLinkChildLeftShinFarDL, "Link_Boots11", linkBoots.changedCvar, 52, gsSPGrayscale(true)); + PATCH_GFX(gLinkChildLeftShinFarDL, "Link_Boots12", linkBoots.changedCvar, 61, gsSPGrayscale(false)); + PATCH_GFX(gLinkChildRightFootNearDL, "Link_Boots13", linkBoots.changedCvar, 30, gsSPGrayscale(true)); + PATCH_GFX(gLinkChildRightFootFarDL, "Link_Boots14", linkBoots.changedCvar, 30, gsSPGrayscale(true)); + PATCH_GFX(gLinkChildLeftFootNearDL, "Link_Boots15", linkBoots.changedCvar, 30, gsSPGrayscale(true)); + PATCH_GFX(gLinkChildLeftFootFarDL, "Link_Boots16", linkBoots.changedCvar, 30, gsSPGrayscale(true)); + PATCH_GFX(gLinkChildLeftThighNearDL, "Link_Boots17", linkBoots.changedCvar, 10, gsSPGrayscale(false)); + PATCH_GFX(gLinkChildLeftThighFarDL, "Link_Boots18", linkBoots.changedCvar, 10, gsSPGrayscale(false)); + PATCH_GFX(gLinkChildHeadNearDL, "Link_Boots19", linkBoots.changedCvar, 20, gsSPGrayscale(false)); + PATCH_GFX(gLinkChildHeadFarDL, "Link_Boots20", linkBoots.changedCvar, 20, gsSPGrayscale(false)); + PATCH_GFX(gLinkAdultRightLegNearDL, "Link_Boots21", linkBoots.changedCvar, 57, gsSPGrayscale(true)); + PATCH_GFX(gLinkAdultRightLegFarDL, "Link_Boots22", linkBoots.changedCvar, 52, gsSPGrayscale(true)); + PATCH_GFX(gLinkAdultLeftLegNearDL, "Link_Boots23", linkBoots.changedCvar, 57, gsSPGrayscale(true)); + PATCH_GFX(gLinkAdultLeftLegFarDL, "Link_Boots24", linkBoots.changedCvar, 52, gsSPGrayscale(true)); + PATCH_GFX(gLinkAdultLeftThighNearDL, "Link_Boots25", linkBoots.changedCvar, 10, gsSPGrayscale(false)); + PATCH_GFX(gLinkAdultLeftThighFarDL, "Link_Boots26", linkBoots.changedCvar, 10, gsSPGrayscale(false)); + PATCH_GFX(gLinkAdultHeadNearDL, "Link_Boots27", linkBoots.changedCvar, 20, gsSPGrayscale(false)); + PATCH_GFX(gLinkAdultHeadFarDL, "Link_Boots28", linkBoots.changedCvar, 20, gsSPGrayscale(false)); } } static CosmeticOption& mirrorShieldBody = cosmeticOptions.at("MirrorShield_Body"); - if (manualChange || CVar_GetS32(mirrorShieldBody.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(mirrorShieldBody.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {mirrorShieldBody.defaultColor.x, mirrorShieldBody.defaultColor.y, mirrorShieldBody.defaultColor.z, mirrorShieldBody.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(mirrorShieldBody.cvar, defaultColor); - PATCH_GFX(gGiMirrorShieldDL, "MirrorShield_Body1", mirrorShieldBody.changedCvar, 10, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiMirrorShieldDL, "MirrorShield_Body2", mirrorShieldBody.changedCvar, 12, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); - PATCH_GFX(gLinkAdultMirrorShieldSwordAndSheathNearDL, "MirrorShield_Body3", mirrorShieldBody.changedCvar, 56, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultMirrorShieldSwordAndSheathFarDL, "MirrorShield_Body4", mirrorShieldBody.changedCvar, 34, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultMirrorShieldAndSheathNearDL, "MirrorShield_Body5", mirrorShieldBody.changedCvar, 56, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultMirrorShieldAndSheathFarDL, "MirrorShield_Body6", mirrorShieldBody.changedCvar, 34, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightHandHoldingMirrorShieldNearDL, "MirrorShield_Body7", mirrorShieldBody.changedCvar, 56, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightHandHoldingMirrorShieldFarDL, "MirrorShield_Body8", mirrorShieldBody.changedCvar, 190, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(mirrorShieldBody.cvar, defaultColor); + PATCH_GFX(gGiMirrorShieldDL, "MirrorShield_Body1", mirrorShieldBody.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiMirrorShieldDL, "MirrorShield_Body2", mirrorShieldBody.changedCvar, 6, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + PATCH_GFX(gLinkAdultMirrorShieldSwordAndSheathNearDL, "MirrorShield_Body3", mirrorShieldBody.changedCvar, 28, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultMirrorShieldSwordAndSheathFarDL, "MirrorShield_Body4", mirrorShieldBody.changedCvar, 17, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultMirrorShieldAndSheathNearDL, "MirrorShield_Body5", mirrorShieldBody.changedCvar, 28, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultMirrorShieldAndSheathFarDL, "MirrorShield_Body6", mirrorShieldBody.changedCvar, 17, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightHandHoldingMirrorShieldNearDL, "MirrorShield_Body7", mirrorShieldBody.changedCvar, 28, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightHandHoldingMirrorShieldFarDL, "MirrorShield_Body8", mirrorShieldBody.changedCvar, 95, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } static CosmeticOption& mirrorShieldMirror = cosmeticOptions.at("MirrorShield_Mirror"); - if (manualChange || CVar_GetS32(mirrorShieldMirror.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(mirrorShieldMirror.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {mirrorShieldMirror.defaultColor.x, mirrorShieldMirror.defaultColor.y, mirrorShieldMirror.defaultColor.z, mirrorShieldMirror.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(mirrorShieldMirror.cvar, defaultColor); - PATCH_GFX(gGiMirrorShieldDL, "MirrorShield_Mirror1", mirrorShieldMirror.changedCvar, 94, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiMirrorShieldDL, "MirrorShield_Mirror2", mirrorShieldMirror.changedCvar, 96, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); - PATCH_GFX(gLinkAdultMirrorShieldSwordAndSheathNearDL, "MirrorShield_Mirror3", mirrorShieldMirror.changedCvar, 34, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultMirrorShieldSwordAndSheathFarDL, "MirrorShield_Mirror4", mirrorShieldMirror.changedCvar, 66, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultMirrorShieldAndSheathNearDL, "MirrorShield_Mirror5", mirrorShieldMirror.changedCvar, 34, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultMirrorShieldAndSheathFarDL, "MirrorShield_Mirror6", mirrorShieldMirror.changedCvar, 66, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightHandHoldingMirrorShieldNearDL, "MirrorShield_Mirror7", mirrorShieldMirror.changedCvar, 34, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightHandHoldingMirrorShieldFarDL, "MirrorShield_Mirror8", mirrorShieldMirror.changedCvar, 222, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(mirrorShieldMirror.cvar, defaultColor); + PATCH_GFX(gGiMirrorShieldDL, "MirrorShield_Mirror1", mirrorShieldMirror.changedCvar, 47, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiMirrorShieldDL, "MirrorShield_Mirror2", mirrorShieldMirror.changedCvar, 48, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + PATCH_GFX(gLinkAdultMirrorShieldSwordAndSheathNearDL, "MirrorShield_Mirror3", mirrorShieldMirror.changedCvar, 17, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultMirrorShieldSwordAndSheathFarDL, "MirrorShield_Mirror4", mirrorShieldMirror.changedCvar, 33, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultMirrorShieldAndSheathNearDL, "MirrorShield_Mirror5", mirrorShieldMirror.changedCvar, 17, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultMirrorShieldAndSheathFarDL, "MirrorShield_Mirror6", mirrorShieldMirror.changedCvar, 33, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightHandHoldingMirrorShieldNearDL, "MirrorShield_Mirror7", mirrorShieldMirror.changedCvar, 17, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightHandHoldingMirrorShieldFarDL, "MirrorShield_Mirror8", mirrorShieldMirror.changedCvar, 111, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } static CosmeticOption& mirrorShieldEmblem = cosmeticOptions.at("MirrorShield_Emblem"); - if (manualChange || CVar_GetS32(mirrorShieldEmblem.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(mirrorShieldEmblem.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {mirrorShieldEmblem.defaultColor.x, mirrorShieldEmblem.defaultColor.y, mirrorShieldEmblem.defaultColor.z, mirrorShieldEmblem.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(mirrorShieldEmblem.cvar, defaultColor); - PATCH_GFX(gGiMirrorShieldSymbolDL, "MirrorShield_Emblem1", mirrorShieldEmblem.changedCvar, 10, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 140)); - PATCH_GFX(gGiMirrorShieldSymbolDL, "MirrorShield_Emblem2", mirrorShieldEmblem.changedCvar, 12, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); - PATCH_GFX(gLinkAdultMirrorShieldSwordAndSheathNearDL, "MirrorShield_Emblem3", mirrorShieldEmblem.changedCvar, 330, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultMirrorShieldSwordAndSheathFarDL, "MirrorShield_Emblem4", mirrorShieldEmblem.changedCvar, 270, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultMirrorShieldAndSheathNearDL, "MirrorShield_Emblem5", mirrorShieldEmblem.changedCvar, 258, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultMirrorShieldAndSheathFarDL, "MirrorShield_Emblem6", mirrorShieldEmblem.changedCvar, 206, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightHandHoldingMirrorShieldNearDL, "MirrorShield_Emblem7", mirrorShieldEmblem.changedCvar, 324, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightHandHoldingMirrorShieldFarDL, "MirrorShield_Emblem8", mirrorShieldEmblem.changedCvar, 266, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(mirrorShieldEmblem.cvar, defaultColor); + PATCH_GFX(gGiMirrorShieldSymbolDL, "MirrorShield_Emblem1", mirrorShieldEmblem.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 140)); + PATCH_GFX(gGiMirrorShieldSymbolDL, "MirrorShield_Emblem2", mirrorShieldEmblem.changedCvar, 6, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + PATCH_GFX(gLinkAdultMirrorShieldSwordAndSheathNearDL, "MirrorShield_Emblem3", mirrorShieldEmblem.changedCvar, 165, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultMirrorShieldSwordAndSheathFarDL, "MirrorShield_Emblem4", mirrorShieldEmblem.changedCvar, 135, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultMirrorShieldAndSheathNearDL, "MirrorShield_Emblem5", mirrorShieldEmblem.changedCvar, 129, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultMirrorShieldAndSheathFarDL, "MirrorShield_Emblem6", mirrorShieldEmblem.changedCvar, 103, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightHandHoldingMirrorShieldNearDL, "MirrorShield_Emblem7", mirrorShieldEmblem.changedCvar, 162, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightHandHoldingMirrorShieldFarDL, "MirrorShield_Emblem8", mirrorShieldEmblem.changedCvar, 133, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } static CosmeticOption& swordsKokiriBlade = cosmeticOptions.at("Swords_KokiriBlade"); - if (manualChange || CVar_GetS32(swordsKokiriBlade.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(swordsKokiriBlade.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {swordsKokiriBlade.defaultColor.x, swordsKokiriBlade.defaultColor.y, swordsKokiriBlade.defaultColor.z, swordsKokiriBlade.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(swordsKokiriBlade.cvar, defaultColor); - PATCH_GFX(gLinkChildLeftFistAndKokiriSwordNearDL, "Swords_KokiriBlade1", swordsKokiriBlade.changedCvar, 158, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkChildLeftFistAndKokiriSwordFarDL, "Swords_KokiriBlade2", swordsKokiriBlade.changedCvar, 150, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiKokiriSwordDL, "Swords_KokiriBlade3", swordsKokiriBlade.changedCvar, 10, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiKokiriSwordDL, "Swords_KokiriBlade4", swordsKokiriBlade.changedCvar, 12, gsDPSetEnvColor(color.r / 4, color.g / 4, color.b / 4, 255)); + Color_RGBA8 color = CVarGetColor(swordsKokiriBlade.cvar, defaultColor); + PATCH_GFX(gLinkChildLeftFistAndKokiriSwordNearDL, "Swords_KokiriBlade1", swordsKokiriBlade.changedCvar, 79, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkChildLeftFistAndKokiriSwordFarDL, "Swords_KokiriBlade2", swordsKokiriBlade.changedCvar, 75, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiKokiriSwordDL, "Swords_KokiriBlade3", swordsKokiriBlade.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiKokiriSwordDL, "Swords_KokiriBlade4", swordsKokiriBlade.changedCvar, 6, gsDPSetEnvColor(color.r / 4, color.g / 4, color.b / 4, 255)); } // static CosmeticOption& swordsKokiriHilt = cosmeticOptions.at("Swords_KokiriHilt"); - // if (manualChange || CVar_GetS32(swordsKokiriHilt.rainbowCvar, 0)) { + // if (manualChange || CVarGetInteger(swordsKokiriHilt.rainbowCvar, 0)) { // static Color_RGBA8 defaultColor = {swordsKokiriHilt.defaultColor.x, swordsKokiriHilt.defaultColor.y, swordsKokiriHilt.defaultColor.z, swordsKokiriHilt.defaultColor.w}; - // Color_RGBA8 color = CVar_GetRGBA(swordsKokiriHilt.cvar, defaultColor); + // Color_RGBA8 color = CVarGetColor(swordsKokiriHilt.cvar, defaultColor); // PATCH_GFX(gLinkChildLeftFistAndKokiriSwordNearDL, "Swords_KokiriHilt1", swordsKokiriHilt.changedCvar, 4, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); // PATCH_GFX(gLinkChildLeftFistAndKokiriSwordFarDL, "Swords_KokiriHilt2", swordsKokiriHilt.changedCvar, 4, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); // PATCH_GFX(gLinkChildSwordAndSheathNearDL, "Swords_KokiriHilt3", swordsKokiriHilt.changedCvar, 4, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); @@ -635,20 +635,20 @@ void ApplyOrResetCustomGfxPatches(bool manualChange = true) { // } // } static CosmeticOption& swordsMasterBlade = cosmeticOptions.at("Swords_MasterBlade"); - if (manualChange || CVar_GetS32(swordsMasterBlade.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(swordsMasterBlade.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {swordsMasterBlade.defaultColor.x, swordsMasterBlade.defaultColor.y, swordsMasterBlade.defaultColor.z, swordsMasterBlade.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(swordsMasterBlade.cvar, defaultColor); - PATCH_GFX(gLinkAdultLeftHandHoldingMasterSwordFarDL, "Swords_MasterBlade1", swordsMasterBlade.changedCvar, 120, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultLeftHandHoldingMasterSwordNearDL, "Swords_MasterBlade2", swordsMasterBlade.changedCvar, 34, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(object_toki_objects_DL_001BD0, "Swords_MasterBlade3", swordsMasterBlade.changedCvar, 26, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(object_toki_objects_DL_001BD0, "Swords_MasterBlade4", swordsMasterBlade.changedCvar, 28, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); - PATCH_GFX(ovl_Boss_Ganon2_DL_0103A8, "Swords_MasterBlade5", swordsMasterBlade.changedCvar, 26, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(ovl_Boss_Ganon2_DL_0103A8, "Swords_MasterBlade6", swordsMasterBlade.changedCvar, 28, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); + Color_RGBA8 color = CVarGetColor(swordsMasterBlade.cvar, defaultColor); + PATCH_GFX(gLinkAdultLeftHandHoldingMasterSwordFarDL, "Swords_MasterBlade1", swordsMasterBlade.changedCvar, 60, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultLeftHandHoldingMasterSwordNearDL, "Swords_MasterBlade2", swordsMasterBlade.changedCvar, 17, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(object_toki_objects_DL_001BD0, "Swords_MasterBlade3", swordsMasterBlade.changedCvar, 13, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(object_toki_objects_DL_001BD0, "Swords_MasterBlade4", swordsMasterBlade.changedCvar, 14, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); + PATCH_GFX(ovl_Boss_Ganon2_DL_0103A8, "Swords_MasterBlade5", swordsMasterBlade.changedCvar, 13, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(ovl_Boss_Ganon2_DL_0103A8, "Swords_MasterBlade6", swordsMasterBlade.changedCvar, 14, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); } // static CosmeticOption& swordsMasterHilt = cosmeticOptions.at("Swords_MasterHilt"); - // if (manualChange || CVar_GetS32(swordsMasterHilt.rainbowCvar, 0)) { + // if (manualChange || CVarGetInteger(swordsMasterHilt.rainbowCvar, 0)) { // static Color_RGBA8 defaultColor = {swordsMasterHilt.defaultColor.x, swordsMasterHilt.defaultColor.y, swordsMasterHilt.defaultColor.z, swordsMasterHilt.defaultColor.w}; - // Color_RGBA8 color = CVar_GetRGBA(swordsMasterHilt.cvar, defaultColor); + // Color_RGBA8 color = CVarGetColor(swordsMasterHilt.cvar, defaultColor); // PATCH_GFX(gLinkAdultLeftHandHoldingMasterSwordNearDL, "Swords_MasterHilt1", swordsMasterHilt.changedCvar, 20, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); // PATCH_GFX(gLinkAdultLeftHandHoldingMasterSwordFarDL, "Swords_MasterHilt2", swordsMasterHilt.changedCvar, 20, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); // PATCH_GFX(object_toki_objects_DL_001BD0, "Swords_MasterHilt3", swordsMasterHilt.changedCvar, 16, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); @@ -693,18 +693,18 @@ void ApplyOrResetCustomGfxPatches(bool manualChange = true) { // } // } static CosmeticOption& swordsBiggoronBlade = cosmeticOptions.at("Swords_BiggoronBlade"); - if (manualChange || CVar_GetS32(swordsBiggoronBlade.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(swordsBiggoronBlade.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {swordsBiggoronBlade.defaultColor.x, swordsBiggoronBlade.defaultColor.y, swordsBiggoronBlade.defaultColor.z, swordsBiggoronBlade.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(swordsBiggoronBlade.cvar, defaultColor); - PATCH_GFX(gLinkAdultLeftHandHoldingBgsFarDL, "Swords_BiggoronBlade1", swordsBiggoronBlade.changedCvar, 216, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultLeftHandHoldingBgsNearDL, "Swords_BiggoronBlade2", swordsBiggoronBlade.changedCvar, 126, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiBiggoronSwordDL, "Swords_BiggoronBlade3", swordsBiggoronBlade.changedCvar, 10, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiBiggoronSwordDL, "Swords_BiggoronBlade4", swordsBiggoronBlade.changedCvar, 12, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + Color_RGBA8 color = CVarGetColor(swordsBiggoronBlade.cvar, defaultColor); + PATCH_GFX(gLinkAdultLeftHandHoldingBgsFarDL, "Swords_BiggoronBlade1", swordsBiggoronBlade.changedCvar, 108, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultLeftHandHoldingBgsNearDL, "Swords_BiggoronBlade2", swordsBiggoronBlade.changedCvar, 63, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiBiggoronSwordDL, "Swords_BiggoronBlade3", swordsBiggoronBlade.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiBiggoronSwordDL, "Swords_BiggoronBlade4", swordsBiggoronBlade.changedCvar, 6, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); } // static CosmeticOption& swordsBiggoronHilt = cosmeticOptions.at("Swords_BiggoronHilt"); - // if (manualChange || CVar_GetS32(swordsBiggoronHilt.rainbowCvar, 0)) { + // if (manualChange || CVarGetInteger(swordsBiggoronHilt.rainbowCvar, 0)) { // static Color_RGBA8 defaultColor = {swordsBiggoronHilt.defaultColor.x, swordsBiggoronHilt.defaultColor.y, swordsBiggoronHilt.defaultColor.z, swordsBiggoronHilt.defaultColor.w}; - // Color_RGBA8 color = CVar_GetRGBA(swordsBiggoronHilt.cvar, defaultColor); + // Color_RGBA8 color = CVarGetColor(swordsBiggoronHilt.cvar, defaultColor); // PATCH_GFX(gLinkAdultLeftHandHoldingBgsNearDL, "Swords_BiggoronHilt1", swordsBiggoronHilt.changedCvar, 20, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); // PATCH_GFX(gLinkAdultLeftHandHoldingBgsFarDL, "Swords_BiggoronHilt2", swordsBiggoronHilt.changedCvar, 20, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); // PATCH_GFX(gGiBiggoronSwordDL, "Swords_BiggoronHilt3", swordsBiggoronHilt.changedCvar, 74, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); @@ -722,70 +722,70 @@ void ApplyOrResetCustomGfxPatches(bool manualChange = true) { // } static CosmeticOption& glovesGoronBracelet = cosmeticOptions.at("Gloves_GoronBracelet"); - if (manualChange || CVar_GetS32(glovesGoronBracelet.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(glovesGoronBracelet.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {glovesGoronBracelet.defaultColor.x, glovesGoronBracelet.defaultColor.y, glovesGoronBracelet.defaultColor.z, glovesGoronBracelet.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(glovesGoronBracelet.cvar, defaultColor); - PATCH_GFX(gGiGoronBraceletDL, "Gloves_GoronBracelet1", glovesGoronBracelet.changedCvar, 10, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiGoronBraceletDL, "Gloves_GoronBracelet2", glovesGoronBracelet.changedCvar, 12, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); - PATCH_GFX(gLinkChildGoronBraceletDL, "Gloves_GoronBracelet3", glovesGoronBracelet.changedCvar, 6, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(glovesGoronBracelet.cvar, defaultColor); + PATCH_GFX(gGiGoronBraceletDL, "Gloves_GoronBracelet1", glovesGoronBracelet.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiGoronBraceletDL, "Gloves_GoronBracelet2", glovesGoronBracelet.changedCvar, 6, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + PATCH_GFX(gLinkChildGoronBraceletDL, "Gloves_GoronBracelet3", glovesGoronBracelet.changedCvar, 3, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); if (manualChange) { - PATCH_GFX(gLinkChildGoronBraceletDL, "Gloves_GoronBracelet4", glovesGoronBracelet.changedCvar, 22, gsSPGrayscale(true)); - PATCH_GFX(gLinkChildGoronBraceletDL, "Gloves_GoronBracelet5", glovesGoronBracelet.changedCvar, 78, gsSPGrayscale(false)); + PATCH_GFX(gLinkChildGoronBraceletDL, "Gloves_GoronBracelet4", glovesGoronBracelet.changedCvar, 11, gsSPGrayscale(true)); + PATCH_GFX(gLinkChildGoronBraceletDL, "Gloves_GoronBracelet5", glovesGoronBracelet.changedCvar, 39, gsSPGrayscale(false)); } } static CosmeticOption& glovesSilverGauntlets = cosmeticOptions.at("Gloves_SilverGauntlets"); - if (manualChange || CVar_GetS32(glovesSilverGauntlets.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(glovesSilverGauntlets.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {glovesSilverGauntlets.defaultColor.x, glovesSilverGauntlets.defaultColor.y, glovesSilverGauntlets.defaultColor.z, glovesSilverGauntlets.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(glovesSilverGauntlets.cvar, defaultColor); - PATCH_GFX(gGiSilverGauntletsColorDL, "Gloves_SilverGauntlets1", glovesSilverGauntlets.changedCvar, 6, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiSilverGauntletsColorDL, "Gloves_SilverGauntlets2", glovesSilverGauntlets.changedCvar, 8, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + Color_RGBA8 color = CVarGetColor(glovesSilverGauntlets.cvar, defaultColor); + PATCH_GFX(gGiSilverGauntletsColorDL, "Gloves_SilverGauntlets1", glovesSilverGauntlets.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiSilverGauntletsColorDL, "Gloves_SilverGauntlets2", glovesSilverGauntlets.changedCvar, 4, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); } static CosmeticOption& glovesGoldenGauntlets = cosmeticOptions.at("Gloves_GoldenGauntlets"); - if (manualChange || CVar_GetS32(glovesGoldenGauntlets.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(glovesGoldenGauntlets.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {glovesGoldenGauntlets.defaultColor.x, glovesGoldenGauntlets.defaultColor.y, glovesGoldenGauntlets.defaultColor.z, glovesGoldenGauntlets.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(glovesGoldenGauntlets.cvar, defaultColor); - PATCH_GFX(gGiGoldenGauntletsColorDL, "Gloves_GoldenGauntlets1", glovesGoldenGauntlets.changedCvar, 6, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiGoldenGauntletsColorDL, "Gloves_GoldenGauntlets2", glovesGoldenGauntlets.changedCvar, 8, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + Color_RGBA8 color = CVarGetColor(glovesGoldenGauntlets.cvar, defaultColor); + PATCH_GFX(gGiGoldenGauntletsColorDL, "Gloves_GoldenGauntlets1", glovesGoldenGauntlets.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiGoldenGauntletsColorDL, "Gloves_GoldenGauntlets2", glovesGoldenGauntlets.changedCvar, 4, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); } static CosmeticOption& glovesGauntletsGem = cosmeticOptions.at("Gloves_GauntletsGem"); - if (manualChange || CVar_GetS32(glovesGauntletsGem.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(glovesGauntletsGem.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {glovesGauntletsGem.defaultColor.x, glovesGauntletsGem.defaultColor.y, glovesGauntletsGem.defaultColor.z, glovesGauntletsGem.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(glovesGauntletsGem.cvar, defaultColor); - PATCH_GFX(gGiGauntletsDL, "Gloves_GauntletsGem1", glovesGauntletsGem.changedCvar, 168, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiGauntletsDL, "Gloves_GauntletsGem2", glovesGauntletsGem.changedCvar, 170, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); - PATCH_GFX(gLinkAdultLeftGauntletPlate2DL, "Gloves_GauntletsGem3", glovesGauntletsGem.changedCvar, 84, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightGauntletPlate2DL, "Gloves_GauntletsGem4", glovesGauntletsGem.changedCvar, 84, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultLeftGauntletPlate3DL, "Gloves_GauntletsGem5", glovesGauntletsGem.changedCvar, 84, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightGauntletPlate3DL, "Gloves_GauntletsGem6", glovesGauntletsGem.changedCvar, 84, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(glovesGauntletsGem.cvar, defaultColor); + PATCH_GFX(gGiGauntletsDL, "Gloves_GauntletsGem1", glovesGauntletsGem.changedCvar, 84, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiGauntletsDL, "Gloves_GauntletsGem2", glovesGauntletsGem.changedCvar, 85, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + PATCH_GFX(gLinkAdultLeftGauntletPlate2DL, "Gloves_GauntletsGem3", glovesGauntletsGem.changedCvar, 42, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightGauntletPlate2DL, "Gloves_GauntletsGem4", glovesGauntletsGem.changedCvar, 42, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultLeftGauntletPlate3DL, "Gloves_GauntletsGem5", glovesGauntletsGem.changedCvar, 42, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightGauntletPlate3DL, "Gloves_GauntletsGem6", glovesGauntletsGem.changedCvar, 42, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } static CosmeticOption& equipmentBoomerangBody = cosmeticOptions.at("Equipment_BoomerangBody"); - if (manualChange || CVar_GetS32(equipmentBoomerangBody.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(equipmentBoomerangBody.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {equipmentBoomerangBody.defaultColor.x, equipmentBoomerangBody.defaultColor.y, equipmentBoomerangBody.defaultColor.z, equipmentBoomerangBody.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(equipmentBoomerangBody.cvar, defaultColor); - PATCH_GFX(gGiBoomerangDL, "Equipment_BoomerangBody1", equipmentBoomerangBody.changedCvar, 10, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiBoomerangDL, "Equipment_BoomerangBody2", equipmentBoomerangBody.changedCvar, 12, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); - PATCH_GFX(gLinkChildLeftFistAndBoomerangNearDL, "Equipment_BoomerangBody3", equipmentBoomerangBody.changedCvar, 68, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkChildLeftFistAndBoomerangFarDL, "Equipment_BoomerangBody4", equipmentBoomerangBody.changedCvar, 18, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gBoomerangDL, "Equipment_BoomerangBody5", equipmentBoomerangBody.changedCvar, 78, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(equipmentBoomerangBody.cvar, defaultColor); + PATCH_GFX(gGiBoomerangDL, "Equipment_BoomerangBody1", equipmentBoomerangBody.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiBoomerangDL, "Equipment_BoomerangBody2", equipmentBoomerangBody.changedCvar, 6, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + PATCH_GFX(gLinkChildLeftFistAndBoomerangNearDL, "Equipment_BoomerangBody3", equipmentBoomerangBody.changedCvar, 34, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkChildLeftFistAndBoomerangFarDL, "Equipment_BoomerangBody4", equipmentBoomerangBody.changedCvar, 9, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gBoomerangDL, "Equipment_BoomerangBody5", equipmentBoomerangBody.changedCvar, 39, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } static CosmeticOption& equipmentBoomerangGem = cosmeticOptions.at("Equipment_BoomerangGem"); - if (manualChange || CVar_GetS32(equipmentBoomerangGem.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(equipmentBoomerangGem.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {equipmentBoomerangGem.defaultColor.x, equipmentBoomerangGem.defaultColor.y, equipmentBoomerangGem.defaultColor.z, equipmentBoomerangGem.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(equipmentBoomerangGem.cvar, defaultColor); - PATCH_GFX(gGiBoomerangDL, "Equipment_BoomerangGem1", equipmentBoomerangGem.changedCvar, 168, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiBoomerangDL, "Equipment_BoomerangGem2", equipmentBoomerangGem.changedCvar, 170, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); - PATCH_GFX(gLinkChildLeftFistAndBoomerangNearDL, "Equipment_BoomerangGem3", equipmentBoomerangGem.changedCvar, 32, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gBoomerangDL, "Equipment_BoomerangGem4", equipmentBoomerangGem.changedCvar, 46, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(equipmentBoomerangGem.cvar, defaultColor); + PATCH_GFX(gGiBoomerangDL, "Equipment_BoomerangGem1", equipmentBoomerangGem.changedCvar, 84, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiBoomerangDL, "Equipment_BoomerangGem2", equipmentBoomerangGem.changedCvar, 85, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + PATCH_GFX(gLinkChildLeftFistAndBoomerangNearDL, "Equipment_BoomerangGem3", equipmentBoomerangGem.changedCvar, 16, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gBoomerangDL, "Equipment_BoomerangGem4", equipmentBoomerangGem.changedCvar, 23, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); // There appears to be no gem rendered on the far LOD variant, not sure if this is an SOH bug or what. // PATCH_GFX(gLinkChildLeftFistAndBoomerangFarDL, "Equipment_BoomerangGem5", equipmentBoomerangGem.changedCvar, 32, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } // static CosmeticOption& equipmentSlingshotBody = cosmeticOptions.at("Equipment_SlingshotBody"); - // if (manualChange || CVar_GetS32(equipmentSlingshotBody.rainbowCvar, 0)) { + // if (manualChange || CVarGetInteger(equipmentSlingshotBody.rainbowCvar, 0)) { // static Color_RGBA8 defaultColor = {equipmentSlingshotBody.defaultColor.x, equipmentSlingshotBody.defaultColor.y, equipmentSlingshotBody.defaultColor.z, equipmentSlingshotBody.defaultColor.w}; - // Color_RGBA8 color = CVar_GetRGBA(equipmentSlingshotBody.cvar, defaultColor); + // Color_RGBA8 color = CVarGetColor(equipmentSlingshotBody.cvar, defaultColor); // PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotBody1", equipmentSlingshotBody.changedCvar, 10, gsDPSetPrimColor(0, 0, MAX(color.r - 100, 0), MAX(color.g - 100, 0), MAX(color.b - 100, 0), 255)); // PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotBody2", equipmentSlingshotBody.changedCvar, 12, gsDPSetEnvColor(MAX(color.r - 100, 0) / 3, MAX(color.g - 100, 0) / 3, MAX(color.b - 100, 0) / 3, 255)); // PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotBody3", equipmentSlingshotBody.changedCvar, 74, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); @@ -807,237 +807,237 @@ void ApplyOrResetCustomGfxPatches(bool manualChange = true) { // } // } static CosmeticOption& equipmentSlingshotString = cosmeticOptions.at("Equipment_SlingshotString"); - if (manualChange || CVar_GetS32(equipmentSlingshotString.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(equipmentSlingshotString.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {equipmentSlingshotString.defaultColor.x, equipmentSlingshotString.defaultColor.y, equipmentSlingshotString.defaultColor.z, equipmentSlingshotString.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(equipmentSlingshotString.cvar, defaultColor); - PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotString1",equipmentSlingshotString.changedCvar,150, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotString2",equipmentSlingshotString.changedCvar,152, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); - PATCH_GFX(gLinkChildSlinghotStringDL, "Equipment_SlingshotString3",equipmentSlingshotString.changedCvar, 18, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(equipmentSlingshotString.cvar, defaultColor); + PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotString1",equipmentSlingshotString.changedCvar, 75, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiSlingshotDL, "Equipment_SlingshotString2",equipmentSlingshotString.changedCvar, 76, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); + PATCH_GFX(gLinkChildSlinghotStringDL, "Equipment_SlingshotString3",equipmentSlingshotString.changedCvar, 9, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } static CosmeticOption& equipmentBowTips = cosmeticOptions.at("Equipment_BowTips"); - if (manualChange || CVar_GetS32(equipmentBowTips.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(equipmentBowTips.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {equipmentBowTips.defaultColor.x, equipmentBowTips.defaultColor.y, equipmentBowTips.defaultColor.z, equipmentBowTips.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(equipmentBowTips.cvar, defaultColor); - PATCH_GFX(gGiBowDL, "Equipment_BowTips1", equipmentBowTips.changedCvar, 172, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiBowDL, "Equipment_BowTips2", equipmentBowTips.changedCvar, 174, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); - PATCH_GFX(gLinkAdultRightHandHoldingBowFirstPersonDL, "Equipment_BowTips3", equipmentBowTips.changedCvar, 68, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightHandHoldingBowNearDL, "Equipment_BowTips4", equipmentBowTips.changedCvar, 52, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightHandHoldingBowFarDL, "Equipment_BowTips5", equipmentBowTips.changedCvar, 50, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(equipmentBowTips.cvar, defaultColor); + PATCH_GFX(gGiBowDL, "Equipment_BowTips1", equipmentBowTips.changedCvar, 86, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiBowDL, "Equipment_BowTips2", equipmentBowTips.changedCvar, 87, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + PATCH_GFX(gLinkAdultRightHandHoldingBowFirstPersonDL, "Equipment_BowTips3", equipmentBowTips.changedCvar, 34, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightHandHoldingBowNearDL, "Equipment_BowTips4", equipmentBowTips.changedCvar, 26, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightHandHoldingBowFarDL, "Equipment_BowTips5", equipmentBowTips.changedCvar, 25, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } static CosmeticOption& equipmentBowString = cosmeticOptions.at("Equipment_BowString"); - if (manualChange || CVar_GetS32(equipmentBowString.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(equipmentBowString.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {equipmentBowString.defaultColor.x, equipmentBowString.defaultColor.y, equipmentBowString.defaultColor.z, equipmentBowString.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(equipmentBowString.cvar, defaultColor); - PATCH_GFX(gGiBowDL, "Equipment_BowString1", equipmentBowString.changedCvar, 210, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiBowDL, "Equipment_BowString2", equipmentBowString.changedCvar, 212, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); - PATCH_GFX(gLinkAdultBowStringDL, "Equipment_BowString3", equipmentBowString.changedCvar, 18, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(equipmentBowString.cvar, defaultColor); + PATCH_GFX(gGiBowDL, "Equipment_BowString1", equipmentBowString.changedCvar, 105, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiBowDL, "Equipment_BowString2", equipmentBowString.changedCvar, 106, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + PATCH_GFX(gLinkAdultBowStringDL, "Equipment_BowString3", equipmentBowString.changedCvar, 9, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } static CosmeticOption& equipmentBowBody = cosmeticOptions.at("Equipment_BowBody"); - if (manualChange || CVar_GetS32(equipmentBowBody.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(equipmentBowBody.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {equipmentBowBody.defaultColor.x, equipmentBowBody.defaultColor.y, equipmentBowBody.defaultColor.z, equipmentBowBody.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(equipmentBowBody.cvar, defaultColor); - PATCH_GFX(gGiBowDL, "Equipment_BowBody1", equipmentBowBody.changedCvar, 10, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiBowDL, "Equipment_BowBody2", equipmentBowBody.changedCvar, 12, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); - PATCH_GFX(gLinkAdultRightHandHoldingBowFirstPersonDL, "Equipment_BowBody3", equipmentBowBody.changedCvar, 84, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightHandHoldingBowNearDL, "Equipment_BowBody4", equipmentBowBody.changedCvar, 66, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightHandHoldingBowFarDL, "Equipment_BowBody5", equipmentBowBody.changedCvar, 62, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(equipmentBowBody.cvar, defaultColor); + PATCH_GFX(gGiBowDL, "Equipment_BowBody1", equipmentBowBody.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiBowDL, "Equipment_BowBody2", equipmentBowBody.changedCvar, 6, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + PATCH_GFX(gLinkAdultRightHandHoldingBowFirstPersonDL, "Equipment_BowBody3", equipmentBowBody.changedCvar, 42, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightHandHoldingBowNearDL, "Equipment_BowBody4", equipmentBowBody.changedCvar, 33, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightHandHoldingBowFarDL, "Equipment_BowBody5", equipmentBowBody.changedCvar, 31, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } static CosmeticOption& equipmentBowHandle = cosmeticOptions.at("Equipment_BowHandle"); - if (manualChange || CVar_GetS32(equipmentBowHandle.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(equipmentBowHandle.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {equipmentBowHandle.defaultColor.x, equipmentBowHandle.defaultColor.y, equipmentBowHandle.defaultColor.z, equipmentBowHandle.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(equipmentBowHandle.cvar, defaultColor); - PATCH_GFX(gGiBowDL, "Equipment_BowHandle1", equipmentBowHandle.changedCvar, 102, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiBowDL, "Equipment_BowHandle2", equipmentBowHandle.changedCvar, 104, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); - PATCH_GFX(gLinkAdultRightHandHoldingBowFirstPersonDL, "Equipment_BowHandle3", equipmentBowHandle.changedCvar, 36, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightHandHoldingBowNearDL, "Equipment_BowHandle4", equipmentBowHandle.changedCvar, 36, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultRightHandHoldingBowFarDL, "Equipment_BowHandle5", equipmentBowHandle.changedCvar, 36, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(equipmentBowHandle.cvar, defaultColor); + PATCH_GFX(gGiBowDL, "Equipment_BowHandle1", equipmentBowHandle.changedCvar, 51, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiBowDL, "Equipment_BowHandle2", equipmentBowHandle.changedCvar, 52, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + PATCH_GFX(gLinkAdultRightHandHoldingBowFirstPersonDL, "Equipment_BowHandle3", equipmentBowHandle.changedCvar, 18, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightHandHoldingBowNearDL, "Equipment_BowHandle4", equipmentBowHandle.changedCvar, 18, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultRightHandHoldingBowFarDL, "Equipment_BowHandle5", equipmentBowHandle.changedCvar, 18, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } static CosmeticOption& equipmentHammerHead = cosmeticOptions.at("Equipment_HammerHead"); - if (manualChange || CVar_GetS32(equipmentHammerHead.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(equipmentHammerHead.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {equipmentHammerHead.defaultColor.x, equipmentHammerHead.defaultColor.y, equipmentHammerHead.defaultColor.z, equipmentHammerHead.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(equipmentHammerHead.cvar, defaultColor); - PATCH_GFX(gGiHammerDL, "Equipment_HammerHead1", equipmentHammerHead.changedCvar, 10, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiHammerDL, "Equipment_HammerHead2", equipmentHammerHead.changedCvar, 12, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255)); - PATCH_GFX(gGiHammerDL, "Equipment_HammerHead3", equipmentHammerHead.changedCvar, 136, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiHammerDL, "Equipment_HammerHead4", equipmentHammerHead.changedCvar, 138, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255)); - PATCH_GFX(gLinkAdultLeftHandHoldingHammerNearDL, "Equipment_HammerHead5", equipmentHammerHead.changedCvar, 76, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultLeftHandHoldingHammerFarDL, "Equipment_HammerHead6", equipmentHammerHead.changedCvar, 76, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(equipmentHammerHead.cvar, defaultColor); + PATCH_GFX(gGiHammerDL, "Equipment_HammerHead1", equipmentHammerHead.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiHammerDL, "Equipment_HammerHead2", equipmentHammerHead.changedCvar, 6, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255)); + PATCH_GFX(gGiHammerDL, "Equipment_HammerHead3", equipmentHammerHead.changedCvar, 68, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiHammerDL, "Equipment_HammerHead4", equipmentHammerHead.changedCvar, 69, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255)); + PATCH_GFX(gLinkAdultLeftHandHoldingHammerNearDL, "Equipment_HammerHead5", equipmentHammerHead.changedCvar, 38, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultLeftHandHoldingHammerFarDL, "Equipment_HammerHead6", equipmentHammerHead.changedCvar, 38, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } static CosmeticOption& equipmentHammerHandle = cosmeticOptions.at("Equipment_HammerHandle"); - if (manualChange || CVar_GetS32(equipmentHammerHandle.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(equipmentHammerHandle.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {equipmentHammerHandle.defaultColor.x, equipmentHammerHandle.defaultColor.y, equipmentHammerHandle.defaultColor.z, equipmentHammerHandle.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(equipmentHammerHandle.cvar, defaultColor); - PATCH_GFX(gGiHammerDL, "Equipment_HammerHandle1", equipmentHammerHandle.changedCvar, 168, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiHammerDL, "Equipment_HammerHandle2", equipmentHammerHandle.changedCvar, 170, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); - PATCH_GFX(gLinkAdultLeftHandHoldingHammerNearDL, "Equipment_HammerHandle5", equipmentHammerHandle.changedCvar, 36, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gLinkAdultLeftHandHoldingHammerFarDL, "Equipment_HammerHandle6", equipmentHammerHandle.changedCvar, 36, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(equipmentHammerHandle.cvar, defaultColor); + PATCH_GFX(gGiHammerDL, "Equipment_HammerHandle1", equipmentHammerHandle.changedCvar, 84, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiHammerDL, "Equipment_HammerHandle2", equipmentHammerHandle.changedCvar, 85, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); + PATCH_GFX(gLinkAdultLeftHandHoldingHammerNearDL, "Equipment_HammerHandle5", equipmentHammerHandle.changedCvar, 18, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gLinkAdultLeftHandHoldingHammerFarDL, "Equipment_HammerHandle6", equipmentHammerHandle.changedCvar, 18, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } static CosmeticOption& equipmentChuFace = cosmeticOptions.at("Equipment_ChuFace"); - if (manualChange || CVar_GetS32(equipmentChuFace.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(equipmentChuFace.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {equipmentChuFace.defaultColor.x, equipmentChuFace.defaultColor.y, equipmentChuFace.defaultColor.z, equipmentChuFace.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(equipmentChuFace.cvar, defaultColor); - PATCH_GFX(gGiBombchuDL, "Equipment_ChuFace1", equipmentChuFace.changedCvar, 10, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiBombchuDL, "Equipment_ChuFace2", equipmentChuFace.changedCvar, 12, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); - PATCH_GFX(gBombchuDL, "Equipment_ChuFace3", equipmentChuFace.changedCvar, 4, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(equipmentChuFace.cvar, defaultColor); + PATCH_GFX(gGiBombchuDL, "Equipment_ChuFace1", equipmentChuFace.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiBombchuDL, "Equipment_ChuFace2", equipmentChuFace.changedCvar, 6, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + PATCH_GFX(gBombchuDL, "Equipment_ChuFace3", equipmentChuFace.changedCvar, 2, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); if (manualChange) { - PATCH_GFX(gBombchuDL, "Equipment_ChuFace4", equipmentChuFace.changedCvar, 20, gsSPGrayscale(true)); - PATCH_GFX(gBombchuDL, "Equipment_ChuFace5", equipmentChuFace.changedCvar, 54, gsSPGrayscale(false)); + PATCH_GFX(gBombchuDL, "Equipment_ChuFace4", equipmentChuFace.changedCvar, 10, gsSPGrayscale(true)); + PATCH_GFX(gBombchuDL, "Equipment_ChuFace5", equipmentChuFace.changedCvar, 27, gsSPGrayscale(false)); } } static CosmeticOption& equipmentChuBody = cosmeticOptions.at("Equipment_ChuBody"); - if (manualChange || CVar_GetS32(equipmentChuBody.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(equipmentChuBody.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {equipmentChuBody.defaultColor.x, equipmentChuBody.defaultColor.y, equipmentChuBody.defaultColor.z, equipmentChuBody.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(equipmentChuBody.cvar, defaultColor); - PATCH_GFX(gGiBombchuDL, "Equipment_ChuBody1", equipmentChuBody.changedCvar, 78, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiBombchuDL, "Equipment_ChuBody2", equipmentChuBody.changedCvar, 80, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); - PATCH_GFX(gGiBombchuDL, "Equipment_ChuBody3", equipmentChuBody.changedCvar, 120, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiBombchuDL, "Equipment_ChuBody4", equipmentChuBody.changedCvar, 122, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); - PATCH_GFX(gBombchuDL, "Equipment_ChuBody5", equipmentChuBody.changedCvar, 92, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(equipmentChuBody.cvar, defaultColor); + PATCH_GFX(gGiBombchuDL, "Equipment_ChuBody1", equipmentChuBody.changedCvar, 39, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiBombchuDL, "Equipment_ChuBody2", equipmentChuBody.changedCvar, 40, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + PATCH_GFX(gGiBombchuDL, "Equipment_ChuBody3", equipmentChuBody.changedCvar, 60, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiBombchuDL, "Equipment_ChuBody4", equipmentChuBody.changedCvar, 61, gsDPSetEnvColor(color.r / 3, color.g / 3, color.b / 3, 255)); + PATCH_GFX(gBombchuDL, "Equipment_ChuBody5", equipmentChuBody.changedCvar, 46, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } static CosmeticOption& consumableGreenRupee = cosmeticOptions.at("Consumable_GreenRupee"); - if (manualChange || CVar_GetS32(consumableGreenRupee.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(consumableGreenRupee.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {consumableGreenRupee.defaultColor.x, consumableGreenRupee.defaultColor.y, consumableGreenRupee.defaultColor.z, consumableGreenRupee.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(consumableGreenRupee.cvar, defaultColor); - PATCH_GFX(gGiGreenRupeeInnerColorDL, "Consumable_GreenRupee1", consumableGreenRupee.changedCvar, 6, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiGreenRupeeInnerColorDL, "Consumable_GreenRupee2", consumableGreenRupee.changedCvar, 8, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255)); - PATCH_GFX(gGiGreenRupeeOuterColorDL, "Consumable_GreenRupee3", consumableGreenRupee.changedCvar, 6, gsDPSetPrimColor(0, 0, MIN(color.r + 100, 255), MIN(color.g + 100, 255), MIN(color.b + 100, 255), 255)); - PATCH_GFX(gGiGreenRupeeOuterColorDL, "Consumable_GreenRupee4", consumableGreenRupee.changedCvar, 8, gsDPSetEnvColor(color.r * 0.75f, color.g * 0.75f, color.b * 0.75f, 255)); + Color_RGBA8 color = CVarGetColor(consumableGreenRupee.cvar, defaultColor); + PATCH_GFX(gGiGreenRupeeInnerColorDL, "Consumable_GreenRupee1", consumableGreenRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiGreenRupeeInnerColorDL, "Consumable_GreenRupee2", consumableGreenRupee.changedCvar, 4, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255)); + PATCH_GFX(gGiGreenRupeeOuterColorDL, "Consumable_GreenRupee3", consumableGreenRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, MIN(color.r + 100, 255), MIN(color.g + 100, 255), MIN(color.b + 100, 255), 255)); + PATCH_GFX(gGiGreenRupeeOuterColorDL, "Consumable_GreenRupee4", consumableGreenRupee.changedCvar, 4, gsDPSetEnvColor(color.r * 0.75f, color.g * 0.75f, color.b * 0.75f, 255)); } static CosmeticOption& consumableBlueRupee = cosmeticOptions.at("Consumable_BlueRupee"); - if (manualChange || CVar_GetS32(consumableBlueRupee.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(consumableBlueRupee.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {consumableBlueRupee.defaultColor.x, consumableBlueRupee.defaultColor.y, consumableBlueRupee.defaultColor.z, consumableBlueRupee.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(consumableBlueRupee.cvar, defaultColor); - PATCH_GFX(gGiBlueRupeeInnerColorDL, "Consumable_BlueRupee1", consumableBlueRupee.changedCvar, 6, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiBlueRupeeInnerColorDL, "Consumable_BlueRupee2", consumableBlueRupee.changedCvar, 8, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255)); - PATCH_GFX(gGiBlueRupeeOuterColorDL, "Consumable_BlueRupee3", consumableBlueRupee.changedCvar, 6, gsDPSetPrimColor(0, 0, MIN(color.r + 100, 255), MIN(color.g + 100, 255), MIN(color.b + 100, 255), 255)); - PATCH_GFX(gGiBlueRupeeOuterColorDL, "Consumable_BlueRupee4", consumableBlueRupee.changedCvar, 8, gsDPSetEnvColor(color.r * 0.75f, color.g * 0.75f, color.b * 0.75f, 255)); + Color_RGBA8 color = CVarGetColor(consumableBlueRupee.cvar, defaultColor); + PATCH_GFX(gGiBlueRupeeInnerColorDL, "Consumable_BlueRupee1", consumableBlueRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiBlueRupeeInnerColorDL, "Consumable_BlueRupee2", consumableBlueRupee.changedCvar, 4, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255)); + PATCH_GFX(gGiBlueRupeeOuterColorDL, "Consumable_BlueRupee3", consumableBlueRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, MIN(color.r + 100, 255), MIN(color.g + 100, 255), MIN(color.b + 100, 255), 255)); + PATCH_GFX(gGiBlueRupeeOuterColorDL, "Consumable_BlueRupee4", consumableBlueRupee.changedCvar, 4, gsDPSetEnvColor(color.r * 0.75f, color.g * 0.75f, color.b * 0.75f, 255)); } static CosmeticOption& consumableRedRupee = cosmeticOptions.at("Consumable_RedRupee"); - if (manualChange || CVar_GetS32(consumableRedRupee.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(consumableRedRupee.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {consumableRedRupee.defaultColor.x, consumableRedRupee.defaultColor.y, consumableRedRupee.defaultColor.z, consumableRedRupee.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(consumableRedRupee.cvar, defaultColor); - PATCH_GFX(gGiRedRupeeInnerColorDL, "Consumable_RedRupee1", consumableRedRupee.changedCvar, 6, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiRedRupeeInnerColorDL, "Consumable_RedRupee2", consumableRedRupee.changedCvar, 8, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255)); - PATCH_GFX(gGiRedRupeeOuterColorDL, "Consumable_RedRupee3", consumableRedRupee.changedCvar, 6, gsDPSetPrimColor(0, 0, MIN(color.r + 100, 255), MIN(color.g + 100, 255), MIN(color.b + 100, 255), 255)); - PATCH_GFX(gGiRedRupeeOuterColorDL, "Consumable_RedRupee4", consumableRedRupee.changedCvar, 8, gsDPSetEnvColor(color.r * 0.75f, color.g * 0.75f, color.b * 0.75f, 255)); + Color_RGBA8 color = CVarGetColor(consumableRedRupee.cvar, defaultColor); + PATCH_GFX(gGiRedRupeeInnerColorDL, "Consumable_RedRupee1", consumableRedRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiRedRupeeInnerColorDL, "Consumable_RedRupee2", consumableRedRupee.changedCvar, 4, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255)); + PATCH_GFX(gGiRedRupeeOuterColorDL, "Consumable_RedRupee3", consumableRedRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, MIN(color.r + 100, 255), MIN(color.g + 100, 255), MIN(color.b + 100, 255), 255)); + PATCH_GFX(gGiRedRupeeOuterColorDL, "Consumable_RedRupee4", consumableRedRupee.changedCvar, 4, gsDPSetEnvColor(color.r * 0.75f, color.g * 0.75f, color.b * 0.75f, 255)); } static CosmeticOption& consumablePurpleRupee = cosmeticOptions.at("Consumable_PurpleRupee"); - if (manualChange || CVar_GetS32(consumablePurpleRupee.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(consumablePurpleRupee.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {consumablePurpleRupee.defaultColor.x, consumablePurpleRupee.defaultColor.y, consumablePurpleRupee.defaultColor.z, consumablePurpleRupee.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(consumablePurpleRupee.cvar, defaultColor); - PATCH_GFX(gGiPurpleRupeeInnerColorDL, "Consumable_PurpleRupee1", consumablePurpleRupee.changedCvar, 6, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiPurpleRupeeInnerColorDL, "Consumable_PurpleRupee2", consumablePurpleRupee.changedCvar, 8, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255)); - PATCH_GFX(gGiPurpleRupeeOuterColorDL, "Consumable_PurpleRupee3", consumablePurpleRupee.changedCvar, 6, gsDPSetPrimColor(0, 0, MIN(color.r + 100, 255), MIN(color.g + 100, 255), MIN(color.b + 100, 255), 255)); - PATCH_GFX(gGiPurpleRupeeOuterColorDL, "Consumable_PurpleRupee4", consumablePurpleRupee.changedCvar, 8, gsDPSetEnvColor(color.r * 0.75f, color.g * 0.75f, color.b * 0.75f, 255)); + Color_RGBA8 color = CVarGetColor(consumablePurpleRupee.cvar, defaultColor); + PATCH_GFX(gGiPurpleRupeeInnerColorDL, "Consumable_PurpleRupee1", consumablePurpleRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiPurpleRupeeInnerColorDL, "Consumable_PurpleRupee2", consumablePurpleRupee.changedCvar, 4, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255)); + PATCH_GFX(gGiPurpleRupeeOuterColorDL, "Consumable_PurpleRupee3", consumablePurpleRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, MIN(color.r + 100, 255), MIN(color.g + 100, 255), MIN(color.b + 100, 255), 255)); + PATCH_GFX(gGiPurpleRupeeOuterColorDL, "Consumable_PurpleRupee4", consumablePurpleRupee.changedCvar, 4, gsDPSetEnvColor(color.r * 0.75f, color.g * 0.75f, color.b * 0.75f, 255)); } static CosmeticOption& consumableGoldRupee = cosmeticOptions.at("Consumable_GoldRupee"); - if (manualChange || CVar_GetS32(consumableGoldRupee.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(consumableGoldRupee.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {consumableGoldRupee.defaultColor.x, consumableGoldRupee.defaultColor.y, consumableGoldRupee.defaultColor.z, consumableGoldRupee.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(consumableGoldRupee.cvar, defaultColor); - PATCH_GFX(gGiGoldRupeeInnerColorDL, "Consumable_GoldRupee1", consumableGoldRupee.changedCvar, 6, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiGoldRupeeInnerColorDL, "Consumable_GoldRupee2", consumableGoldRupee.changedCvar, 8, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255)); - PATCH_GFX(gGiGoldRupeeOuterColorDL, "Consumable_GoldRupee3", consumableGoldRupee.changedCvar, 6, gsDPSetPrimColor(0, 0, MIN(color.r + 100, 255), MIN(color.g + 100, 255), MIN(color.b + 100, 255), 255)); - PATCH_GFX(gGiGoldRupeeOuterColorDL, "Consumable_GoldRupee4", consumableGoldRupee.changedCvar, 8, gsDPSetEnvColor(color.r * 0.75f, color.g * 0.75f, color.b * 0.75f, 255)); + Color_RGBA8 color = CVarGetColor(consumableGoldRupee.cvar, defaultColor); + PATCH_GFX(gGiGoldRupeeInnerColorDL, "Consumable_GoldRupee1", consumableGoldRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiGoldRupeeInnerColorDL, "Consumable_GoldRupee2", consumableGoldRupee.changedCvar, 4, gsDPSetEnvColor(color.r / 5, color.g / 5, color.b / 5, 255)); + PATCH_GFX(gGiGoldRupeeOuterColorDL, "Consumable_GoldRupee3", consumableGoldRupee.changedCvar, 3, gsDPSetPrimColor(0, 0, MIN(color.r + 100, 255), MIN(color.g + 100, 255), MIN(color.b + 100, 255), 255)); + PATCH_GFX(gGiGoldRupeeOuterColorDL, "Consumable_GoldRupee4", consumableGoldRupee.changedCvar, 4, gsDPSetEnvColor(color.r * 0.75f, color.g * 0.75f, color.b * 0.75f, 255)); } static CosmeticOption& consumableHearts = cosmeticOptions.at("Consumable_Hearts"); - if (manualChange || CVar_GetS32(consumableHearts.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(consumableHearts.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {consumableHearts.defaultColor.x, consumableHearts.defaultColor.y, consumableHearts.defaultColor.z, consumableHearts.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(consumableHearts.cvar, defaultColor); + Color_RGBA8 color = CVarGetColor(consumableHearts.cvar, defaultColor); // PATCH_GFX(gGiRecoveryHeartDL, "Consumable_Hearts1", consumableHearts.changedCvar, 4, gsDPSetGrayscaleColor(color.r, color.g, color.b, 255)); // PATCH_GFX(gGiRecoveryHeartDL, "Consumable_Hearts2", consumableHearts.changedCvar, 26, gsSPGrayscale(true)); // PATCH_GFX(gGiRecoveryHeartDL, "Consumable_Hearts3", consumableHearts.changedCvar, 72, gsSPGrayscale(false)); // PATCH_GFX(gGiRecoveryHeartDL, "Consumable_Hearts4", consumableHearts.changedCvar, 74, gsSPEndDisplayList()); - PATCH_GFX(gGiHeartPieceDL, "Consumable_Hearts5", consumableHearts.changedCvar, 4, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiHeartPieceDL, "Consumable_Hearts6", consumableHearts.changedCvar, 12, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); - PATCH_GFX(gGiHeartContainerDL, "Consumable_Hearts7", consumableHearts.changedCvar, 4, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiHeartContainerDL, "Consumable_Hearts8", consumableHearts.changedCvar, 12, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); - PATCH_GFX(gGiRedPotColorDL, "Consumable_Hearts9", consumableHearts.changedCvar, 6, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiRedPotColorDL, "Consumable_Hearts10", consumableHearts.changedCvar, 8, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); + PATCH_GFX(gGiHeartPieceDL, "Consumable_Hearts5", consumableHearts.changedCvar, 2, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiHeartPieceDL, "Consumable_Hearts6", consumableHearts.changedCvar, 6, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); + PATCH_GFX(gGiHeartContainerDL, "Consumable_Hearts7", consumableHearts.changedCvar, 2, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiHeartContainerDL, "Consumable_Hearts8", consumableHearts.changedCvar, 6, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); + PATCH_GFX(gGiRedPotColorDL, "Consumable_Hearts9", consumableHearts.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiRedPotColorDL, "Consumable_Hearts10", consumableHearts.changedCvar, 4, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); } static CosmeticOption& consumableMagic = cosmeticOptions.at("Consumable_Magic"); - if (manualChange || CVar_GetS32(consumableMagic.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(consumableMagic.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {consumableMagic.defaultColor.x, consumableMagic.defaultColor.y, consumableMagic.defaultColor.z, consumableMagic.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(consumableMagic.cvar, defaultColor); - PATCH_GFX(gGiMagicJarSmallDL, "Consumable_Magic1", consumableMagic.changedCvar, 62, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiMagicJarSmallDL, "Consumable_Magic2", consumableMagic.changedCvar, 64, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); - PATCH_GFX(gGiMagicJarLargeDL, "Consumable_Magic3", consumableMagic.changedCvar, 62, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiMagicJarLargeDL, "Consumable_Magic4", consumableMagic.changedCvar, 64, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); - PATCH_GFX(gGiGreenPotColorDL, "Consumable_Magic5", consumableMagic.changedCvar, 6, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiGreenPotColorDL, "Consumable_Magic6", consumableMagic.changedCvar, 8, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); + Color_RGBA8 color = CVarGetColor(consumableMagic.cvar, defaultColor); + PATCH_GFX(gGiMagicJarSmallDL, "Consumable_Magic1", consumableMagic.changedCvar, 31, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiMagicJarSmallDL, "Consumable_Magic2", consumableMagic.changedCvar, 32, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); + PATCH_GFX(gGiMagicJarLargeDL, "Consumable_Magic3", consumableMagic.changedCvar, 31, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiMagicJarLargeDL, "Consumable_Magic4", consumableMagic.changedCvar, 32, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); + PATCH_GFX(gGiGreenPotColorDL, "Consumable_Magic5", consumableMagic.changedCvar, 3, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiGreenPotColorDL, "Consumable_Magic6", consumableMagic.changedCvar, 4, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); } static CosmeticOption& npcGoldenSkulltula = cosmeticOptions.at("NPC_GoldenSkulltula"); - if (manualChange || CVar_GetS32(npcGoldenSkulltula.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(npcGoldenSkulltula.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {npcGoldenSkulltula.defaultColor.x, npcGoldenSkulltula.defaultColor.y, npcGoldenSkulltula.defaultColor.z, npcGoldenSkulltula.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(npcGoldenSkulltula.cvar, defaultColor); - PATCH_GFX(gGiSkulltulaTokenDL, "NPC_GoldenSkulltula1", npcGoldenSkulltula.changedCvar, 10, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiSkulltulaTokenDL, "NPC_GoldenSkulltula2", npcGoldenSkulltula.changedCvar, 12, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); - PATCH_GFX(gGiSkulltulaTokenFlameDL, "NPC_GoldenSkulltula3", npcGoldenSkulltula.changedCvar, 64, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGiSkulltulaTokenFlameDL, "NPC_GoldenSkulltula4", npcGoldenSkulltula.changedCvar, 66, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); - PATCH_GFX(object_st_DL_003FB0, "NPC_GoldenSkulltula5", npcGoldenSkulltula.changedCvar, 236, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(object_st_DL_003FB0, "NPC_GoldenSkulltula6", npcGoldenSkulltula.changedCvar, 238, gsDPSetEnvColor(color.r / 4, color.g / 4, color.b / 4, 255)); + Color_RGBA8 color = CVarGetColor(npcGoldenSkulltula.cvar, defaultColor); + PATCH_GFX(gGiSkulltulaTokenDL, "NPC_GoldenSkulltula1", npcGoldenSkulltula.changedCvar, 5, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiSkulltulaTokenDL, "NPC_GoldenSkulltula2", npcGoldenSkulltula.changedCvar, 6, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); + PATCH_GFX(gGiSkulltulaTokenFlameDL, "NPC_GoldenSkulltula3", npcGoldenSkulltula.changedCvar, 32, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGiSkulltulaTokenFlameDL, "NPC_GoldenSkulltula4", npcGoldenSkulltula.changedCvar, 33, gsDPSetEnvColor(color.r / 2, color.g / 2, color.b / 2, 255)); + PATCH_GFX(object_st_DL_003FB0, "NPC_GoldenSkulltula5", npcGoldenSkulltula.changedCvar, 118, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(object_st_DL_003FB0, "NPC_GoldenSkulltula6", npcGoldenSkulltula.changedCvar, 119, gsDPSetEnvColor(color.r / 4, color.g / 4, color.b / 4, 255)); } static CosmeticOption& npcGerudo = cosmeticOptions.at("NPC_Gerudo"); - if (manualChange || CVar_GetS32(npcGerudo.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(npcGerudo.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {npcGerudo.defaultColor.x, npcGerudo.defaultColor.y, npcGerudo.defaultColor.z, npcGerudo.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(npcGerudo.cvar, defaultColor); - PATCH_GFX(gGerudoPurpleTorsoDL, "NPC_Gerudo1", npcGerudo.changedCvar, 278, gsDPSetEnvColor( color.r, color.g, color.b, 255)); - PATCH_GFX(gGerudoPurpleRightThighDL, "NPC_Gerudo2", npcGerudo.changedCvar, 22, gsDPSetEnvColor(color.r, color.g, color.b, 255)); - PATCH_GFX(gGerudoPurpleLeftThighDL, "NPC_Gerudo3", npcGerudo.changedCvar, 22, gsDPSetEnvColor(color.r, color.g, color.b, 255)); - PATCH_GFX(gGerudoPurpleVeilDL, "NPC_Gerudo4", npcGerudo.changedCvar, 34, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGerudoPurpleLeftShinDL, "NPC_Gerudo5", npcGerudo.changedCvar, 22, gsDPSetEnvColor(color.r, color.g, color.b, 255)); - PATCH_GFX(gGerudoPurpleRightShinDL, "NPC_Gerudo6", npcGerudo.changedCvar, 22, gsDPSetEnvColor(color.r, color.g, color.b, 255)); - PATCH_GFX(gGerudoPurpleLeftHandDL, "NPC_Gerudo7", npcGerudo.changedCvar, 34, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); - PATCH_GFX(gGerudoPurpleRightHandDL, "NPC_Gerudo8", npcGerudo.changedCvar, 34, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(npcGerudo.cvar, defaultColor); + PATCH_GFX(gGerudoPurpleTorsoDL, "NPC_Gerudo1", npcGerudo.changedCvar, 139, gsDPSetEnvColor( color.r, color.g, color.b, 255)); + PATCH_GFX(gGerudoPurpleRightThighDL, "NPC_Gerudo2", npcGerudo.changedCvar, 11, gsDPSetEnvColor(color.r, color.g, color.b, 255)); + PATCH_GFX(gGerudoPurpleLeftThighDL, "NPC_Gerudo3", npcGerudo.changedCvar, 11, gsDPSetEnvColor(color.r, color.g, color.b, 255)); + PATCH_GFX(gGerudoPurpleVeilDL, "NPC_Gerudo4", npcGerudo.changedCvar, 17, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGerudoPurpleLeftShinDL, "NPC_Gerudo5", npcGerudo.changedCvar, 11, gsDPSetEnvColor(color.r, color.g, color.b, 255)); + PATCH_GFX(gGerudoPurpleRightShinDL, "NPC_Gerudo6", npcGerudo.changedCvar, 11, gsDPSetEnvColor(color.r, color.g, color.b, 255)); + PATCH_GFX(gGerudoPurpleLeftHandDL, "NPC_Gerudo7", npcGerudo.changedCvar, 17, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + PATCH_GFX(gGerudoPurpleRightHandDL, "NPC_Gerudo8", npcGerudo.changedCvar, 17, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } static CosmeticOption& npcMetalTrap = cosmeticOptions.at("NPC_MetalTrap"); - if (manualChange || CVar_GetS32(npcMetalTrap.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(npcMetalTrap.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {npcMetalTrap.defaultColor.x, npcMetalTrap.defaultColor.y, npcMetalTrap.defaultColor.z, npcMetalTrap.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(npcMetalTrap.cvar, defaultColor); - PATCH_GFX(gSlidingBladeTrapDL, "NPC_MetalTrap1", npcMetalTrap.changedCvar, 118, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); + Color_RGBA8 color = CVarGetColor(npcMetalTrap.cvar, defaultColor); + PATCH_GFX(gSlidingBladeTrapDL, "NPC_MetalTrap1", npcMetalTrap.changedCvar, 59, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255)); } static CosmeticOption& n64LogoRed = cosmeticOptions.at("Title_N64LogoRed"); - if (manualChange || CVar_GetS32(n64LogoRed.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(n64LogoRed.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {n64LogoRed.defaultColor.x, n64LogoRed.defaultColor.y, n64LogoRed.defaultColor.z, n64LogoRed.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(n64LogoRed.cvar, defaultColor); - PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoRed1", n64LogoRed.changedCvar, 34, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)) - PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoRed2", n64LogoRed.changedCvar, 36, gsDPSetEnvColor(color.r, color.g, color.b, 128)); + Color_RGBA8 color = CVarGetColor(n64LogoRed.cvar, defaultColor); + PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoRed1", n64LogoRed.changedCvar, 17, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)) + PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoRed2", n64LogoRed.changedCvar, 18, gsDPSetEnvColor(color.r, color.g, color.b, 128)); } static CosmeticOption& n64LogoBlue = cosmeticOptions.at("Title_N64LogoBlue"); - if (manualChange || CVar_GetS32(n64LogoBlue.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(n64LogoBlue.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {n64LogoBlue.defaultColor.x, n64LogoBlue.defaultColor.y, n64LogoBlue.defaultColor.z, n64LogoBlue.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(n64LogoBlue.cvar, defaultColor); - PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoBlue1", n64LogoBlue.changedCvar, 58, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)) - PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoBlue2", n64LogoBlue.changedCvar, 60, gsDPSetEnvColor(color.r, color.g, color.b, 128)); + Color_RGBA8 color = CVarGetColor(n64LogoBlue.cvar, defaultColor); + PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoBlue1", n64LogoBlue.changedCvar, 29, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)) + PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoBlue2", n64LogoBlue.changedCvar, 30, gsDPSetEnvColor(color.r, color.g, color.b, 128)); } static CosmeticOption& n64LogoGreen = cosmeticOptions.at("Title_N64LogoGreen"); - if (manualChange || CVar_GetS32(n64LogoGreen.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(n64LogoGreen.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {n64LogoGreen.defaultColor.x, n64LogoGreen.defaultColor.y, n64LogoGreen.defaultColor.z, n64LogoGreen.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(n64LogoGreen.cvar, defaultColor); - PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoGreen1", n64LogoGreen.changedCvar, 112, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)) - PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoGreen2", n64LogoGreen.changedCvar, 114, gsDPSetEnvColor(color.r, color.g, color.b, 128)); + Color_RGBA8 color = CVarGetColor(n64LogoGreen.cvar, defaultColor); + PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoGreen1", n64LogoGreen.changedCvar, 56, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)) + PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoGreen2", n64LogoGreen.changedCvar, 57, gsDPSetEnvColor(color.r, color.g, color.b, 128)); } static CosmeticOption& n64LogoYellow = cosmeticOptions.at("Title_N64LogoYellow"); - if (manualChange || CVar_GetS32(n64LogoYellow.rainbowCvar, 0)) { + if (manualChange || CVarGetInteger(n64LogoYellow.rainbowCvar, 0)) { static Color_RGBA8 defaultColor = {n64LogoYellow.defaultColor.x, n64LogoYellow.defaultColor.y, n64LogoYellow.defaultColor.z, n64LogoYellow.defaultColor.w}; - Color_RGBA8 color = CVar_GetRGBA(n64LogoYellow.cvar, defaultColor); - PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoYellow1", n64LogoYellow.changedCvar, 162, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)) - PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoYellow2", n64LogoYellow.changedCvar, 164, gsDPSetEnvColor(color.r, color.g, color.b, 128)); + Color_RGBA8 color = CVarGetColor(n64LogoYellow.cvar, defaultColor); + PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoYellow1", n64LogoYellow.changedCvar, 81, gsDPSetPrimColor(0, 0, 255, 255, 255, 255)) + PATCH_GFX(gNintendo64LogoDL, "Title_N64LogoYellow2", n64LogoYellow.changedCvar, 82, gsDPSetEnvColor(color.r, color.g, color.b, 128)); } if (gPlayState != nullptr) { - if (CVar_GetS32("gCosmetics.Link_BodyScale.Changed", 0)) { + if (CVarGetInteger("gCosmetics.Link_BodyScale.Changed", 0)) { static Player* player = GET_PLAYER(gPlayState); - float scale = CVar_GetFloat("gCosmetics.Link_BodyScale.Value", 0.01f); + float scale = CVarGetFloat("gCosmetics.Link_BodyScale.Value", 0.01f); player->actor.scale.x = scale; player->actor.scale.y = scale; player->actor.scale.z = scale; @@ -1139,7 +1139,7 @@ void Draw_Placements(){ ImGui::EndTable(); } } - if (CVar_GetS32("gVisualAgony",0) && ImGui::CollapsingHeader("Visual stone of agony position")) { + if (CVarGetInteger("gVisualAgony",0) && ImGui::CollapsingHeader("Visual stone of agony position")) { if (ImGui::BeginTable("tabledvisualstoneofagony", 1, FlagsTable)) { ImGui::TableSetupColumn("Visual stone of agony settings", FlagsCell, TablesCellsWidth); Table_InitHeader(false); @@ -1147,9 +1147,9 @@ void Draw_Placements(){ DrawPositionsRadioBoxes("gVSOA"); s16 Min_X_VSOA = 0; s16 Max_X_VSOA = ImGui::GetWindowViewport()->Size.x/2; - if(CVar_GetS32("gVSOAPosType",0) == 2){ + if(CVarGetInteger("gVSOAPosType",0) == 2){ Max_X_VSOA = 290; - } else if(CVar_GetS32("gVSOAPosType",0) == 4){ + } else if(CVarGetInteger("gVSOAPosType",0) == 4){ Min_X_VSOA = (ImGui::GetWindowViewport()->Size.x/2)*-1; } DrawPositionSlider("gVSOA", 0, ImGui::GetWindowViewport()->Size.y/2, Min_X_VSOA, Max_X_VSOA); @@ -1202,11 +1202,11 @@ void Draw_Placements(){ DrawPositionsRadioBoxes("gCBtnU"); s16 Min_X_CU = 0; s16 Max_X_CU = ImGui::GetWindowViewport()->Size.x/2; - if(CVar_GetS32("gCBtnUPosType",0) == 2){ + if(CVarGetInteger("gCBtnUPosType",0) == 2){ Max_X_CU = 294; - } else if(CVar_GetS32("gCBtnUPosType",0) == 3){ + } else if(CVarGetInteger("gCBtnUPosType",0) == 3){ Max_X_CU = ImGui::GetWindowViewport()->Size.x/2; - } else if(CVar_GetS32("gCBtnUPosType",0) == 4){ + } else if(CVarGetInteger("gCBtnUPosType",0) == 4){ Min_X_CU = (ImGui::GetWindowViewport()->Size.x/2)*-1; } DrawPositionSlider("gCBtnU", 0, ImGui::GetWindowViewport()->Size.y/2, Min_X_CU, Max_X_CU); @@ -1223,11 +1223,11 @@ void Draw_Placements(){ DrawPositionsRadioBoxes("gCBtnD"); s16 Min_X_CD = 0; s16 Max_X_CD = ImGui::GetWindowViewport()->Size.x/2; - if(CVar_GetS32("gCBtnDPosType",0) == 2){ + if(CVarGetInteger("gCBtnDPosType",0) == 2){ Max_X_CD = 294; - } else if(CVar_GetS32("gCBtnDPosType",0) == 3){ + } else if(CVarGetInteger("gCBtnDPosType",0) == 3){ Max_X_CD = ImGui::GetWindowViewport()->Size.x/2; - } else if(CVar_GetS32("gCBtnDPosType",0) == 4){ + } else if(CVarGetInteger("gCBtnDPosType",0) == 4){ Min_X_CD = (ImGui::GetWindowViewport()->Size.x/2)*-1; } DrawPositionSlider("gCBtnD", 0, ImGui::GetWindowViewport()->Size.y/2, Min_X_CD, Max_X_CD); @@ -1244,11 +1244,11 @@ void Draw_Placements(){ DrawPositionsRadioBoxes("gCBtnL"); s16 Min_X_CL = 0; s16 Max_X_CL = ImGui::GetWindowViewport()->Size.x/2; - if(CVar_GetS32("gCBtnLPosType",0) == 2){ + if(CVarGetInteger("gCBtnLPosType",0) == 2){ Max_X_CL = 294; - } else if(CVar_GetS32("gCBtnLPosType",0) == 3){ + } else if(CVarGetInteger("gCBtnLPosType",0) == 3){ Max_X_CL = ImGui::GetWindowViewport()->Size.x/2; - } else if(CVar_GetS32("gCBtnLPosType",0) == 4){ + } else if(CVarGetInteger("gCBtnLPosType",0) == 4){ Min_X_CL = (ImGui::GetWindowViewport()->Size.x/2)*-1; } DrawPositionSlider("gCBtnL", 0, ImGui::GetWindowViewport()->Size.y/2, Min_X_CL, Max_X_CL); @@ -1265,11 +1265,11 @@ void Draw_Placements(){ DrawPositionsRadioBoxes("gCBtnR"); s16 Min_X_CR = 0; s16 Max_X_CR = ImGui::GetWindowViewport()->Size.x/2; - if(CVar_GetS32("gCBtnRPosType",0) == 2){ + if(CVarGetInteger("gCBtnRPosType",0) == 2){ Max_X_CR = 294; - } else if(CVar_GetS32("gCBtnRPosType",0) == 3){ + } else if(CVarGetInteger("gCBtnRPosType",0) == 3){ Max_X_CR = ImGui::GetWindowViewport()->Size.x/2; - } else if(CVar_GetS32("gCBtnRPosType",0) == 4){ + } else if(CVarGetInteger("gCBtnRPosType",0) == 4){ Min_X_CR = (ImGui::GetWindowViewport()->Size.x/2)*-1; } DrawPositionSlider("gCBtnR", 0, ImGui::GetWindowViewport()->Size.y/2, Min_X_CR, Max_X_CR); @@ -1278,7 +1278,7 @@ void Draw_Placements(){ ImGui::EndTable(); } } - if (CVar_GetS32("gDpadEquips",0) && ImGui::CollapsingHeader("DPad items position")) { + if (CVarGetInteger("gDpadEquips",0) && ImGui::CollapsingHeader("DPad items position")) { if (ImGui::BeginTable("tabledpaditems", 1, FlagsTable)) { ImGui::TableSetupColumn("DPad items settings", FlagsCell, TablesCellsWidth); Table_InitHeader(false); @@ -1286,9 +1286,9 @@ void Draw_Placements(){ DrawPositionsRadioBoxes("gDPad"); s16 Min_X_Dpad = 0; s16 Max_X_Dpad = ImGui::GetWindowViewport()->Size.x/2; - if(CVar_GetS32("gDPadPosType",0) == 2){ + if(CVarGetInteger("gDPadPosType",0) == 2){ Max_X_Dpad = 290; - } else if(CVar_GetS32("gDPadPosType",0) == 4){ + } else if(CVarGetInteger("gDPadPosType",0) == 4){ Min_X_Dpad = (ImGui::GetWindowViewport()->Size.x/2)*-1; } DrawPositionSlider("gDPad", 0, ImGui::GetWindowViewport()->Size.y/2, Min_X_Dpad, Max_X_Dpad); @@ -1396,18 +1396,18 @@ void Draw_Placements(){ } void DrawSillyTab() { - if (CVar_GetS32("gLetItSnow", 0)) { + if (CVarGetInteger("gLetItSnow", 0)) { if (UIWidgets::EnhancementCheckbox("Let It Snow", "gLetItSnow")) { SohImGui::RequestCvarSaveOnNextTick(); } } if (UIWidgets::EnhancementSliderFloat("Link Body Scale: %f", "##Link_BodyScale", "gCosmetics.Link_BodyScale.Value", 0.001f, 0.025f, "", 0.01f, false)) { - CVar_SetS32("gCosmetics.Link_BodyScale.Changed", 1); + CVarSetInteger("gCosmetics.Link_BodyScale.Changed", 1); } ImGui::SameLine(); if (ImGui::Button("Reset##Link_BodyScale")) { - CVar_Clear("gCosmetics.Link_BodyScale.Value"); - CVar_Clear("gCosmetics.Link_BodyScale.Changed"); + CVarClear("gCosmetics.Link_BodyScale.Value"); + CVarClear("gCosmetics.Link_BodyScale.Changed"); SohImGui::RequestCvarSaveOnNextTick(); static Player* player = GET_PLAYER(gPlayState); player->actor.scale.x = 0.01f; @@ -1415,67 +1415,67 @@ void DrawSillyTab() { player->actor.scale.z = 0.01f; } if (UIWidgets::EnhancementSliderFloat("Link Head Scale: %f", "##Link_HeadScale", "gCosmetics.Link_HeadScale.Value", 0.4f, 4.0f, "", 1.0f, false)) { - CVar_SetS32("gCosmetics.Link_HeadScale.Changed", 1); + CVarSetInteger("gCosmetics.Link_HeadScale.Changed", 1); } ImGui::SameLine(); if (ImGui::Button("Reset##Link_HeadScale")) { - CVar_Clear("gCosmetics.Link_HeadScale.Value"); - CVar_Clear("gCosmetics.Link_HeadScale.Changed"); + CVarClear("gCosmetics.Link_HeadScale.Value"); + CVarClear("gCosmetics.Link_HeadScale.Changed"); SohImGui::RequestCvarSaveOnNextTick(); } if (UIWidgets::EnhancementSliderFloat("Link Sword Scale: %f", "##Link_SwordScale", "gCosmetics.Link_SwordScale.Value", 1.0f, 2.5f, "", 1.0f, false)) { - CVar_SetS32("gCosmetics.Link_SwordScale.Changed", 1); + CVarSetInteger("gCosmetics.Link_SwordScale.Changed", 1); } ImGui::SameLine(); if (ImGui::Button("Reset##Link_SwordScale")) { - CVar_Clear("gCosmetics.Link_SwordScale.Value"); - CVar_Clear("gCosmetics.Link_SwordScale.Changed"); + CVarClear("gCosmetics.Link_SwordScale.Value"); + CVarClear("gCosmetics.Link_SwordScale.Changed"); SohImGui::RequestCvarSaveOnNextTick(); } UIWidgets::EnhancementSliderFloat("Bunny Hood Length: %f", "##BunnyHood_EarLength", "gCosmetics.BunnyHood_EarLength", -300.0f, 1000.0f, "", 0.0f, false); ImGui::SameLine(); if (ImGui::Button("Reset##BunnyHood_EarLength")) { - CVar_Clear("gCosmetics.BunnyHood_EarLength"); + CVarClear("gCosmetics.BunnyHood_EarLength"); SohImGui::RequestCvarSaveOnNextTick(); } UIWidgets::EnhancementSliderFloat("Bunny Hood Spread: %f", "##BunnyHood_EarSpread", "gCosmetics.BunnyHood_EarSpread", -300.0f, 500.0f, "", 0.0f, false); ImGui::SameLine(); if (ImGui::Button("Reset##BunnyHood_EarSpread")) { - CVar_Clear("gCosmetics.BunnyHood_EarSpread"); + CVarClear("gCosmetics.BunnyHood_EarSpread"); SohImGui::RequestCvarSaveOnNextTick(); } UIWidgets::EnhancementSliderFloat("Goron Neck Length: %f", "##Goron_NeckLength", "gCosmetics.Goron_NeckLength", 0.0f, 1000.0f, "", 0.0f, false); ImGui::SameLine(); if (ImGui::Button("Reset##Goron_NeckLength")) { - CVar_Clear("gCosmetics.Goron_NeckLength"); + CVarClear("gCosmetics.Goron_NeckLength"); SohImGui::RequestCvarSaveOnNextTick(); } UIWidgets::EnhancementCheckbox("Unfix Goron Spin", "gUnfixGoronSpin"); UIWidgets::EnhancementSliderFloat("Fairies Size: %f", "##Fairies_Size", "gCosmetics.Fairies_Size", 0.25f, 5.0f, "", 1.0f, false); ImGui::SameLine(); if (ImGui::Button("Reset##Fairies_Size")) { - CVar_Clear("gCosmetics.Fairies_Size"); + CVarClear("gCosmetics.Fairies_Size"); SohImGui::RequestCvarSaveOnNextTick(); } UIWidgets::EnhancementSliderFloat("N64 Logo Spin Speed: %f", "##N64Logo_SpinSpeed", "gCosmetics.N64Logo_SpinSpeed", 0.25f, 5.0f, "", 1.0f, false); ImGui::SameLine(); if (ImGui::Button("Reset##N64Logo_SpinSpeed")) { - CVar_Clear("gCosmetics.N64Logo_SpinSpeed"); + CVarClear("gCosmetics.N64Logo_SpinSpeed"); SohImGui::RequestCvarSaveOnNextTick(); } UIWidgets::EnhancementSliderFloat("Moon Size: %f", "##Moon_Size", "gCosmetics.Moon_Size", 0.5f, 2.0f, "", 1.0f, false); ImGui::SameLine(); if (ImGui::Button("Reset##Moon_Size")) { - CVar_Clear("gCosmetics.Moon_Size"); + CVarClear("gCosmetics.Moon_Size"); SohImGui::RequestCvarSaveOnNextTick(); } if (UIWidgets::EnhancementSliderFloat("Kak Windmill Speed: %f", "##Kak_Windmill_Speed", "gCosmetics.Kak_Windmill_Speed.Value", 100.0f, 6000.0f, "", 100.0f, false)) { - CVar_SetS32("gCosmetics.Kak_Windmill_Speed.Changed", 1); + CVarSetInteger("gCosmetics.Kak_Windmill_Speed.Changed", 1); } ImGui::SameLine(); if (ImGui::Button("Reset##Kak_Windmill_Speed")) { - CVar_Clear("gCosmetics.Kak_Windmill_Speed.Value"); - CVar_Clear("gCosmetics.Kak_Windmill_Speed.Changed"); + CVarClear("gCosmetics.Kak_Windmill_Speed.Value"); + CVarClear("gCosmetics.Kak_Windmill_Speed.Changed"); SohImGui::RequestCvarSaveOnNextTick(); } } @@ -1494,9 +1494,9 @@ void CopyMultipliedColor(CosmeticOption& cosmeticOptionSrc, CosmeticOption& cosm cosmeticOptionTarget.currentColor.z = newColor.b / 255.0; cosmeticOptionTarget.currentColor.w = newColor.a / 255.0; - CVar_SetRGBA(cosmeticOptionTarget.cvar, newColor); - CVar_SetS32((cosmeticOptionTarget.rainbowCvar), 0); - CVar_SetS32((cosmeticOptionTarget.changedCvar), 1); + CVarSetColor(cosmeticOptionTarget.cvar, newColor); + CVarSetInteger((cosmeticOptionTarget.rainbowCvar), 0); + CVarSetInteger((cosmeticOptionTarget.changedCvar), 1); } void RandomizeColor(CosmeticOption& cosmeticOption) { @@ -1511,9 +1511,9 @@ void RandomizeColor(CosmeticOption& cosmeticOption) { cosmeticOption.currentColor.z = newColor.b / 255.0; cosmeticOption.currentColor.w = newColor.a / 255.0; - CVar_SetRGBA(cosmeticOption.cvar, newColor); - CVar_SetS32((cosmeticOption.rainbowCvar), 0); - CVar_SetS32((cosmeticOption.changedCvar), 1); + CVarSetColor(cosmeticOption.cvar, newColor); + CVarSetInteger((cosmeticOption.rainbowCvar), 0); + CVarSetInteger((cosmeticOption.changedCvar), 1); // This bit is kind of experimental, not sure how I feel about it yet, but it allows for // advanced cosmetic options to be changed based on a non-advanced option. @@ -1543,15 +1543,15 @@ void ResetColor(CosmeticOption& cosmeticOption) { cosmeticOption.currentColor.z = defaultColor.b / 255.0; cosmeticOption.currentColor.w = defaultColor.a / 255.0; - CVar_Clear(cosmeticOption.changedCvar); - CVar_Clear(cosmeticOption.rainbowCvar); - CVar_Clear(cosmeticOption.lockedCvar); - CVar_Clear(cosmeticOption.cvar); - CVar_Clear((std::string(cosmeticOption.cvar) + ".R").c_str()); - CVar_Clear((std::string(cosmeticOption.cvar) + ".G").c_str()); - CVar_Clear((std::string(cosmeticOption.cvar) + ".B").c_str()); - CVar_Clear((std::string(cosmeticOption.cvar) + ".A").c_str()); - CVar_Clear((std::string(cosmeticOption.cvar) + ".Type").c_str()); + CVarClear(cosmeticOption.changedCvar); + CVarClear(cosmeticOption.rainbowCvar); + CVarClear(cosmeticOption.lockedCvar); + CVarClear(cosmeticOption.cvar); + CVarClear((std::string(cosmeticOption.cvar) + ".R").c_str()); + CVarClear((std::string(cosmeticOption.cvar) + ".G").c_str()); + CVarClear((std::string(cosmeticOption.cvar) + ".B").c_str()); + CVarClear((std::string(cosmeticOption.cvar) + ".A").c_str()); + CVarClear((std::string(cosmeticOption.cvar) + ".Type").c_str()); // This portion should match 1:1 the multiplied colors in `RandomizeColor()` if (cosmeticOption.label == "Bow Body") { @@ -1580,9 +1580,9 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) { color.b = cosmeticOption.currentColor.z * 255.0; color.a = cosmeticOption.currentColor.w * 255.0; - CVar_SetRGBA(cosmeticOption.cvar, color); - CVar_SetS32((cosmeticOption.rainbowCvar), 0); - CVar_SetS32((cosmeticOption.changedCvar), 1); + CVarSetColor(cosmeticOption.cvar, color); + CVarSetInteger((cosmeticOption.rainbowCvar), 0); + CVarSetInteger((cosmeticOption.changedCvar), 1); ApplyOrResetCustomGfxPatches(); SohImGui::RequestCvarSaveOnNextTick(); } @@ -1595,20 +1595,20 @@ void DrawCosmeticRow(CosmeticOption& cosmeticOption) { SohImGui::RequestCvarSaveOnNextTick(); } ImGui::SameLine(); - bool isRainbow = (bool)CVar_GetS32((cosmeticOption.rainbowCvar), 0); + bool isRainbow = (bool)CVarGetInteger((cosmeticOption.rainbowCvar), 0); if (ImGui::Checkbox(("Rainbow##" + cosmeticOption.label).c_str(), &isRainbow)) { - CVar_SetS32((cosmeticOption.rainbowCvar), isRainbow); - CVar_SetS32((cosmeticOption.changedCvar), 1); + CVarSetInteger((cosmeticOption.rainbowCvar), isRainbow); + CVarSetInteger((cosmeticOption.changedCvar), 1); ApplyOrResetCustomGfxPatches(); SohImGui::RequestCvarSaveOnNextTick(); } ImGui::SameLine(); - bool isLocked = (bool)CVar_GetS32((cosmeticOption.lockedCvar), 0); + bool isLocked = (bool)CVarGetInteger((cosmeticOption.lockedCvar), 0); if (ImGui::Checkbox(("Locked##" + cosmeticOption.label).c_str(), &isLocked)) { - CVar_SetS32((cosmeticOption.lockedCvar), isLocked); + CVarSetInteger((cosmeticOption.lockedCvar), isLocked); SohImGui::RequestCvarSaveOnNextTick(); } - if (CVar_GetS32((cosmeticOption.changedCvar), 0)) { + if (CVarGetInteger((cosmeticOption.changedCvar), 0)) { ImGui::SameLine(); if (ImGui::Button(("Reset##" + cosmeticOption.label).c_str())) { ResetColor(cosmeticOption); @@ -1624,7 +1624,7 @@ void DrawCosmeticGroup(CosmeticGroup cosmeticGroup) { ImGui::SameLine((ImGui::CalcTextSize("Mirror Shield Mirror").x * 1.0f) + 60.0f); if (ImGui::Button(("Random##" + label).c_str())) { for (auto& [id, cosmeticOption] : cosmeticOptions) { - if (cosmeticOption.group == cosmeticGroup && (!cosmeticOption.advancedOption || CVar_GetS32("gCosmetics.AdvancedMode", 0)) && !CVar_GetS32(cosmeticOption.lockedCvar, 0)) { + if (cosmeticOption.group == cosmeticGroup && (!cosmeticOption.advancedOption || CVarGetInteger("gCosmetics.AdvancedMode", 0)) && !CVarGetInteger(cosmeticOption.lockedCvar, 0)) { RandomizeColor(cosmeticOption); } } @@ -1634,7 +1634,7 @@ void DrawCosmeticGroup(CosmeticGroup cosmeticGroup) { ImGui::SameLine(); if (ImGui::Button(("Reset##" + label).c_str())) { for (auto& [id, cosmeticOption] : cosmeticOptions) { - if (cosmeticOption.group == cosmeticGroup && !CVar_GetS32(cosmeticOption.lockedCvar, 0)) { + if (cosmeticOption.group == cosmeticGroup && !CVarGetInteger(cosmeticOption.lockedCvar, 0)) { ResetColor(cosmeticOption); } } @@ -1642,7 +1642,7 @@ void DrawCosmeticGroup(CosmeticGroup cosmeticGroup) { SohImGui::RequestCvarSaveOnNextTick(); } for (auto& [id, cosmeticOption] : cosmeticOptions) { - if (cosmeticOption.group == cosmeticGroup && (!cosmeticOption.advancedOption || CVar_GetS32("gCosmetics.AdvancedMode", 0))) { + if (cosmeticOption.group == cosmeticGroup && (!cosmeticOption.advancedOption || CVarGetInteger("gCosmetics.AdvancedMode", 0))) { DrawCosmeticRow(cosmeticOption); } } @@ -1655,7 +1655,7 @@ const char* colorSchemes[2] = { void DrawCosmeticsEditor(bool& open) { if (!open) { - CVar_SetS32("gCosmeticsEditorEnabled", 0); + CVarSetInteger("gCosmeticsEditorEnabled", 0); return; } @@ -1673,7 +1673,7 @@ void DrawCosmeticsEditor(bool& open) { UIWidgets::EnhancementSliderFloat("Rainbow Speed: %f", "##rainbowSpeed", "gCosmetics.RainbowSpeed", 0.03f, 1.0f, "", 0.6f, false); if (ImGui::Button("Randomize All", ImVec2(ImGui::GetContentRegionAvail().x / 2, 30.0f))) { for (auto& [id, cosmeticOption] : cosmeticOptions) { - if (!CVar_GetS32(cosmeticOption.lockedCvar, 0) && (!cosmeticOption.advancedOption || CVar_GetS32("gCosmetics.AdvancedMode", 0))) { + if (!CVarGetInteger(cosmeticOption.lockedCvar, 0) && (!cosmeticOption.advancedOption || CVarGetInteger("gCosmetics.AdvancedMode", 0))) { RandomizeColor(cosmeticOption); } } @@ -1683,7 +1683,7 @@ void DrawCosmeticsEditor(bool& open) { ImGui::SameLine(); if (ImGui::Button("Reset All", ImVec2(ImGui::GetContentRegionAvail().x, 30.0f))) { for (auto& [id, cosmeticOption] : cosmeticOptions) { - if (!CVar_GetS32(cosmeticOption.lockedCvar, 0)) { + if (!CVarGetInteger(cosmeticOption.lockedCvar, 0)) { ResetColor(cosmeticOption); } } @@ -1707,12 +1707,12 @@ void DrawCosmeticsEditor(bool& open) { DrawCosmeticGroup(GROUP_SPIN_ATTACK); DrawCosmeticGroup(GROUP_TRAILS); if (UIWidgets::EnhancementSliderInt("Trails Duration: %d", "##Trails_Duration", "gCosmetics.Trails_Duration.Value", 2, 20, "", 4, false)) { - CVar_SetS32("gCosmetics.Trails_Duration.Changed", 1); + CVarSetInteger("gCosmetics.Trails_Duration.Changed", 1); } ImGui::SameLine(); if (ImGui::Button("Reset##Trails_Duration")) { - CVar_Clear("gCosmetics.Trails_Duration.Value"); - CVar_Clear("gCosmetics.Trails_Duration.Changed"); + CVarClear("gCosmetics.Trails_Duration.Value"); + CVarClear("gCosmetics.Trails_Duration.Changed"); SohImGui::RequestCvarSaveOnNextTick(); } ImGui::EndTabItem(); @@ -1751,7 +1751,7 @@ void InitCosmeticsEditor() { // Convert the `current color` into the format that the ImGui color picker expects for (auto& [id, cosmeticOption] : cosmeticOptions) { Color_RGBA8 defaultColor = {cosmeticOption.defaultColor.x, cosmeticOption.defaultColor.y, cosmeticOption.defaultColor.z, cosmeticOption.defaultColor.w}; - Color_RGBA8 cvarColor = CVar_GetRGBA(cosmeticOption.cvar, defaultColor); + Color_RGBA8 cvarColor = CVarGetColor(cosmeticOption.cvar, defaultColor); cosmeticOption.currentColor.x = cvarColor.r / 255.0; cosmeticOption.currentColor.y = cvarColor.g / 255.0; diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.h b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.h index a74bf784e..e0e17929a 100644 --- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.h +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.h @@ -2,7 +2,7 @@ #include #define PATCH_GFX(path, name, cvar, index, instruction) \ - if (CVar_GetS32(cvar, 0)) { \ + if (CVarGetInteger(cvar, 0)) { \ ResourceMgr_PatchGfxByName(path, name, index, instruction); \ } else { \ ResourceMgr_UnpatchGfxByName(path, name); \ diff --git a/soh/soh/Enhancements/crowd-control/CrowdControl.cpp b/soh/soh/Enhancements/crowd-control/CrowdControl.cpp index 2f5b1a3ac..01c6937a5 100644 --- a/soh/soh/Enhancements/crowd-control/CrowdControl.cpp +++ b/soh/soh/Enhancements/crowd-control/CrowdControl.cpp @@ -1,7 +1,7 @@ #ifdef ENABLE_CROWD_CONTROL #include "CrowdControl.h" -#include +#include #include #include #include diff --git a/soh/soh/Enhancements/debugconsole.cpp b/soh/soh/Enhancements/debugconsole.cpp index 1a1142633..cbb629d01 100644 --- a/soh/soh/Enhancements/debugconsole.cpp +++ b/soh/soh/Enhancements/debugconsole.cpp @@ -27,7 +27,7 @@ extern "C" { extern PlayState* gPlayState; } -#include +#include #include "overlays/actors/ovl_En_Niw/z_en_niw.h" #define CMD_REGISTER SohImGui::GetConsole()->AddCommand @@ -944,9 +944,9 @@ static bool SetCVarHandler(std::shared_ptr Console, const std::ve int vType = CheckVarType(args[2]); if (vType == VARTYPE_STRING) - CVar_SetString(args[1].c_str(), args[2].c_str()); + CVarSetString(args[1].c_str(), args[2].c_str()); else if (vType == VARTYPE_FLOAT) - CVar_SetFloat((char*)args[1].c_str(), std::stof(args[2])); + CVarSetFloat((char*)args[1].c_str(), std::stof(args[2])); else if (vType == VARTYPE_RGBA) { uint32_t val = std::stoul(&args[2].c_str()[1], nullptr, 16); @@ -955,12 +955,12 @@ static bool SetCVarHandler(std::shared_ptr Console, const std::ve clr.g = val >> 16; clr.b = val >> 8; clr.a = val & 0xFF; - CVar_SetRGBA((char*)args[1].c_str(), clr); + CVarSetColor((char*)args[1].c_str(), clr); } else - CVar_SetS32(args[1].c_str(), std::stoi(args[2])); + CVarSetInteger(args[1].c_str(), std::stoi(args[2])); - CVar_Save(); + CVarSave(); //SohImGui::GetConsole()->SendInfoMessage("[SOH] Updated player position to [ %.2f, %.2f, %.2f ]", pos.x, pos.y, pos.z); return CMD_SUCCESS; @@ -970,18 +970,18 @@ static bool GetCVarHandler(std::shared_ptr Console, const std::ve if (args.size() < 2) return CMD_FAILED; - CVar* cvar = CVar_Get(args[1].c_str()); + auto cvar = CVarGet(args[1].c_str()); if (cvar != nullptr) { - if (cvar->Type == CVarType::S32) - SohImGui::GetConsole()->SendInfoMessage("[SOH] Variable %s is %i", args[1].c_str(), cvar->value.ValueS32); - else if (cvar->Type == CVarType::Float) - SohImGui::GetConsole()->SendInfoMessage("[SOH] Variable %s is %f", args[1].c_str(), cvar->value.ValueFloat); - else if (cvar->Type == CVarType::String) - SohImGui::GetConsole()->SendInfoMessage("[SOH] Variable %s is %s", args[1].c_str(), cvar->value.ValueStr); - else if (cvar->Type == CVarType::RGBA) - SohImGui::GetConsole()->SendInfoMessage("[SOH] Variable %s is %08X", args[1].c_str(), cvar->value.ValueRGBA); + if (cvar->Type == Ship::ConsoleVariableType::Integer) + SohImGui::GetConsole()->SendInfoMessage("[SOH] Variable %s is %i", args[1].c_str(), cvar->Integer); + else if (cvar->Type == Ship::ConsoleVariableType::Float) + SohImGui::GetConsole()->SendInfoMessage("[SOH] Variable %s is %f", args[1].c_str(), cvar->Float); + else if (cvar->Type == Ship::ConsoleVariableType::String) + SohImGui::GetConsole()->SendInfoMessage("[SOH] Variable %s is %s", args[1].c_str(), cvar->String.c_str()); + else if (cvar->Type == Ship::ConsoleVariableType::Color) + SohImGui::GetConsole()->SendInfoMessage("[SOH] Variable %s is %08X", args[1].c_str(), cvar->Color); } else { @@ -1159,5 +1159,5 @@ void DebugConsole_Init(void) { CMD_REGISTER("cucco_storm", { CuccoStormHandler, "Cucco Storm" }); - CVar_Load(); + CVarLoad(); } diff --git a/soh/soh/Enhancements/debugger/actorViewer.cpp b/soh/soh/Enhancements/debugger/actorViewer.cpp index c6f99c930..31ce27236 100644 --- a/soh/soh/Enhancements/debugger/actorViewer.cpp +++ b/soh/soh/Enhancements/debugger/actorViewer.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include extern "C" { #include @@ -531,7 +531,7 @@ void PopulateActorDropdown(int i, std::vector& data) { void DrawActorViewer(bool& open) { if (!open) { - CVar_SetS32("gActorViewerEnabled", 0); + CVarSetInteger("gActorViewerEnabled", 0); return; } diff --git a/soh/soh/Enhancements/debugger/colViewer.cpp b/soh/soh/Enhancements/debugger/colViewer.cpp index f51fa2078..3cb81f0b7 100644 --- a/soh/soh/Enhancements/debugger/colViewer.cpp +++ b/soh/soh/Enhancements/debugger/colViewer.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include extern "C" { #include @@ -53,7 +53,7 @@ static std::vector sphereVtx; // Draws the ImGui window for the collision viewer void DrawColViewerWindow(bool& open) { if (!open) { - CVar_SetS32("gCollisionViewerEnabled", 0); + CVarSetInteger("gCollisionViewerEnabled", 0); return; } @@ -315,7 +315,7 @@ void InitGfx(std::vector& gfx, ColRenderSetting setting) { alpha = 0xFF; } - if (CVar_GetS32("gColViewerDecal", 0) != 0) { + if (CVarGetInteger("gColViewerDecal", 0) != 0) { rm |= ZMODE_DEC; } else if (setting == ColRenderSetting::Transparent) { rm |= ZMODE_XLU; @@ -327,7 +327,7 @@ void InitGfx(std::vector& gfx, ColRenderSetting setting) { gfx.push_back(gsDPSetCycleType(G_CYC_1CYCLE)); gfx.push_back(gsDPSetRenderMode(rm | blc1, rm | blc2)); - if (CVar_GetS32("gColViewerShaded", 0) != 0) { + if (CVarGetInteger("gColViewerShaded", 0) != 0) { gfx.push_back(gsDPSetCombineMode(G_CC_MODULATERGB_PRIM_ENVA, G_CC_MODULATERGB_PRIM_ENVA)); gfx.push_back(gsSPLoadGeometryMode(G_CULL_BACK | G_ZBUFFER | G_LIGHTING)); } else { @@ -340,9 +340,9 @@ void InitGfx(std::vector& gfx, ColRenderSetting setting) { // Draws a dynapoly structure (scenes or Bg Actors) void DrawDynapoly(std::vector& dl, CollisionHeader* col, int32_t bgId) { - uint32_t colorR = CVar_GetS32("gColViewerColorNormalR", 255); - uint32_t colorG = CVar_GetS32("gColViewerColorNormalG", 255); - uint32_t colorB = CVar_GetS32("gColViewerColorNormalB", 255); + uint32_t colorR = CVarGetInteger("gColViewerColorNormalR", 255); + uint32_t colorG = CVarGetInteger("gColViewerColorNormalG", 255); + uint32_t colorB = CVarGetInteger("gColViewerColorNormalB", 255); uint32_t colorA = 255; uint32_t lastColorR = colorR; @@ -359,35 +359,35 @@ void DrawDynapoly(std::vector& dl, CollisionHeader* col, int32_t bgId) { CollisionPoly* poly = &col->polyList[i]; if (SurfaceType_IsHookshotSurface(&gPlayState->colCtx, poly, bgId)) { - colorR = CVar_GetS32("gColViewerColorHookshotR", 128); - colorG = CVar_GetS32("gColViewerColorHookshotG", 128); - colorB = CVar_GetS32("gColViewerColorHookshotB", 255); + colorR = CVarGetInteger("gColViewerColorHookshotR", 128); + colorG = CVarGetInteger("gColViewerColorHookshotG", 128); + colorB = CVarGetInteger("gColViewerColorHookshotB", 255); } else if (func_80041D94(&gPlayState->colCtx, poly, bgId) > 0x01) { - colorR = CVar_GetS32("gColViewerColorInteractableR", 192); - colorG = CVar_GetS32("gColViewerColorInteractableG", 0); - colorB = CVar_GetS32("gColViewerColorInteractableB", 192); + colorR = CVarGetInteger("gColViewerColorInteractableR", 192); + colorG = CVarGetInteger("gColViewerColorInteractableG", 0); + colorB = CVarGetInteger("gColViewerColorInteractableB", 192); } else if (func_80041E80(&gPlayState->colCtx, poly, bgId) == 0x0C) { - colorR = CVar_GetS32("gColViewerColorVoidR", 255); - colorG = CVar_GetS32("gColViewerColorVoidG", 0); - colorB = CVar_GetS32("gColViewerColorVoidB", 0); + colorR = CVarGetInteger("gColViewerColorVoidR", 255); + colorG = CVarGetInteger("gColViewerColorVoidG", 0); + colorB = CVarGetInteger("gColViewerColorVoidB", 0); } else if (SurfaceType_GetSceneExitIndex(&gPlayState->colCtx, poly, bgId) || func_80041E80(&gPlayState->colCtx, poly, bgId) == 0x05) { - colorR = CVar_GetS32("gColViewerColorEntranceR", 0); - colorG = CVar_GetS32("gColViewerColorEntranceG", 255); - colorB = CVar_GetS32("gColViewerColorEntranceB", 0); + colorR = CVarGetInteger("gColViewerColorEntranceR", 0); + colorG = CVarGetInteger("gColViewerColorEntranceG", 255); + colorB = CVarGetInteger("gColViewerColorEntranceB", 0); } else if (func_80041D4C(&gPlayState->colCtx, poly, bgId) != 0 || SurfaceType_IsWallDamage(&gPlayState->colCtx, poly, bgId)) { - colorR = CVar_GetS32("gColViewerColorSpecialSurfaceR", 192); - colorG = CVar_GetS32("gColViewerColorSpecialSurfaceG", 255); - colorB = CVar_GetS32("gColViewerColorSpecialSurfaceB", 192); + colorR = CVarGetInteger("gColViewerColorSpecialSurfaceR", 192); + colorG = CVarGetInteger("gColViewerColorSpecialSurfaceG", 255); + colorB = CVarGetInteger("gColViewerColorSpecialSurfaceB", 192); } else if (SurfaceType_GetSlope(&gPlayState->colCtx, poly, bgId) == 0x01) { - colorR = CVar_GetS32("gColViewerColorSlopeR", 255); - colorG = CVar_GetS32("gColViewerColorSlopeG", 255); - colorB = CVar_GetS32("gColViewerColorSlopeB", 128); + colorR = CVarGetInteger("gColViewerColorSlopeR", 255); + colorG = CVarGetInteger("gColViewerColorSlopeG", 255); + colorB = CVarGetInteger("gColViewerColorSlopeB", 128); } else { - colorR = CVar_GetS32("gColViewerColorNormalR", 255); - colorG = CVar_GetS32("gColViewerColorNormalG", 255); - colorB = CVar_GetS32("gColViewerColorNormalB", 255); + colorR = CVarGetInteger("gColViewerColorNormalR", 255); + colorG = CVarGetInteger("gColViewerColorNormalG", 255); + colorB = CVarGetInteger("gColViewerColorNormalB", 255); } if (colorR != lastColorR || colorG != lastColorG || colorB != lastColorB) { @@ -435,9 +435,9 @@ void DrawDynapoly(std::vector& dl, CollisionHeader* col, int32_t bgId) { // Draws the scene void DrawSceneCollision() { - ColRenderSetting showSceneColSetting = (ColRenderSetting)CVar_GetS32("gColViewerScene", 0); + ColRenderSetting showSceneColSetting = (ColRenderSetting)CVarGetInteger("gColViewerScene", 0); - if (showSceneColSetting == ColRenderSetting::Disabled || CVar_GetS32("gColViewerEnabled", 0) == 0) { + if (showSceneColSetting == ColRenderSetting::Disabled || CVarGetInteger("gColViewerEnabled", 0) == 0) { return; } @@ -450,8 +450,8 @@ void DrawSceneCollision() { // Draws all Bg Actors void DrawBgActorCollision() { - ColRenderSetting showBgActorSetting = (ColRenderSetting)CVar_GetS32("gColViewerBgActors", 0); - if (showBgActorSetting == ColRenderSetting::Disabled || CVar_GetS32("gColViewerEnabled", 0) == 0) { + ColRenderSetting showBgActorSetting = (ColRenderSetting)CVarGetInteger("gColViewerBgActors", 0); + if (showBgActorSetting == ColRenderSetting::Disabled || CVarGetInteger("gColViewerEnabled", 0) == 0) { return; } @@ -575,8 +575,8 @@ void DrawColCheckList(std::vector& dl, Collider** objects, int32_t count) { // Draws all Col Check objects void DrawColCheckCollision() { - ColRenderSetting showColCheckSetting = (ColRenderSetting)CVar_GetS32("gColViewerColCheck", 0); - if (showColCheckSetting == ColRenderSetting::Disabled || CVar_GetS32("gColViewerEnabled", 0) == 0) { + ColRenderSetting showColCheckSetting = (ColRenderSetting)CVarGetInteger("gColViewerColCheck", 0); + if (showColCheckSetting == ColRenderSetting::Disabled || CVarGetInteger("gColViewerEnabled", 0) == 0) { return; } @@ -586,14 +586,14 @@ void DrawColCheckCollision() { CollisionCheckContext& col = gPlayState->colChkCtx; - dl.push_back(gsDPSetPrimColor(0, 0, CVar_GetS32("gColViewerColorOCR", 255), CVar_GetS32("gColViewerColorOCG", 255), - CVar_GetS32("gColViewerColorOCB", 255), 255)); + dl.push_back(gsDPSetPrimColor(0, 0, CVarGetInteger("gColViewerColorOCR", 255), CVarGetInteger("gColViewerColorOCG", 255), + CVarGetInteger("gColViewerColorOCB", 255), 255)); DrawColCheckList(dl, col.colOC, col.colOCCount); - dl.push_back(gsDPSetPrimColor(0, 0, CVar_GetS32("gColViewerColorACR", 0), CVar_GetS32("gColViewerColorACG", 0), - CVar_GetS32("gColViewerColorACB", 255), 255)); + dl.push_back(gsDPSetPrimColor(0, 0, CVarGetInteger("gColViewerColorACR", 0), CVarGetInteger("gColViewerColorACG", 0), + CVarGetInteger("gColViewerColorACB", 255), 255)); DrawColCheckList(dl, col.colAC, col.colACCount); - dl.push_back(gsDPSetPrimColor(0, 0, CVar_GetS32("gColViewerColorATR", 255), CVar_GetS32("gColViewerColorATG", 0), - CVar_GetS32("gColViewerColorATB", 0), 255)); + dl.push_back(gsDPSetPrimColor(0, 0, CVarGetInteger("gColViewerColorATR", 255), CVarGetInteger("gColViewerColorATG", 0), + CVarGetInteger("gColViewerColorATB", 0), 255)); DrawColCheckList(dl, col.colAT, col.colATCount); } @@ -628,8 +628,8 @@ extern "C" f32 zdWaterBoxMinY; // Draws all waterboxes void DrawWaterboxList() { - ColRenderSetting showWaterboxSetting = (ColRenderSetting)CVar_GetS32("gColViewerWaterbox", 0); - if (showWaterboxSetting == ColRenderSetting::Disabled || CVar_GetS32("gColViewerEnabled", 0) == 0) { + ColRenderSetting showWaterboxSetting = (ColRenderSetting)CVarGetInteger("gColViewerWaterbox", 0); + if (showWaterboxSetting == ColRenderSetting::Disabled || CVarGetInteger("gColViewerEnabled", 0) == 0) { return; } @@ -637,9 +637,9 @@ void DrawWaterboxList() { InitGfx(dl, showWaterboxSetting); dl.push_back(gsSPMatrix(&gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH)); - dl.push_back(gsDPSetPrimColor(0, 0, CVar_GetS32("gColViewerColorWaterboxR", 0), - CVar_GetS32("gColViewerColorWaterboxG", 0), - CVar_GetS32("gColViewerColorWaterboxB", 255), 255)); + dl.push_back(gsDPSetPrimColor(0, 0, CVarGetInteger("gColViewerColorWaterboxR", 0), + CVarGetInteger("gColViewerColorWaterboxG", 0), + CVarGetInteger("gColViewerColorWaterboxB", 255), 255)); CollisionHeader* col = gPlayState->colCtx.colHeader; for (int32_t waterboxIndex = 0; waterboxIndex < col->numWaterBoxes; waterboxIndex++) { diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index 9764246e8..7814a5c9f 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include extern "C" { #include @@ -1622,7 +1622,7 @@ void DrawPlayerTab() { ImGui::SameLine(); ImGui::InputScalar("C Right", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[3], &one, NULL); - if (CVar_GetS32("gDpadEquips", 0)) { + if (CVarGetInteger("gDpadEquips", 0)) { ImGui::NewLine(); ImGui::Text("Current D-pad Equips"); ImGui::InputScalar("D-pad Up ", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[4], &one, NULL); // Two spaces at the end for aligning, not elegant but it's working @@ -1663,7 +1663,7 @@ void DrawPlayerTab() { void DrawSaveEditor(bool& open) { if (!open) { - CVar_SetS32("gSaveEditorEnabled", 0); + CVarSetInteger("gSaveEditorEnabled", 0); return; } diff --git a/soh/soh/Enhancements/enemyrandomizer.cpp b/soh/soh/Enhancements/enemyrandomizer.cpp index a5c0b9b6b..36bff0e37 100644 --- a/soh/soh/Enhancements/enemyrandomizer.cpp +++ b/soh/soh/Enhancements/enemyrandomizer.cpp @@ -232,7 +232,7 @@ extern "C" uint8_t GetRandomizedEnemy(PlayState* play, int16_t *actorId, f32 *po } EnemyEntry GetRandomizedEnemyEntry(uint32_t seed) { - if (CVar_GetS32("gSeededRandomizedEnemies", 0) && gSaveContext.n64ddFlag) { + if (CVarGetInteger("gSeededRandomizedEnemies", 0) && gSaveContext.n64ddFlag) { uint32_t finalSeed = seed + gSaveContext.seedIcons[0] + gSaveContext.seedIcons[1] + gSaveContext.seedIcons[2] + gSaveContext.seedIcons[3] + gSaveContext.seedIcons[4]; Random_Init(finalSeed); diff --git a/soh/soh/Enhancements/enemyrandomizer.h b/soh/soh/Enhancements/enemyrandomizer.h index 78ad2508d..cc68f9418 100644 --- a/soh/soh/Enhancements/enemyrandomizer.h +++ b/soh/soh/Enhancements/enemyrandomizer.h @@ -1,6 +1,6 @@ #pragma once -#include +#include typedef struct EnemyEntry { int16_t id; diff --git a/soh/soh/Enhancements/gameconsole.c b/soh/soh/Enhancements/gameconsole.c index 4c2551bbf..da0c7cf97 100644 --- a/soh/soh/Enhancements/gameconsole.c +++ b/soh/soh/Enhancements/gameconsole.c @@ -2,15 +2,15 @@ #include "../OTRGlobals.h" #include #include -#include +#include #include #include #include #include #include -#include -#include -#include +#include +#include +#include #include /* memcpy */ #include #include diff --git a/soh/soh/Enhancements/gameconsole.h b/soh/soh/Enhancements/gameconsole.h index 26dbc4d18..e9a3634a1 100644 --- a/soh/soh/Enhancements/gameconsole.h +++ b/soh/soh/Enhancements/gameconsole.h @@ -1,9 +1,9 @@ #ifndef _GAMECONSOLE_H_ #define _GAMECONSOLE_H_ -#include +#include #include -#include +#include #define MAX_CVARS 2048 diff --git a/soh/soh/Enhancements/gameplaystats.cpp b/soh/soh/Enhancements/gameplaystats.cpp index 9cc808bc2..c74bdc95d 100644 --- a/soh/soh/Enhancements/gameplaystats.cpp +++ b/soh/soh/Enhancements/gameplaystats.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include extern "C" { @@ -110,7 +110,7 @@ void DisplayStatIfNonZero(const char* text, uint32_t value) { void DrawStatsTracker(bool& open) { if (!open) { - CVar_SetS32("gGameplayStatsEnabled", 0); + CVarSetInteger("gGameplayStatsEnabled", 0); return; } @@ -294,7 +294,7 @@ void DrawStatsTracker(bool& open) { DisplayStat("Sword Swings: ", gSaveContext.sohStats.count[COUNT_SWORD_SWINGS]); DisplayStat("Steps Taken: ", gSaveContext.sohStats.count[COUNT_STEPS]); // If using MM Bunny Hood enhancement, show how long it's been equipped (not counting pause time) - if (CVar_GetS32("gMMBunnyHood", 0) || gSaveContext.sohStats.count[COUNT_TIME_BUNNY_HOOD] > 0) { + if (CVarGetInteger("gMMBunnyHood", 0) || gSaveContext.sohStats.count[COUNT_TIME_BUNNY_HOOD] > 0) { DisplayTimeHHMMSS(gSaveContext.sohStats.count[COUNT_TIME_BUNNY_HOOD] / 2, "Bunny Hood Time: ", COLOR_WHITE); } DisplayStat("Rolls: ", gSaveContext.sohStats.count[COUNT_ROLLS]); diff --git a/soh/soh/Enhancements/presets.cpp b/soh/soh/Enhancements/presets.cpp index 91d5c323a..106ddc3cb 100644 --- a/soh/soh/Enhancements/presets.cpp +++ b/soh/soh/Enhancements/presets.cpp @@ -3,12 +3,12 @@ #include #include #include -#include +#include #include "soh/UIWidgets.hpp" void clearCvars(std::vector cvarsToClear) { for(const char* cvar : cvarsToClear) { - CVar_Clear(cvar); + CVarClear(cvar); } } @@ -16,13 +16,13 @@ void applyPreset(std::vector entries) { for(auto& [cvar, type, value] : entries) { switch (type) { case PRESET_ENTRY_TYPE_S32: - CVar_SetS32(cvar, std::get(value)); + CVarSetInteger(cvar, std::get(value)); break; case PRESET_ENTRY_TYPE_FLOAT: - CVar_SetFloat(cvar, std::get(value)); + CVarSetFloat(cvar, std::get(value)); break; case PRESET_ENTRY_TYPE_STRING: - CVar_SetString(cvar, std::get(value)); + CVarSetString(cvar, std::get(value)); break; } } @@ -31,7 +31,7 @@ void applyPreset(std::vector entries) { void DrawPresetSelector(PresetType presetTypeId) { const std::string presetTypeCvar = "gPreset" + std::to_string(presetTypeId); const PresetTypeDefinition presetTypeDef = presetTypes.at(presetTypeId); - const uint16_t selectedPresetId = CVar_GetS32(presetTypeCvar.c_str(), 0); + const uint16_t selectedPresetId = CVarGetInteger(presetTypeCvar.c_str(), 0); const PresetDefinition selectedPresetDef = presetTypeDef.presets.at(selectedPresetId); std::string comboboxTooltip = ""; for ( auto iter = presetTypeDef.presets.begin(); iter != presetTypeDef.presets.end(); ++iter ) { @@ -43,7 +43,7 @@ void DrawPresetSelector(PresetType presetTypeId) { if (ImGui::BeginCombo("##PresetsComboBox", selectedPresetDef.label)) { for ( auto iter = presetTypeDef.presets.begin(); iter != presetTypeDef.presets.end(); ++iter ) { if (ImGui::Selectable(iter->second.label, iter->first == selectedPresetId)) { - CVar_SetS32(presetTypeCvar.c_str(), iter->first); + CVarSetInteger(presetTypeCvar.c_str(), iter->first); } } diff --git a/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp b/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp index c2111e295..c7114dd37 100644 --- a/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp @@ -5,9 +5,9 @@ #include "location_access.hpp" #include "rando_main.hpp" // #include -#include +#include #include -#include +#include #define TICKS_PER_SEC 268123480.0 @@ -17,14 +17,14 @@ void RandoMain::GenerateRando(std::unordered_map cvarS LocationTable_Init(); // std::string settingsFileName = "./randomizer/latest_settings.json"; - // CVar_SetString("gLoadedPreset", settingsFileName.c_str()); + // CVarSetString("gLoadedPreset", settingsFileName.c_str()); std::string fileName = Ship::Window::GetPathRelativeToAppDirectory(GenerateRandomizer(cvarSettings, excludedLocations).c_str()); - CVar_SetString("gSpoilerLog", fileName.c_str()); + CVarSetString("gSpoilerLog", fileName.c_str()); - CVar_Save(); - CVar_Load(); - CVar_SetS32("gNewSeedGenerated", 1); + CVarSave(); + CVarLoad(); + CVarSetInteger("gNewSeedGenerated", 1); } std::array* RandoMain::GetFullItemTable() { diff --git a/soh/soh/Enhancements/randomizer/draw.cpp b/soh/soh/Enhancements/randomizer/draw.cpp index 46b717801..eb83f1bfb 100644 --- a/soh/soh/Enhancements/randomizer/draw.cpp +++ b/soh/soh/Enhancements/randomizer/draw.cpp @@ -1,4 +1,4 @@ -#include +#include #include "draw.h" #include "z64.h" #include "macros.h" @@ -12,7 +12,7 @@ extern "C" void Randomizer_DrawSmallKey(PlayState* play, GetItemEntry* getItemEntry) { s32 pad; - s8 isColoredKeysEnabled = CVar_GetS32("gRandoMatchKeyColors", 0); + s8 isColoredKeysEnabled = CVarGetInteger("gRandoMatchKeyColors", 0); s16 color_slot = getItemEntry->getItemId - RG_FOREST_TEMPLE_SMALL_KEY; s16 colors[9][3] = { { 4, 195, 46 }, // Forest Temple @@ -49,7 +49,7 @@ extern "C" void Randomizer_DrawSmallKey(PlayState* play, GetItemEntry* getItemEn extern "C" void Randomizer_DrawBossKey(PlayState* play, GetItemEntry* getItemEntry) { s32 pad; - s8 isColoredKeysEnabled = CVar_GetS32("gRandoMatchKeyColors", 0); + s8 isColoredKeysEnabled = CVarGetInteger("gRandoMatchKeyColors", 0); s16 color_slot; color_slot = getItemEntry->getItemId - RG_FOREST_TEMPLE_BOSS_KEY; s16 colors[6][3] = { diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index c72fbde1b..362472ddb 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include @@ -2643,112 +2643,112 @@ RandomizerCheck Randomizer::GetCheckFromRandomizerInf(RandomizerInf randomizerIn std::thread randoThread; void GenerateRandomizerImgui() { - CVar_SetS32("gRandoGenerating", 1); - CVar_Save(); + CVarSetInteger("gRandoGenerating", 1); + CVarSave(); std::unordered_map cvarSettings; - cvarSettings[RSK_LOGIC_RULES] = CVar_GetS32("gRandomizeLogicRules", RO_LOGIC_GLITCHLESS); - cvarSettings[RSK_ALL_LOCATIONS_REACHABLE] = CVar_GetS32("gRandomizeAllLocationsReachable", RO_GENERIC_ON); - cvarSettings[RSK_FOREST] = CVar_GetS32("gRandomizeForest", RO_FOREST_CLOSED); - cvarSettings[RSK_KAK_GATE] = CVar_GetS32("gRandomizeKakarikoGate", RO_KAK_GATE_CLOSED); - cvarSettings[RSK_DOOR_OF_TIME] = CVar_GetS32("gRandomizeDoorOfTime", RO_DOOROFTIME_CLOSED); - cvarSettings[RSK_ZORAS_FOUNTAIN] = CVar_GetS32("gRandomizeZorasFountain", 0); - cvarSettings[RSK_STARTING_AGE] = CVar_GetS32("gRandomizeStartingAge", RO_AGE_CHILD); - cvarSettings[RSK_GERUDO_FORTRESS] = CVar_GetS32("gRandomizeGerudoFortress", RO_GF_NORMAL); - cvarSettings[RSK_RAINBOW_BRIDGE] = CVar_GetS32("gRandomizeRainbowBridge", RO_BRIDGE_VANILLA); - cvarSettings[RSK_RAINBOW_BRIDGE_STONE_COUNT] = CVar_GetS32("gRandomizeStoneCount", 3); - cvarSettings[RSK_RAINBOW_BRIDGE_MEDALLION_COUNT] = CVar_GetS32("gRandomizeMedallionCount", 6); - cvarSettings[RSK_RAINBOW_BRIDGE_REWARD_COUNT] = CVar_GetS32("gRandomizeRewardCount", 9); - cvarSettings[RSK_RAINBOW_BRIDGE_DUNGEON_COUNT] = CVar_GetS32("gRandomizeDungeonCount", 8); - cvarSettings[RSK_RAINBOW_BRIDGE_TOKEN_COUNT] = CVar_GetS32("gRandomizeTokenCount", 100); - cvarSettings[RSK_GANONS_TRIALS] = CVar_GetS32("gRandomizeGanonTrial", RO_GANONS_TRIALS_SET_NUMBER); - cvarSettings[RSK_TRIAL_COUNT] = CVar_GetS32("gRandomizeGanonTrialCount", 6); - cvarSettings[RSK_STARTING_OCARINA] = CVar_GetS32("gRandomizeStartingOcarina", 0); - cvarSettings[RSK_SHUFFLE_OCARINA] = CVar_GetS32("gRandomizeShuffleOcarinas", 0) || - CVar_GetS32("gRandomizeStartingOcarina", 0); - cvarSettings[RSK_STARTING_KOKIRI_SWORD] = CVar_GetS32("gRandomizeStartingKokiriSword", 0); - cvarSettings[RSK_SHUFFLE_KOKIRI_SWORD] = CVar_GetS32("gRandomizeShuffleKokiriSword", 0) || - CVar_GetS32("gRandomizeStartingKokiriSword", 0); - cvarSettings[RSK_STARTING_DEKU_SHIELD] = CVar_GetS32("gRandomizeStartingDekuShield", 0); - cvarSettings[RSK_STARTING_SKULLTULA_TOKEN] = CVar_GetS32("gRandomizeStartingSkulltulaToken", 0); - cvarSettings[RSK_STARTING_MAPS_COMPASSES] = CVar_GetS32("gRandomizeStartingMapsCompasses", RO_DUNGEON_ITEM_LOC_OWN_DUNGEON); - cvarSettings[RSK_SHUFFLE_DUNGEON_REWARDS] = CVar_GetS32("gRandomizeShuffleDungeonReward", RO_DUNGEON_REWARDS_END_OF_DUNGEON); - cvarSettings[RSK_SHUFFLE_SONGS] = CVar_GetS32("gRandomizeShuffleSongs", RO_SONG_SHUFFLE_SONG_LOCATIONS); - cvarSettings[RSK_SHUFFLE_TOKENS] = CVar_GetS32("gRandomizeShuffleTokens", RO_TOKENSANITY_OFF); - cvarSettings[RSK_SHOPSANITY] = CVar_GetS32("gRandomizeShopsanity", RO_SHOPSANITY_OFF); - cvarSettings[RSK_SHUFFLE_SCRUBS] = CVar_GetS32("gRandomizeShuffleScrubs", RO_SCRUBS_OFF); - cvarSettings[RSK_SHUFFLE_COWS] = CVar_GetS32("gRandomizeShuffleCows", 0); - cvarSettings[RSK_SHUFFLE_ADULT_TRADE] = CVar_GetS32("gRandomizeShuffleAdultTrade", 0); - cvarSettings[RSK_SHUFFLE_MAGIC_BEANS] = CVar_GetS32("gRandomizeShuffleBeans", 0); - cvarSettings[RSK_SHUFFLE_MERCHANTS] = CVar_GetS32("gRandomizeShuffleMerchants", RO_SHUFFLE_MERCHANTS_OFF); - cvarSettings[RSK_ENABLE_BOMBCHU_DROPS] = CVar_GetS32("gRandomizeEnableBombchuDrops", 0); - cvarSettings[RSK_BOMBCHUS_IN_LOGIC] = CVar_GetS32("gRandomizeBombchusInLogic", 0); - cvarSettings[RSK_SKIP_CHILD_ZELDA] = CVar_GetS32("gRandomizeSkipChildZelda", 0); + cvarSettings[RSK_LOGIC_RULES] = CVarGetInteger("gRandomizeLogicRules", RO_LOGIC_GLITCHLESS); + cvarSettings[RSK_ALL_LOCATIONS_REACHABLE] = CVarGetInteger("gRandomizeAllLocationsReachable", RO_GENERIC_ON); + cvarSettings[RSK_FOREST] = CVarGetInteger("gRandomizeForest", RO_FOREST_CLOSED); + cvarSettings[RSK_KAK_GATE] = CVarGetInteger("gRandomizeKakarikoGate", RO_KAK_GATE_CLOSED); + cvarSettings[RSK_DOOR_OF_TIME] = CVarGetInteger("gRandomizeDoorOfTime", RO_DOOROFTIME_CLOSED); + cvarSettings[RSK_ZORAS_FOUNTAIN] = CVarGetInteger("gRandomizeZorasFountain", 0); + cvarSettings[RSK_STARTING_AGE] = CVarGetInteger("gRandomizeStartingAge", RO_AGE_CHILD); + cvarSettings[RSK_GERUDO_FORTRESS] = CVarGetInteger("gRandomizeGerudoFortress", RO_GF_NORMAL); + cvarSettings[RSK_RAINBOW_BRIDGE] = CVarGetInteger("gRandomizeRainbowBridge", RO_BRIDGE_VANILLA); + cvarSettings[RSK_RAINBOW_BRIDGE_STONE_COUNT] = CVarGetInteger("gRandomizeStoneCount", 3); + cvarSettings[RSK_RAINBOW_BRIDGE_MEDALLION_COUNT] = CVarGetInteger("gRandomizeMedallionCount", 6); + cvarSettings[RSK_RAINBOW_BRIDGE_REWARD_COUNT] = CVarGetInteger("gRandomizeRewardCount", 9); + cvarSettings[RSK_RAINBOW_BRIDGE_DUNGEON_COUNT] = CVarGetInteger("gRandomizeDungeonCount", 8); + cvarSettings[RSK_RAINBOW_BRIDGE_TOKEN_COUNT] = CVarGetInteger("gRandomizeTokenCount", 100); + cvarSettings[RSK_GANONS_TRIALS] = CVarGetInteger("gRandomizeGanonTrial", RO_GANONS_TRIALS_SET_NUMBER); + cvarSettings[RSK_TRIAL_COUNT] = CVarGetInteger("gRandomizeGanonTrialCount", 6); + cvarSettings[RSK_STARTING_OCARINA] = CVarGetInteger("gRandomizeStartingOcarina", 0); + cvarSettings[RSK_SHUFFLE_OCARINA] = CVarGetInteger("gRandomizeShuffleOcarinas", 0) || + CVarGetInteger("gRandomizeStartingOcarina", 0); + cvarSettings[RSK_STARTING_KOKIRI_SWORD] = CVarGetInteger("gRandomizeStartingKokiriSword", 0); + cvarSettings[RSK_SHUFFLE_KOKIRI_SWORD] = CVarGetInteger("gRandomizeShuffleKokiriSword", 0) || + CVarGetInteger("gRandomizeStartingKokiriSword", 0); + cvarSettings[RSK_STARTING_DEKU_SHIELD] = CVarGetInteger("gRandomizeStartingDekuShield", 0); + cvarSettings[RSK_STARTING_SKULLTULA_TOKEN] = CVarGetInteger("gRandomizeStartingSkulltulaToken", 0); + cvarSettings[RSK_STARTING_MAPS_COMPASSES] = CVarGetInteger("gRandomizeStartingMapsCompasses", RO_DUNGEON_ITEM_LOC_OWN_DUNGEON); + cvarSettings[RSK_SHUFFLE_DUNGEON_REWARDS] = CVarGetInteger("gRandomizeShuffleDungeonReward", RO_DUNGEON_REWARDS_END_OF_DUNGEON); + cvarSettings[RSK_SHUFFLE_SONGS] = CVarGetInteger("gRandomizeShuffleSongs", RO_SONG_SHUFFLE_SONG_LOCATIONS); + cvarSettings[RSK_SHUFFLE_TOKENS] = CVarGetInteger("gRandomizeShuffleTokens", RO_TOKENSANITY_OFF); + cvarSettings[RSK_SHOPSANITY] = CVarGetInteger("gRandomizeShopsanity", RO_SHOPSANITY_OFF); + cvarSettings[RSK_SHUFFLE_SCRUBS] = CVarGetInteger("gRandomizeShuffleScrubs", RO_SCRUBS_OFF); + cvarSettings[RSK_SHUFFLE_COWS] = CVarGetInteger("gRandomizeShuffleCows", 0); + cvarSettings[RSK_SHUFFLE_ADULT_TRADE] = CVarGetInteger("gRandomizeShuffleAdultTrade", 0); + cvarSettings[RSK_SHUFFLE_MAGIC_BEANS] = CVarGetInteger("gRandomizeShuffleBeans", 0); + cvarSettings[RSK_SHUFFLE_MERCHANTS] = CVarGetInteger("gRandomizeShuffleMerchants", RO_SHUFFLE_MERCHANTS_OFF); + cvarSettings[RSK_ENABLE_BOMBCHU_DROPS] = CVarGetInteger("gRandomizeEnableBombchuDrops", 0); + cvarSettings[RSK_BOMBCHUS_IN_LOGIC] = CVarGetInteger("gRandomizeBombchusInLogic", 0); + cvarSettings[RSK_SKIP_CHILD_ZELDA] = CVarGetInteger("gRandomizeSkipChildZelda", 0); // if we skip child zelda, we start with zelda's letter, and malon starts // at the ranch, so we should *not* shuffle the weird egg - cvarSettings[RSK_SHUFFLE_WEIRD_EGG] = ((CVar_GetS32("gRandomizeSkipChildZelda", 0) == 0) && - CVar_GetS32("gRandomizeShuffleWeirdEgg", 0)); + cvarSettings[RSK_SHUFFLE_WEIRD_EGG] = ((CVarGetInteger("gRandomizeSkipChildZelda", 0) == 0) && + CVarGetInteger("gRandomizeShuffleWeirdEgg", 0)); - cvarSettings[RSK_SHUFFLE_GERUDO_MEMBERSHIP_CARD] = CVar_GetS32("gRandomizeShuffleGerudoToken", 0); - cvarSettings[RSK_SHUFFLE_FROG_SONG_RUPEES] = CVar_GetS32("gRandomizeShuffleFrogSongRupees", 0); - cvarSettings[RSK_ITEM_POOL] = CVar_GetS32("gRandomizeItemPool", RO_ITEM_POOL_BALANCED); - cvarSettings[RSK_ICE_TRAPS] = CVar_GetS32("gRandomizeIceTraps", RO_ICE_TRAPS_NORMAL); - cvarSettings[RSK_GOSSIP_STONE_HINTS] = CVar_GetS32("gRandomizeGossipStoneHints", RO_GOSSIP_STONES_NEED_NOTHING); - cvarSettings[RSK_HINT_CLARITY] = CVar_GetS32("gRandomizeHintClarity", RO_HINT_CLARITY_CLEAR); - cvarSettings[RSK_HINT_DISTRIBUTION] = CVar_GetS32("gRandomizeHintDistribution", RO_HINT_DIST_BALANCED); - cvarSettings[RSK_BLUE_FIRE_ARROWS] = CVar_GetS32("gRandomizeBlueFireArrows", 0); - cvarSettings[RSK_SUNLIGHT_ARROWS] = CVar_GetS32("gRandomizeSunlightArrows", 0); - cvarSettings[RSK_KEYSANITY] = CVar_GetS32("gRandomizeKeysanity", RO_DUNGEON_ITEM_LOC_OWN_DUNGEON); - cvarSettings[RSK_GERUDO_KEYS] = CVar_GetS32("gRandomizeGerudoKeys", RO_GERUDO_KEYS_VANILLA); - cvarSettings[RSK_KEYRINGS] = CVar_GetS32("gRandomizeShuffleKeyRings", RO_KEYRINGS_OFF); - cvarSettings[RSK_KEYRINGS_RANDOM_COUNT] = CVar_GetS32("gRandomizeShuffleKeyRingsRandomCount", 8); - cvarSettings[RSK_KEYRINGS_FOREST_TEMPLE] = CVar_GetS32("gRandomizeShuffleKeyRingsForestTemple", 0); - cvarSettings[RSK_KEYRINGS_FIRE_TEMPLE] = CVar_GetS32("gRandomizeShuffleKeyRingsFireTemple", 0); - cvarSettings[RSK_KEYRINGS_WATER_TEMPLE] = CVar_GetS32("gRandomizeShuffleKeyRingsWaterTemple", 0); - cvarSettings[RSK_KEYRINGS_SPIRIT_TEMPLE] = CVar_GetS32("gRandomizeShuffleKeyRingsSpiritTemple", 0); - cvarSettings[RSK_KEYRINGS_SHADOW_TEMPLE] = CVar_GetS32("gRandomizeShuffleKeyRingsShadowTemple", 0); - cvarSettings[RSK_KEYRINGS_BOTTOM_OF_THE_WELL] = CVar_GetS32("gRandomizeShuffleKeyRingsBottomOfTheWell", 0); - cvarSettings[RSK_KEYRINGS_GTG] = CVar_GetS32("gRandomizeShuffleKeyRingsGTG", 0); - cvarSettings[RSK_KEYRINGS_GANONS_CASTLE] = CVar_GetS32("gRandomizeShuffleKeyRingsGanonsCastle", 0); - cvarSettings[RSK_BOSS_KEYSANITY] = CVar_GetS32("gRandomizeBossKeysanity", RO_DUNGEON_ITEM_LOC_OWN_DUNGEON); - cvarSettings[RSK_GANONS_BOSS_KEY] = CVar_GetS32("gRandomizeShuffleGanonBossKey", RO_GANON_BOSS_KEY_VANILLA); - cvarSettings[RSK_LACS_STONE_COUNT] = CVar_GetS32("gRandomizeLacsStoneCount", 3); - cvarSettings[RSK_LACS_MEDALLION_COUNT] = CVar_GetS32("gRandomizeLacsMedallionCount", 6); - cvarSettings[RSK_LACS_REWARD_COUNT] = CVar_GetS32("gRandomizeLacsRewardCount", 9); - cvarSettings[RSK_LACS_DUNGEON_COUNT] = CVar_GetS32("gRandomizeLacsDungeonCount", 8); - cvarSettings[RSK_LACS_TOKEN_COUNT] = CVar_GetS32("gRandomizeLacsTokenCount", 100); - cvarSettings[RSK_STARTING_CONSUMABLES] = CVar_GetS32("gRandomizeStartingConsumables", 0); - cvarSettings[RSK_FULL_WALLETS] = CVar_GetS32("gRandomizeFullWallets", 0); + cvarSettings[RSK_SHUFFLE_GERUDO_MEMBERSHIP_CARD] = CVarGetInteger("gRandomizeShuffleGerudoToken", 0); + cvarSettings[RSK_SHUFFLE_FROG_SONG_RUPEES] = CVarGetInteger("gRandomizeShuffleFrogSongRupees", 0); + cvarSettings[RSK_ITEM_POOL] = CVarGetInteger("gRandomizeItemPool", RO_ITEM_POOL_BALANCED); + cvarSettings[RSK_ICE_TRAPS] = CVarGetInteger("gRandomizeIceTraps", RO_ICE_TRAPS_NORMAL); + cvarSettings[RSK_GOSSIP_STONE_HINTS] = CVarGetInteger("gRandomizeGossipStoneHints", RO_GOSSIP_STONES_NEED_NOTHING); + cvarSettings[RSK_HINT_CLARITY] = CVarGetInteger("gRandomizeHintClarity", RO_HINT_CLARITY_CLEAR); + cvarSettings[RSK_HINT_DISTRIBUTION] = CVarGetInteger("gRandomizeHintDistribution", RO_HINT_DIST_BALANCED); + cvarSettings[RSK_BLUE_FIRE_ARROWS] = CVarGetInteger("gRandomizeBlueFireArrows", 0); + cvarSettings[RSK_SUNLIGHT_ARROWS] = CVarGetInteger("gRandomizeSunlightArrows", 0); + cvarSettings[RSK_KEYSANITY] = CVarGetInteger("gRandomizeKeysanity", RO_DUNGEON_ITEM_LOC_OWN_DUNGEON); + cvarSettings[RSK_GERUDO_KEYS] = CVarGetInteger("gRandomizeGerudoKeys", RO_GERUDO_KEYS_VANILLA); + cvarSettings[RSK_KEYRINGS] = CVarGetInteger("gRandomizeShuffleKeyRings", RO_KEYRINGS_OFF); + cvarSettings[RSK_KEYRINGS_RANDOM_COUNT] = CVarGetInteger("gRandomizeShuffleKeyRingsRandomCount", 8); + cvarSettings[RSK_KEYRINGS_FOREST_TEMPLE] = CVarGetInteger("gRandomizeShuffleKeyRingsForestTemple", 0); + cvarSettings[RSK_KEYRINGS_FIRE_TEMPLE] = CVarGetInteger("gRandomizeShuffleKeyRingsFireTemple", 0); + cvarSettings[RSK_KEYRINGS_WATER_TEMPLE] = CVarGetInteger("gRandomizeShuffleKeyRingsWaterTemple", 0); + cvarSettings[RSK_KEYRINGS_SPIRIT_TEMPLE] = CVarGetInteger("gRandomizeShuffleKeyRingsSpiritTemple", 0); + cvarSettings[RSK_KEYRINGS_SHADOW_TEMPLE] = CVarGetInteger("gRandomizeShuffleKeyRingsShadowTemple", 0); + cvarSettings[RSK_KEYRINGS_BOTTOM_OF_THE_WELL] = CVarGetInteger("gRandomizeShuffleKeyRingsBottomOfTheWell", 0); + cvarSettings[RSK_KEYRINGS_GTG] = CVarGetInteger("gRandomizeShuffleKeyRingsGTG", 0); + cvarSettings[RSK_KEYRINGS_GANONS_CASTLE] = CVarGetInteger("gRandomizeShuffleKeyRingsGanonsCastle", 0); + cvarSettings[RSK_BOSS_KEYSANITY] = CVarGetInteger("gRandomizeBossKeysanity", RO_DUNGEON_ITEM_LOC_OWN_DUNGEON); + cvarSettings[RSK_GANONS_BOSS_KEY] = CVarGetInteger("gRandomizeShuffleGanonBossKey", RO_GANON_BOSS_KEY_VANILLA); + cvarSettings[RSK_LACS_STONE_COUNT] = CVarGetInteger("gRandomizeLacsStoneCount", 3); + cvarSettings[RSK_LACS_MEDALLION_COUNT] = CVarGetInteger("gRandomizeLacsMedallionCount", 6); + cvarSettings[RSK_LACS_REWARD_COUNT] = CVarGetInteger("gRandomizeLacsRewardCount", 9); + cvarSettings[RSK_LACS_DUNGEON_COUNT] = CVarGetInteger("gRandomizeLacsDungeonCount", 8); + cvarSettings[RSK_LACS_TOKEN_COUNT] = CVarGetInteger("gRandomizeLacsTokenCount", 100); + cvarSettings[RSK_STARTING_CONSUMABLES] = CVarGetInteger("gRandomizeStartingConsumables", 0); + cvarSettings[RSK_FULL_WALLETS] = CVarGetInteger("gRandomizeFullWallets", 0); // RANDOTODO implement chest minigame shuffle with keysanity cvarSettings[RSK_SHUFFLE_CHEST_MINIGAME] = false; - cvarSettings[RSK_LANGUAGE] = CVar_GetS32("gLanguages", 0); + cvarSettings[RSK_LANGUAGE] = CVarGetInteger("gLanguages", 0); - cvarSettings[RSK_CUCCO_COUNT] = CVar_GetS32("gRandomizeCuccosToReturn", 7); - cvarSettings[RSK_BIG_POE_COUNT] = CVar_GetS32("gRandomizeBigPoeTargetCount", 10); + cvarSettings[RSK_CUCCO_COUNT] = CVarGetInteger("gRandomizeCuccosToReturn", 7); + cvarSettings[RSK_BIG_POE_COUNT] = CVarGetInteger("gRandomizeBigPoeTargetCount", 10); // If we skip child zelda, skip child stealth is pointless, so this needs to be reflected in the spoiler log cvarSettings[RSK_SKIP_CHILD_STEALTH] = - !CVar_GetS32("gRandomizeSkipChildZelda", 0) && CVar_GetS32("gRandomizeSkipChildStealth", 0); + !CVarGetInteger("gRandomizeSkipChildZelda", 0) && CVarGetInteger("gRandomizeSkipChildStealth", 0); - cvarSettings[RSK_SKIP_EPONA_RACE] = CVar_GetS32("gRandomizeSkipEponaRace", 0); - cvarSettings[RSK_SKIP_TOWER_ESCAPE] = CVar_GetS32("gRandomizeSkipTowerEscape", 0); - cvarSettings[RSK_COMPLETE_MASK_QUEST] = CVar_GetS32("gRandomizeCompleteMaskQuest", 0); - cvarSettings[RSK_SKIP_SCARECROWS_SONG] = CVar_GetS32("gRandomizeSkipScarecrowsSong", 0); - cvarSettings[RSK_ENABLE_GLITCH_CUTSCENES] = CVar_GetS32("gRandomizeEnableGlitchCutscenes", 0); + cvarSettings[RSK_SKIP_EPONA_RACE] = CVarGetInteger("gRandomizeSkipEponaRace", 0); + cvarSettings[RSK_SKIP_TOWER_ESCAPE] = CVarGetInteger("gRandomizeSkipTowerEscape", 0); + cvarSettings[RSK_COMPLETE_MASK_QUEST] = CVarGetInteger("gRandomizeCompleteMaskQuest", 0); + cvarSettings[RSK_SKIP_SCARECROWS_SONG] = CVarGetInteger("gRandomizeSkipScarecrowsSong", 0); + cvarSettings[RSK_ENABLE_GLITCH_CUTSCENES] = CVarGetInteger("gRandomizeEnableGlitchCutscenes", 0); - cvarSettings[RSK_SKULLS_SUNS_SONG] = CVar_GetS32("gRandomizeGsExpectSunsSong", 0); + cvarSettings[RSK_SKULLS_SUNS_SONG] = CVarGetInteger("gRandomizeGsExpectSunsSong", 0); // Link's Pocket has to have a dungeon reward if the other rewards are shuffled to end of dungeon. - cvarSettings[RSK_LINKS_POCKET] = CVar_GetS32("gRandomizeShuffleDungeonReward", RO_DUNGEON_REWARDS_END_OF_DUNGEON) != RO_DUNGEON_REWARDS_END_OF_DUNGEON ? - CVar_GetS32("gRandomizeLinksPocket", RO_LINKS_POCKET_DUNGEON_REWARD) : + cvarSettings[RSK_LINKS_POCKET] = CVarGetInteger("gRandomizeShuffleDungeonReward", RO_DUNGEON_REWARDS_END_OF_DUNGEON) != RO_DUNGEON_REWARDS_END_OF_DUNGEON ? + CVarGetInteger("gRandomizeLinksPocket", RO_LINKS_POCKET_DUNGEON_REWARD) : RO_LINKS_POCKET_DUNGEON_REWARD; if (OTRGlobals::Instance->HasMasterQuest() && OTRGlobals::Instance->HasOriginal()) { // If both OTRs are loaded. - cvarSettings[RSK_RANDOM_MQ_DUNGEONS] = CVar_GetS32("gRandomizeMqDungeons", RO_MQ_DUNGEONS_NONE); - cvarSettings[RSK_MQ_DUNGEON_COUNT] = CVar_GetS32("gRandomizeMqDungeonCount", 12); + cvarSettings[RSK_RANDOM_MQ_DUNGEONS] = CVarGetInteger("gRandomizeMqDungeons", RO_MQ_DUNGEONS_NONE); + cvarSettings[RSK_MQ_DUNGEON_COUNT] = CVarGetInteger("gRandomizeMqDungeonCount", 12); } else if (OTRGlobals::Instance->HasMasterQuest()) { // If only Master Quest is loaded. cvarSettings[RSK_RANDOM_MQ_DUNGEONS] = RO_MQ_DUNGEONS_SET_NUMBER; @@ -2760,31 +2760,31 @@ void GenerateRandomizerImgui() { } // Enable if any of the entrance rando options are enabled. - cvarSettings[RSK_SHUFFLE_ENTRANCES] = CVar_GetS32("gRandomizeShuffleDungeonsEntrances", RO_DUNGEON_ENTRANCE_SHUFFLE_OFF) || - CVar_GetS32("gRandomizeShuffleOverworldEntrances", RO_GENERIC_OFF) || - CVar_GetS32("gRandomizeShuffleInteriorsEntrances", RO_INTERIOR_ENTRANCE_SHUFFLE_OFF) || - CVar_GetS32("gRandomizeShuffleGrottosEntrances", RO_GENERIC_OFF) || - CVar_GetS32("gRandomizeShuffleOwlDrops", RO_GENERIC_OFF) || - CVar_GetS32("gRandomizeShuffleWarpSongs", RO_GENERIC_OFF) || - CVar_GetS32("gRandomizeShuffleOverworldSpawns", RO_GENERIC_OFF); + cvarSettings[RSK_SHUFFLE_ENTRANCES] = CVarGetInteger("gRandomizeShuffleDungeonsEntrances", RO_DUNGEON_ENTRANCE_SHUFFLE_OFF) || + CVarGetInteger("gRandomizeShuffleOverworldEntrances", RO_GENERIC_OFF) || + CVarGetInteger("gRandomizeShuffleInteriorsEntrances", RO_INTERIOR_ENTRANCE_SHUFFLE_OFF) || + CVarGetInteger("gRandomizeShuffleGrottosEntrances", RO_GENERIC_OFF) || + CVarGetInteger("gRandomizeShuffleOwlDrops", RO_GENERIC_OFF) || + CVarGetInteger("gRandomizeShuffleWarpSongs", RO_GENERIC_OFF) || + CVarGetInteger("gRandomizeShuffleOverworldSpawns", RO_GENERIC_OFF); - cvarSettings[RSK_SHUFFLE_DUNGEON_ENTRANCES] = CVar_GetS32("gRandomizeShuffleDungeonsEntrances", RO_DUNGEON_ENTRANCE_SHUFFLE_OFF); - cvarSettings[RSK_SHUFFLE_OVERWORLD_ENTRANCES] = CVar_GetS32("gRandomizeShuffleOverworldEntrances", RO_GENERIC_OFF); - cvarSettings[RSK_SHUFFLE_INTERIOR_ENTRANCES] = CVar_GetS32("gRandomizeShuffleInteriorsEntrances", RO_INTERIOR_ENTRANCE_SHUFFLE_OFF); - cvarSettings[RSK_SHUFFLE_GROTTO_ENTRANCES] = CVar_GetS32("gRandomizeShuffleGrottosEntrances", RO_GENERIC_OFF); - cvarSettings[RSK_SHUFFLE_OWL_DROPS] = CVar_GetS32("gRandomizeShuffleOwlDrops", RO_GENERIC_OFF); - cvarSettings[RSK_SHUFFLE_WARP_SONGS] = CVar_GetS32("gRandomizeShuffleWarpSongs", RO_GENERIC_OFF); - cvarSettings[RSK_SHUFFLE_OVERWORLD_SPAWNS] = CVar_GetS32("gRandomizeShuffleOverworldSpawns", RO_GENERIC_OFF); - cvarSettings[RSK_MIXED_ENTRANCE_POOLS] = CVar_GetS32("gRandomizeMixedEntrances", RO_GENERIC_OFF); - cvarSettings[RSK_MIX_DUNGEON_ENTRANCES] = CVar_GetS32("gRandomizeMixDungeons", RO_GENERIC_OFF); - cvarSettings[RSK_MIX_OVERWORLD_ENTRANCES] = CVar_GetS32("gRandomizeMixOverworld", RO_GENERIC_OFF); - cvarSettings[RSK_MIX_INTERIOR_ENTRANCES] = CVar_GetS32("gRandomizeMixInteriors", RO_GENERIC_OFF); - cvarSettings[RSK_MIX_GROTTO_ENTRANCES] = CVar_GetS32("gRandomizeMixGrottos", RO_GENERIC_OFF); - cvarSettings[RSK_DECOUPLED_ENTRANCES] = CVar_GetS32("gRandomizeDecoupleEntrances", RO_GENERIC_OFF); + cvarSettings[RSK_SHUFFLE_DUNGEON_ENTRANCES] = CVarGetInteger("gRandomizeShuffleDungeonsEntrances", RO_DUNGEON_ENTRANCE_SHUFFLE_OFF); + cvarSettings[RSK_SHUFFLE_OVERWORLD_ENTRANCES] = CVarGetInteger("gRandomizeShuffleOverworldEntrances", RO_GENERIC_OFF); + cvarSettings[RSK_SHUFFLE_INTERIOR_ENTRANCES] = CVarGetInteger("gRandomizeShuffleInteriorsEntrances", RO_INTERIOR_ENTRANCE_SHUFFLE_OFF); + cvarSettings[RSK_SHUFFLE_GROTTO_ENTRANCES] = CVarGetInteger("gRandomizeShuffleGrottosEntrances", RO_GENERIC_OFF); + cvarSettings[RSK_SHUFFLE_OWL_DROPS] = CVarGetInteger("gRandomizeShuffleOwlDrops", RO_GENERIC_OFF); + cvarSettings[RSK_SHUFFLE_WARP_SONGS] = CVarGetInteger("gRandomizeShuffleWarpSongs", RO_GENERIC_OFF); + cvarSettings[RSK_SHUFFLE_OVERWORLD_SPAWNS] = CVarGetInteger("gRandomizeShuffleOverworldSpawns", RO_GENERIC_OFF); + cvarSettings[RSK_MIXED_ENTRANCE_POOLS] = CVarGetInteger("gRandomizeMixedEntrances", RO_GENERIC_OFF); + cvarSettings[RSK_MIX_DUNGEON_ENTRANCES] = CVarGetInteger("gRandomizeMixDungeons", RO_GENERIC_OFF); + cvarSettings[RSK_MIX_OVERWORLD_ENTRANCES] = CVarGetInteger("gRandomizeMixOverworld", RO_GENERIC_OFF); + cvarSettings[RSK_MIX_INTERIOR_ENTRANCES] = CVarGetInteger("gRandomizeMixInteriors", RO_GENERIC_OFF); + cvarSettings[RSK_MIX_GROTTO_ENTRANCES] = CVarGetInteger("gRandomizeMixGrottos", RO_GENERIC_OFF); + cvarSettings[RSK_DECOUPLED_ENTRANCES] = CVarGetInteger("gRandomizeDecoupleEntrances", RO_GENERIC_OFF); // todo: this efficently when we build out cvar array support std::set excludedLocations; - std::stringstream excludedLocationStringStream(CVar_GetString("gRandomizeExcludedLocations", "")); + std::stringstream excludedLocationStringStream(CVarGetString("gRandomizeExcludedLocations", "")); std::string excludedLocationString; while (getline(excludedLocationStringStream, excludedLocationString, ',')) { excludedLocations.insert((RandomizerCheck)std::stoi(excludedLocationString)); @@ -2792,9 +2792,9 @@ void GenerateRandomizerImgui() { RandoMain::GenerateRando(cvarSettings, excludedLocations); - CVar_SetS32("gRandoGenerating", 0); - CVar_Save(); - CVar_Load(); + CVarSetInteger("gRandoGenerating", 0); + CVarSave(); + CVarLoad(); generated = 1; } @@ -2806,7 +2806,7 @@ void DrawRandoEditor(bool& open) { } if (!open) { - CVar_SetS32("gRandomizerSettingsEnabled", 0); + CVarSetInteger("gRandomizerSettingsEnabled", 0); return; } @@ -2875,22 +2875,22 @@ void DrawRandoEditor(bool& open) { DrawPresetSelector(PRESET_TYPE_RANDOMIZER); - bool disableEditingRandoSettings = CVar_GetS32("gRandoGenerating", 0) || CVar_GetS32("gOnFileSelectNameEntry", 0); + bool disableEditingRandoSettings = CVarGetInteger("gRandoGenerating", 0) || CVarGetInteger("gOnFileSelectNameEntry", 0); ImGui::PushItemFlag(ImGuiItemFlags_Disabled, disableEditingRandoSettings); ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * (disableEditingRandoSettings ? 0.5f : 1.0f)); ImGui::Dummy(ImVec2(0.0f, 0.0f)); if (ImGui::Button("Generate Seed")) { - if (CVar_GetS32("gRandoGenerating", 0) == 0) { + if (CVarGetInteger("gRandoGenerating", 0) == 0) { randoThread = std::thread(&GenerateRandomizerImgui); } } ImGui::Dummy(ImVec2(0.0f, 0.0f)); - std::string spoilerfilepath = CVar_GetString("gSpoilerLog", ""); + std::string spoilerfilepath = CVarGetString("gSpoilerLog", ""); ImGui::Text("Spoiler File: %s", spoilerfilepath.c_str()); // RANDOTODO settings presets - // std::string presetfilepath = CVar_GetString("gLoadedPreset", ""); + // std::string presetfilepath = CVarGetString("gLoadedPreset", ""); // ImGui::Text("Settings File: %s", presetfilepath.c_str()); UIWidgets::PaddedSeparator(); @@ -2990,10 +2990,10 @@ void DrawRandoEditor(bool& open) { //Starting Age //Disabled when Forest is set to Closed or under very specific conditions //RANDOTODO: Replace magic number checks with enums - bool disableRandoStartingAge = (CVar_GetS32("gRandomizeLogicRules", RO_LOGIC_GLITCHLESS) == RO_LOGIC_GLITCHLESS) && - ((CVar_GetS32("gRandomizeForest", RO_FOREST_CLOSED) == RO_FOREST_CLOSED) || - ((CVar_GetS32("gRandomizeDoorOfTime", RO_DOOROFTIME_CLOSED) == RO_DOOROFTIME_CLOSED) && - (CVar_GetS32("gRandomizeShuffleOcarinas", 0) == 0))); // ocarinas not shuffled + bool disableRandoStartingAge = (CVarGetInteger("gRandomizeLogicRules", RO_LOGIC_GLITCHLESS) == RO_LOGIC_GLITCHLESS) && + ((CVarGetInteger("gRandomizeForest", RO_FOREST_CLOSED) == RO_FOREST_CLOSED) || + ((CVarGetInteger("gRandomizeDoorOfTime", RO_DOOROFTIME_CLOSED) == RO_DOOROFTIME_CLOSED) && + (CVarGetInteger("gRandomizeShuffleOcarinas", 0) == 0))); // ocarinas not shuffled static const char* disableRandoStartingAgeText = "This option is disabled due to other options making the game unbeatable."; ImGui::Text(Settings::StartingAge.GetName().c_str()); @@ -3011,7 +3011,7 @@ void DrawRandoEditor(bool& open) { if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("%s", disableRandoStartingAgeText); } - CVar_SetS32("gRandomizeStartingAge", RO_AGE_CHILD); + CVarSetInteger("gRandomizeStartingAge", RO_AGE_CHILD); ImGui::PopStyleVar(1); ImGui::PopItemFlag(); } @@ -3059,7 +3059,7 @@ void DrawRandoEditor(bool& open) { UIWidgets::EnhancementCombobox("gRandomizeRainbowBridge", randoRainbowBridge, RO_BRIDGE_MAX, RO_BRIDGE_VANILLA); ImGui::PopItemWidth(); - switch (CVar_GetS32("gRandomizeRainbowBridge", RO_BRIDGE_VANILLA)) { + switch (CVarGetInteger("gRandomizeRainbowBridge", RO_BRIDGE_VANILLA)) { case RO_BRIDGE_ALWAYS_OPEN: break; case RO_BRIDGE_VANILLA: @@ -3108,7 +3108,7 @@ void DrawRandoEditor(bool& open) { ); UIWidgets::EnhancementCombobox("gRandomizeGanonTrial", randoGanonsTrial, RO_GANONS_TRIALS_MAX, RO_GANONS_TRIALS_SET_NUMBER); ImGui::PopItemWidth(); - if (CVar_GetS32("gRandomizeGanonTrial", RO_GANONS_TRIALS_SET_NUMBER) == RO_GANONS_TRIALS_SET_NUMBER) { + if (CVarGetInteger("gRandomizeGanonTrial", RO_GANONS_TRIALS_SET_NUMBER) == RO_GANONS_TRIALS_SET_NUMBER) { ImGui::Dummy(ImVec2(0.0f, 0.0f)); UIWidgets::EnhancementSliderInt("Ganon's Trial Count: %d", "##RandoTrialCount", "gRandomizeGanonTrialCount", 1, 6, "", 6, true); @@ -3132,10 +3132,10 @@ void DrawRandoEditor(bool& open) { ); UIWidgets::EnhancementCombobox("gRandomizeMqDungeons", randoMqDungeons, RO_MQ_DUNGEONS_MAX, RO_MQ_DUNGEONS_NONE); ImGui::PopItemWidth(); - if (CVar_GetS32("gRandomizeMqDungeons", RO_MQ_DUNGEONS_NONE) == RO_MQ_DUNGEONS_SET_NUMBER) { + if (CVarGetInteger("gRandomizeMqDungeons", RO_MQ_DUNGEONS_NONE) == RO_MQ_DUNGEONS_SET_NUMBER) { ImGui::Dummy(ImVec2(0.0f, 0.0f)); UIWidgets::EnhancementSliderInt("Master Quest Dungeon Count: %d", "##RandoMqDungeonCount", - "gRandomizeMqDungeonCount", 1, 12, "", CVar_GetS32("gRandomizeMqDungeonCount", 12), true); + "gRandomizeMqDungeonCount", 1, 12, "", CVarGetInteger("gRandomizeMqDungeonCount", 12), true); } } @@ -3253,26 +3253,26 @@ void DrawRandoEditor(bool& open) { "vice versa, while overworld entrances are shuffled in their own separate pool and indoors stay vanilla." ); - if (CVar_GetS32("gRandomizeMixedEntrances", RO_GENERIC_OFF)) { - if (CVar_GetS32("gRandomizeShuffleDungeonsEntrances", RO_GENERIC_OFF)) { + if (CVarGetInteger("gRandomizeMixedEntrances", RO_GENERIC_OFF)) { + if (CVarGetInteger("gRandomizeShuffleDungeonsEntrances", RO_GENERIC_OFF)) { UIWidgets::Spacer(0); ImGui::SetCursorPosX(20); UIWidgets::EnhancementCheckbox("Mix Dungeons", "gRandomizeMixDungeons"); UIWidgets::InsertHelpHoverText("Dungeon entrances will be part of the mixed pool"); } - if (CVar_GetS32("gRandomizeShuffleOverworldEntrances", RO_GENERIC_OFF)) { + if (CVarGetInteger("gRandomizeShuffleOverworldEntrances", RO_GENERIC_OFF)) { UIWidgets::Spacer(0); ImGui::SetCursorPosX(20); UIWidgets::EnhancementCheckbox("Mix Overworld", "gRandomizeMixOverworld"); UIWidgets::InsertHelpHoverText("Overworld entrances will be part of the mixed pool"); } - if (CVar_GetS32("gRandomizeShuffleInteriorsEntrances", RO_GENERIC_OFF)) { + if (CVarGetInteger("gRandomizeShuffleInteriorsEntrances", RO_GENERIC_OFF)) { UIWidgets::Spacer(0); ImGui::SetCursorPosX(20); UIWidgets::EnhancementCheckbox("Mix Interiors", "gRandomizeMixInteriors"); UIWidgets::InsertHelpHoverText("Interior entrances will be part of the mixed pool"); } - if (CVar_GetS32("gRandomizeShuffleGrottosEntrances", RO_GENERIC_OFF)) { + if (CVarGetInteger("gRandomizeShuffleGrottosEntrances", RO_GENERIC_OFF)) { UIWidgets::Spacer(0); ImGui::SetCursorPosX(20); UIWidgets::EnhancementCheckbox("Mix Grottos", "gRandomizeMixGrottos"); @@ -3352,7 +3352,7 @@ void DrawRandoEditor(bool& open) { // Shuffle Kokiri Sword // Disabled when Start with Kokiri Sword is active - bool disableShuffleKokiriSword = CVar_GetS32("gRandomizeStartingKokiriSword", 0); + bool disableShuffleKokiriSword = CVarGetInteger("gRandomizeStartingKokiriSword", 0); static const char* disableShuffleKokiriSwordText = "This option is disabled because \"Start with Kokiri Sword\" is enabled."; UIWidgets::EnhancementCheckbox(Settings::ShuffleKokiriSword.GetName().c_str(), "gRandomizeShuffleKokiriSword", disableShuffleKokiriSword, disableShuffleKokiriSwordText); @@ -3366,7 +3366,7 @@ void DrawRandoEditor(bool& open) { // Shuffle Ocarinas // Disabled when Start with Ocarina is active - bool disableShuffleOcarinas = CVar_GetS32("gRandomizeStartingOcarina", 0); + bool disableShuffleOcarinas = CVarGetInteger("gRandomizeStartingOcarina", 0); static const char* disableShuffleOcarinasText = "This option is disabled because \"Start with Fairy Ocarina\" is enabled."; UIWidgets::EnhancementCheckbox(Settings::ShuffleOcarinas.GetName().c_str(), "gRandomizeShuffleOcarinas", disableShuffleOcarinas, disableShuffleOcarinasText); @@ -3380,7 +3380,7 @@ void DrawRandoEditor(bool& open) { // Shuffle Weird Egg // Disabled when Skip Child Zelda is active - bool disableShuffleWeirdEgg = CVar_GetS32("gRandomizeSkipChildZelda", 0); + bool disableShuffleWeirdEgg = CVarGetInteger("gRandomizeSkipChildZelda", 0); static const char* disableShuffleWeirdEggText = "This option is disabled because \"Skip Child Zelda\" is enabled."; UIWidgets::EnhancementCheckbox(Settings::ShuffleWeirdEgg.GetName().c_str(), "gRandomizeShuffleWeirdEgg", disableShuffleWeirdEgg, disableShuffleWeirdEggText); @@ -3584,7 +3584,7 @@ void DrawRandoEditor(bool& open) { ); UIWidgets::EnhancementCombobox("gRandomizeShuffleKeyRings", randoShuffleKeyRings, RO_KEYRINGS_MAX, RO_KEYRINGS_OFF); ImGui::PopItemWidth(); - switch (CVar_GetS32("gRandomizeShuffleKeyRings", RO_KEYRINGS_OFF)) { + switch (CVarGetInteger("gRandomizeShuffleKeyRings", RO_KEYRINGS_OFF)) { case RO_KEYRINGS_COUNT: ImGui::Dummy(ImVec2(0.0f, 0.0f)); UIWidgets::EnhancementSliderInt("Key Ring Count: %d", "##RandomizeShuffleKeyRingsRandomCount", @@ -3666,7 +3666,7 @@ void DrawRandoEditor(bool& open) { ); UIWidgets::EnhancementCombobox("gRandomizeShuffleGanonBossKey", randoShuffleGanonsBossKey, RO_GANON_BOSS_KEY_MAX, RO_GANON_BOSS_KEY_VANILLA); ImGui::PopItemWidth(); - switch (CVar_GetS32("gRandomizeShuffleGanonBossKey", RO_GANON_BOSS_KEY_VANILLA)) { + switch (CVarGetInteger("gRandomizeShuffleGanonBossKey", RO_GANON_BOSS_KEY_VANILLA)) { case RO_GANON_BOSS_KEY_LACS_MEDALLIONS: ImGui::Dummy(ImVec2(0.0f, 0.0f)); UIWidgets::EnhancementSliderInt("Medallion Count: %d", "##RandoLacsMedallionCount", @@ -3739,7 +3739,7 @@ void DrawRandoEditor(bool& open) { // Skip child stealth // Disabled when Skip Child Zelda is active - bool disableChildStealth = CVar_GetS32("gRandomizeSkipChildZelda", 0); + bool disableChildStealth = CVarGetInteger("gRandomizeSkipChildZelda", 0); static const char* disableChildStealthText = "This option is disabled because \"Skip Child Zelda\" is enabled"; UIWidgets::EnhancementCheckbox(Settings::SkipChildStealth.GetName().c_str(), "gRandomizeSkipChildStealth", disableChildStealth, disableChildStealthText); UIWidgets::InsertHelpHoverText("The crawlspace into Hyrule Castle goes straight to Zelda, skipping the guards."); @@ -3840,7 +3840,7 @@ void DrawRandoEditor(bool& open) { "\n" "Need Mask of Truth - Hints are only available whilst wearing the Mask of Truth.\n"); UIWidgets::EnhancementCombobox("gRandomizeGossipStoneHints", randoGossipStoneHints, RO_GOSSIP_STONES_MAX, RO_GOSSIP_STONES_NEED_NOTHING); - if (CVar_GetS32("gRandomizeGossipStoneHints", RO_GOSSIP_STONES_NEED_NOTHING) != RO_GOSSIP_STONES_NONE) { + if (CVarGetInteger("gRandomizeGossipStoneHints", RO_GOSSIP_STONES_NEED_NOTHING) != RO_GOSSIP_STONES_NONE) { // Hint Clarity ImGui::Dummy(ImVec2(0.0f, 0.0f)); ImGui::Indent(); @@ -3946,7 +3946,7 @@ void DrawRandoEditor(bool& open) { locationsTabOpen = true; RandomizerCheckObjects::UpdateImGuiVisibility(); // todo: this efficently when we build out cvar array support - std::stringstream excludedLocationStringStream(CVar_GetString("gRandomizeExcludedLocations", "")); + std::stringstream excludedLocationStringStream(CVarGetString("gRandomizeExcludedLocations", "")); std::string excludedLocationString; excludedLocations.clear(); while (getline(excludedLocationStringStream, excludedLocationString, ',')) { @@ -3996,7 +3996,7 @@ void DrawRandoEditor(bool& open) { excludedLocationString += std::to_string(excludedLocationIt); excludedLocationString += ","; } - CVar_SetString("gRandomizeExcludedLocations", excludedLocationString.c_str()); + CVarSetString("gRandomizeExcludedLocations", excludedLocationString.c_str()); SohImGui::RequestCvarSaveOnNextTick(); } ImGui::SameLine(); @@ -4037,7 +4037,7 @@ void DrawRandoEditor(bool& open) { excludedLocationString += std::to_string(excludedLocationIt); excludedLocationString += ","; } - CVar_SetString("gRandomizeExcludedLocations", excludedLocationString.c_str()); + CVarSetString("gRandomizeExcludedLocations", excludedLocationString.c_str()); SohImGui::RequestCvarSaveOnNextTick(); } ImGui::SameLine(); @@ -4072,7 +4072,7 @@ void DrawRandoEditor(bool& open) { "No logic - Item placement is completely random. MAY BE IMPOSSIBLE TO BEAT." ); UIWidgets::EnhancementCombobox("gRandomizeLogicRules", randoLogicRules, RO_LOGIC_MAX, RO_LOGIC_GLITCHLESS); - if (CVar_GetS32("gRandomizeLogicRules", RO_LOGIC_GLITCHLESS) == RO_LOGIC_GLITCHLESS) { + if (CVarGetInteger("gRandomizeLogicRules", RO_LOGIC_GLITCHLESS) == RO_LOGIC_GLITCHLESS) { ImGui::SameLine(); UIWidgets::EnhancementCheckbox(Settings::LocationsReachable.GetName().c_str(), "gRandomizeAllLocationsReachable", false, "", UIWidgets::CheckboxGraphics::Cross, RO_GENERIC_ON); UIWidgets::InsertHelpHoverText( @@ -4145,7 +4145,7 @@ void DrawRandoEditor(bool& open) { ImGui::BeginChild("ChildStartingEquipment", ImVec2(0, -8)); // Don't display this option if Dungeon Rewards are Shuffled to End of Dungeon. // TODO: Show this but disabled when we have options for disabled Comboboxes. - if (CVar_GetS32("gRandomizeShuffleDungeonReward", RO_DUNGEON_REWARDS_END_OF_DUNGEON) != RO_DUNGEON_REWARDS_END_OF_DUNGEON) { + if (CVarGetInteger("gRandomizeShuffleDungeonReward", RO_DUNGEON_REWARDS_END_OF_DUNGEON) != RO_DUNGEON_REWARDS_END_OF_DUNGEON) { ImGui::Text(Settings::LinksPocketItem.GetName().c_str()); UIWidgets::EnhancementCombobox("gRandomizeLinksPocket", randoLinksPocket, RO_LINKS_POCKET_MAX, RO_LINKS_POCKET_DUNGEON_REWARD); UIWidgets::PaddedSeparator(); diff --git a/soh/soh/Enhancements/randomizer/randomizer.h b/soh/soh/Enhancements/randomizer/randomizer.h index 0af90e5d0..026e7a66d 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.h +++ b/soh/soh/Enhancements/randomizer/randomizer.h @@ -4,8 +4,8 @@ #include #include #include -#include "../../../include/ultra64.h" -#include "../../../include/z64item.h" +#include +#include "z64item.h" #include #include #include "soh/Enhancements/randomizer/randomizer_check_objects.h" diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp index 77b89789f..1cf4c0375 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_objects.cpp @@ -1,7 +1,7 @@ #include "randomizer_check_objects.h" #include #include -#include +#include #include "z64.h" /* @@ -924,40 +924,40 @@ void RandomizerCheckObjects::UpdateImGuiVisibility() { (locationIt.rc != RC_UNKNOWN_CHECK) && (!RandomizerCheckObjects::AreaIsDungeon(locationIt.rcArea) || locationIt.vOrMQ == RCVORMQ_BOTH || - locationIt.vOrMQ == RCVORMQ_MQ && CVar_GetS32("gRandomizeMqDungeons", RO_MQ_DUNGEONS_NONE) != RO_MQ_DUNGEONS_NONE && CVar_GetS32("gRandomizeMqDungeonCount", 0) > 0 || //at least one MQ dungeon - locationIt.vOrMQ == RCVORMQ_VANILLA && (CVar_GetS32("gRandomizeMqDungeons", RO_MQ_DUNGEONS_NONE) == RO_MQ_DUNGEONS_NONE || CVar_GetS32("gRandomizeMqDungeonCount", 0) < 12) //at least one vanilla dungeon + locationIt.vOrMQ == RCVORMQ_MQ && CVarGetInteger("gRandomizeMqDungeons", RO_MQ_DUNGEONS_NONE) != RO_MQ_DUNGEONS_NONE && CVarGetInteger("gRandomizeMqDungeonCount", 0) > 0 || //at least one MQ dungeon + locationIt.vOrMQ == RCVORMQ_VANILLA && (CVarGetInteger("gRandomizeMqDungeons", RO_MQ_DUNGEONS_NONE) == RO_MQ_DUNGEONS_NONE || CVarGetInteger("gRandomizeMqDungeonCount", 0) < 12) //at least one vanilla dungeon ) && - (locationIt.rcType != RCTYPE_SHOP || CVar_GetS32("gRandomizeShopsanity", RO_SHOPSANITY_OFF) > RO_SHOPSANITY_ZERO_ITEMS) && - (locationIt.rcType != RCTYPE_SCRUB || CVar_GetS32("gRandomizeShuffleScrubs", RO_SCRUBS_OFF) != RO_SCRUBS_OFF || + (locationIt.rcType != RCTYPE_SHOP || CVarGetInteger("gRandomizeShopsanity", RO_SHOPSANITY_OFF) > RO_SHOPSANITY_ZERO_ITEMS) && + (locationIt.rcType != RCTYPE_SCRUB || CVarGetInteger("gRandomizeShuffleScrubs", RO_SCRUBS_OFF) != RO_SCRUBS_OFF || locationIt.rc == RC_HF_DEKU_SCRUB_GROTTO || locationIt.rc == RC_LW_DEKU_SCRUB_GROTTO_FRONT || locationIt.rc == RC_LW_DEKU_SCRUB_NEAR_BRIDGE) && //The 3 scrubs that are always randomized - (locationIt.rcType != RCTYPE_MERCHANT || CVar_GetS32("gRandomizeShuffleMerchants", RO_SHUFFLE_MERCHANTS_OFF) != RO_SHUFFLE_MERCHANTS_OFF) && + (locationIt.rcType != RCTYPE_MERCHANT || CVarGetInteger("gRandomizeShuffleMerchants", RO_SHUFFLE_MERCHANTS_OFF) != RO_SHUFFLE_MERCHANTS_OFF) && (locationIt.rcType != RCTYPE_GOSSIP_STONE) && // don't show gossip stones (maybe gossipsanity will be a thing eventually?) (locationIt.rcType != RCTYPE_LINKS_POCKET) && (locationIt.rcType != RCTYPE_CHEST_GAME) && // don't show non final reward chest game checks until we support shuffling them ((locationIt.rcType != RCTYPE_SKULL_TOKEN) || - (CVar_GetS32("gRandomizeShuffleTokens", RO_TOKENSANITY_OFF) == RO_TOKENSANITY_ALL) || - ((CVar_GetS32("gRandomizeShuffleTokens", RO_TOKENSANITY_OFF) == RO_TOKENSANITY_OVERWORLD) && RandomizerCheckObjects::AreaIsOverworld(locationIt.rcArea)) || - ((CVar_GetS32("gRandomizeShuffleTokens", RO_TOKENSANITY_OFF) == RO_TOKENSANITY_DUNGEONS) && RandomizerCheckObjects::AreaIsDungeon(locationIt.rcArea)) + (CVarGetInteger("gRandomizeShuffleTokens", RO_TOKENSANITY_OFF) == RO_TOKENSANITY_ALL) || + ((CVarGetInteger("gRandomizeShuffleTokens", RO_TOKENSANITY_OFF) == RO_TOKENSANITY_OVERWORLD) && RandomizerCheckObjects::AreaIsOverworld(locationIt.rcArea)) || + ((CVarGetInteger("gRandomizeShuffleTokens", RO_TOKENSANITY_OFF) == RO_TOKENSANITY_DUNGEONS) && RandomizerCheckObjects::AreaIsDungeon(locationIt.rcArea)) ) && - ((locationIt.rcType != RCTYPE_COW) || CVar_GetS32("gRandomizeShuffleCows", RO_GENERIC_NO)) && - ((locationIt.rcType != RCTYPE_ADULT_TRADE) || CVar_GetS32("gRandomizeShuffleAdultTrade", RO_GENERIC_NO)) && - ((locationIt.rc != RC_KF_KOKIRI_SWORD_CHEST) || CVar_GetS32("gRandomizeShuffleKokiriSword", RO_GENERIC_NO)) && - ((locationIt.rc != RC_ZR_MAGIC_BEAN_SALESMAN) || CVar_GetS32("gRandomizeShuffleBeans", RO_GENERIC_NO) == RO_GENERIC_YES) && - ((locationIt.rc != RC_HC_MALON_EGG) || CVar_GetS32("gRandomizeShuffleWeirdEgg", RO_GENERIC_NO)) && - ((locationIt.rcType != RCTYPE_FROG_SONG) || CVar_GetS32("gRandomizeShuffleFrogSongRupees", RO_GENERIC_NO)) && - ((locationIt.rcType != RCTYPE_MAP_COMPASS) || CVar_GetS32("gRandomizeStartingMapsCompasses", RO_DUNGEON_ITEM_LOC_OWN_DUNGEON) != RO_DUNGEON_ITEM_LOC_VANILLA) && - ((locationIt.rcType != RCTYPE_SMALL_KEY) || CVar_GetS32("gRandomizeKeysanity", RO_DUNGEON_ITEM_LOC_OWN_DUNGEON) != RO_DUNGEON_ITEM_LOC_VANILLA) && - ((locationIt.rcType != RCTYPE_BOSS_KEY) || CVar_GetS32("gRandomizeBossKeysanity", RO_DUNGEON_ITEM_LOC_OWN_DUNGEON) != RO_DUNGEON_ITEM_LOC_VANILLA) && - ((locationIt.rcType != RCTYPE_GANON_BOSS_KEY) || CVar_GetS32("gRandomizeShuffleGanonBossKey", RO_GANON_BOSS_KEY_VANILLA) != RO_GANON_BOSS_KEY_VANILLA) && + ((locationIt.rcType != RCTYPE_COW) || CVarGetInteger("gRandomizeShuffleCows", RO_GENERIC_NO)) && + ((locationIt.rcType != RCTYPE_ADULT_TRADE) || CVarGetInteger("gRandomizeShuffleAdultTrade", RO_GENERIC_NO)) && + ((locationIt.rc != RC_KF_KOKIRI_SWORD_CHEST) || CVarGetInteger("gRandomizeShuffleKokiriSword", RO_GENERIC_NO)) && + ((locationIt.rc != RC_ZR_MAGIC_BEAN_SALESMAN) || CVarGetInteger("gRandomizeShuffleBeans", RO_GENERIC_NO) == RO_GENERIC_YES) && + ((locationIt.rc != RC_HC_MALON_EGG) || CVarGetInteger("gRandomizeShuffleWeirdEgg", RO_GENERIC_NO)) && + ((locationIt.rcType != RCTYPE_FROG_SONG) || CVarGetInteger("gRandomizeShuffleFrogSongRupees", RO_GENERIC_NO)) && + ((locationIt.rcType != RCTYPE_MAP_COMPASS) || CVarGetInteger("gRandomizeStartingMapsCompasses", RO_DUNGEON_ITEM_LOC_OWN_DUNGEON) != RO_DUNGEON_ITEM_LOC_VANILLA) && + ((locationIt.rcType != RCTYPE_SMALL_KEY) || CVarGetInteger("gRandomizeKeysanity", RO_DUNGEON_ITEM_LOC_OWN_DUNGEON) != RO_DUNGEON_ITEM_LOC_VANILLA) && + ((locationIt.rcType != RCTYPE_BOSS_KEY) || CVarGetInteger("gRandomizeBossKeysanity", RO_DUNGEON_ITEM_LOC_OWN_DUNGEON) != RO_DUNGEON_ITEM_LOC_VANILLA) && + ((locationIt.rcType != RCTYPE_GANON_BOSS_KEY) || CVarGetInteger("gRandomizeShuffleGanonBossKey", RO_GANON_BOSS_KEY_VANILLA) != RO_GANON_BOSS_KEY_VANILLA) && (locationIt.rcType != RCTYPE_GF_KEY && locationIt.rc != RC_GF_GERUDO_MEMBERSHIP_CARD || - (CVar_GetS32("gRandomizeGerudoFortress", RO_GF_NORMAL) == RO_GF_OPEN && locationIt.rcType != RCTYPE_GF_KEY && locationIt.rc != RC_GF_GERUDO_MEMBERSHIP_CARD) || - (CVar_GetS32("gRandomizeGerudoFortress", RO_GF_NORMAL) == RO_GF_FAST && - ((locationIt.rc == RC_GF_GERUDO_MEMBERSHIP_CARD && CVar_GetS32("gRandomizeShuffleGerudoToken", RO_GENERIC_NO) == RO_GENERIC_YES) || - (locationIt.rc == RC_GF_NORTH_F1_CARPENTER && CVar_GetS32("gRandomizeGerudoKeys", RO_GERUDO_KEYS_VANILLA) != RO_GERUDO_KEYS_VANILLA)) + (CVarGetInteger("gRandomizeGerudoFortress", RO_GF_NORMAL) == RO_GF_OPEN && locationIt.rcType != RCTYPE_GF_KEY && locationIt.rc != RC_GF_GERUDO_MEMBERSHIP_CARD) || + (CVarGetInteger("gRandomizeGerudoFortress", RO_GF_NORMAL) == RO_GF_FAST && + ((locationIt.rc == RC_GF_GERUDO_MEMBERSHIP_CARD && CVarGetInteger("gRandomizeShuffleGerudoToken", RO_GENERIC_NO) == RO_GENERIC_YES) || + (locationIt.rc == RC_GF_NORTH_F1_CARPENTER && CVarGetInteger("gRandomizeGerudoKeys", RO_GERUDO_KEYS_VANILLA) != RO_GERUDO_KEYS_VANILLA)) ) || - (CVar_GetS32("gRandomizeGerudoFortress", RO_GF_NORMAL) == RO_GF_NORMAL && - ((locationIt.rc == RC_GF_GERUDO_MEMBERSHIP_CARD && CVar_GetS32("gRandomizeShuffleGerudoToken", RO_GENERIC_NO) == RO_GENERIC_YES) || - (locationIt.rcType == RCTYPE_GF_KEY && CVar_GetS32("gRandomizeGerudoKeys", RO_GERUDO_KEYS_VANILLA) != RO_GERUDO_KEYS_VANILLA)) + (CVarGetInteger("gRandomizeGerudoFortress", RO_GF_NORMAL) == RO_GF_NORMAL && + ((locationIt.rc == RC_GF_GERUDO_MEMBERSHIP_CARD && CVarGetInteger("gRandomizeShuffleGerudoToken", RO_GENERIC_NO) == RO_GENERIC_YES) || + (locationIt.rcType == RCTYPE_GF_KEY && CVarGetInteger("gRandomizeGerudoKeys", RO_GERUDO_KEYS_VANILLA) != RO_GERUDO_KEYS_VANILLA)) ) ) ); diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp index d3790ccc1..f8a3c19c2 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include "3drando/item_location.hpp" @@ -109,7 +109,7 @@ std::vector buttons = { BTN_A, BTN_B, BTN_CUP, BTN_CDOWN, BTN_CLEFT, void DrawCheckTracker(bool& open) { if (!open) { - CVar_SetS32("gCheckTrackerEnabled", 0); + CVarSetInteger("gCheckTrackerEnabled", 0); return; } @@ -120,14 +120,14 @@ void DrawCheckTracker(bool& open) { return; } - if (CVar_GetS32("gCheckTrackerWindowType", 1) == 0) { - if (CVar_GetS32("gCheckTrackerShowOnlyPaused", 0) == 1) + if (CVarGetInteger("gCheckTrackerWindowType", 1) == 0) { + if (CVarGetInteger("gCheckTrackerShowOnlyPaused", 0) == 1) if (gPlayState == nullptr || gPlayState->pauseCtx.state == 0) return; - if (CVar_GetS32("gCheckTrackerDisplayType", 0) == 1) { - int comboButton1Mask = buttons[CVar_GetS32("gCheckTrackerComboButton1", 6)]; - int comboButton2Mask = buttons[CVar_GetS32("gCheckTrackerComboButton2", 8)]; + if (CVarGetInteger("gCheckTrackerDisplayType", 0) == 1) { + int comboButton1Mask = buttons[CVarGetInteger("gCheckTrackerComboButton1", 6)]; + int comboButton2Mask = buttons[CVarGetInteger("gCheckTrackerComboButton2", 8)]; bool comboButtonsHeld = trackerButtonsPressed != nullptr && trackerButtonsPressed[0].button & comboButton1Mask && trackerButtonsPressed[0].button & comboButton2Mask; @@ -213,17 +213,17 @@ void DrawCheckTracker(bool& open) { RainbowTick(); bool doDraw = false; bool thisAreaFullyChecked = false; - bool showHidden = CVar_GetS32("gCheckTrackerOptionShowHidden", 0); - bool hideIncomplete = CVar_GetS32("gCheckTrackerAreaIncompleteHide", 0); - bool hideComplete = CVar_GetS32("gCheckTrackerAreaCompleteHide", 0); + bool showHidden = CVarGetInteger("gCheckTrackerOptionShowHidden", 0); + bool hideIncomplete = CVarGetInteger("gCheckTrackerAreaIncompleteHide", 0); + bool hideComplete = CVarGetInteger("gCheckTrackerAreaCompleteHide", 0); bool collapseLogic; bool doingCollapseOrExpand = optExpandAll || optCollapseAll; bool isThisAreaSpoiled; RandomizerCheckArea lastArea = RCAREA_INVALID; - Color_RGBA8 areaCompleteColor = CVar_GetRGBA("gCheckTrackerAreaMainCompleteColor", Color_Main_Default); - Color_RGBA8 areaIncompleteColor = CVar_GetRGBA("gCheckTrackerAreaMainIncompleteColor", Color_Main_Default); - Color_RGBA8 extraCompleteColor = CVar_GetRGBA("gCheckTrackerAreaExtraCompleteColor", Color_Area_Complete_Extra_Default); - Color_RGBA8 extraIncompleteColor = CVar_GetRGBA("gCheckTrackerAreaExtraIncompleteColor", Color_Area_Incomplete_Extra_Default); + Color_RGBA8 areaCompleteColor = CVarGetColor("gCheckTrackerAreaMainCompleteColor", Color_Main_Default); + Color_RGBA8 areaIncompleteColor = CVarGetColor("gCheckTrackerAreaMainIncompleteColor", Color_Main_Default); + Color_RGBA8 extraCompleteColor = CVarGetColor("gCheckTrackerAreaExtraCompleteColor", Color_Area_Complete_Extra_Default); + Color_RGBA8 extraIncompleteColor = CVarGetColor("gCheckTrackerAreaExtraIncompleteColor", Color_Area_Incomplete_Extra_Default); Color_RGBA8 mainColor; Color_RGBA8 extraColor; std::string stemp; @@ -283,7 +283,7 @@ void DrawCheckTracker(bool& open) { ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(extraColor.r / 255.0f, extraColor.g / 255.0f, extraColor.b / 255.0f, extraColor.a / 255.0f)); - isThisAreaSpoiled = areasSpoiled & areaMask || CVar_GetS32("gCheckTrackerOptionMQSpoilers", 0); + isThisAreaSpoiled = areasSpoiled & areaMask || CVarGetInteger("gCheckTrackerOptionMQSpoilers", 0); if (isThisAreaSpoiled) { if (showVOrMQ && RandomizerCheckObjects::AreaIsDungeon(obj.rcArea)) { @@ -334,12 +334,12 @@ void BeginFloatWindows(std::string UniqueName, ImGuiWindowFlags flags) { ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_NoFocusOnAppearing; } - if (!CVar_GetS32("gCheckTrackerWindowType", 1)) { + if (!CVarGetInteger("gCheckTrackerWindowType", 1)) { ImGui::SetNextWindowViewport(ImGui::GetMainViewport()->ID); windowFlags |= ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoScrollbar; - if (!CVar_GetS32("gCheckTrackerHudEditMode", 0)) { + if (!CVarGetInteger("gCheckTrackerHudEditMode", 0)) { windowFlags |= ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoMove; } } @@ -602,7 +602,7 @@ bool SlowUpdateCheck() { bool ShouldUpdateChecks() { // TODO eventually will need to be hooked into game elements rather than just save file - if (CVar_GetS32("gCheckTrackerOptionPerformanceMode", 0)) + if (CVarGetInteger("gCheckTrackerOptionPerformanceMode", 0)) return SlowUpdateCheck(); else return true; @@ -742,7 +742,7 @@ bool HasItemBeenCollected(RandomizerCheckObject obj) { case SpoilerCollectionCheckType::SPOILER_CHK_GRAVEDIGGER: // Gravedigger has a fix in place that means one of two save locations. Check both. return (gSaveContext.itemGetInf[1] & 0x1000) || // vanilla flag - ((gSaveContext.n64ddFlag || CVar_GetS32("gGravediggingTourFix", 0)) && + ((gSaveContext.n64ddFlag || CVarGetInteger("gGravediggingTourFix", 0)) && gSaveContext.sceneFlags[scene].collect & (1 << flag)); // rando/fix flag default: return false; @@ -754,43 +754,43 @@ void DrawLocation(RandomizerCheckObject rcObj, RandomizerCheckShow* thisCheckSta Color_RGBA8 mainColor; Color_RGBA8 extraColor; std::string txt; - bool showHidden = CVar_GetS32("gCheckTrackerOptionShowHidden", 0); + bool showHidden = CVarGetInteger("gCheckTrackerOptionShowHidden", 0); if (*thisCheckStatus == RCSHOW_UNCHECKED) { - if (!showHidden && CVar_GetS32("gCheckTrackerUncheckedHide", 0)) + if (!showHidden && CVarGetInteger("gCheckTrackerUncheckedHide", 0)) return; - mainColor = CVar_GetRGBA("gCheckTrackerUncheckedMainColor", Color_Main_Default); - extraColor = CVar_GetRGBA("gCheckTrackerUncheckedExtraColor", Color_Unchecked_Extra_Default); + mainColor = CVarGetColor("gCheckTrackerUncheckedMainColor", Color_Main_Default); + extraColor = CVarGetColor("gCheckTrackerUncheckedExtraColor", Color_Unchecked_Extra_Default); } else if (*thisCheckStatus == RCSHOW_SKIPPED) { - if (!showHidden && CVar_GetS32("gCheckTrackerSkippedHide", 0)) + if (!showHidden && CVarGetInteger("gCheckTrackerSkippedHide", 0)) return; - mainColor = CVar_GetRGBA("gCheckTrackerSkippedMainColor", Color_Main_Default); - extraColor = CVar_GetRGBA("gCheckTrackerSkippedExtraColor", Color_Skipped_Extra_Default); + mainColor = CVarGetColor("gCheckTrackerSkippedMainColor", Color_Main_Default); + extraColor = CVarGetColor("gCheckTrackerSkippedExtraColor", Color_Skipped_Extra_Default); } else if (*thisCheckStatus == RCSHOW_SEEN) { - if (!showHidden && CVar_GetS32("gCheckTrackerSeenHide", 0)) + if (!showHidden && CVarGetInteger("gCheckTrackerSeenHide", 0)) return; - mainColor = CVar_GetRGBA("gCheckTrackerSeenMainColor", Color_Main_Default); - extraColor = CVar_GetRGBA("gCheckTrackerSeenExtraColor", Color_Seen_Extra_Default); + mainColor = CVarGetColor("gCheckTrackerSeenMainColor", Color_Main_Default); + extraColor = CVarGetColor("gCheckTrackerSeenExtraColor", Color_Seen_Extra_Default); } else if (*thisCheckStatus == RCSHOW_HINTED) { - if (!showHidden && CVar_GetS32("gCheckTrackerHintedHide", 0)) + if (!showHidden && CVarGetInteger("gCheckTrackerHintedHide", 0)) return; - mainColor = CVar_GetRGBA("gCheckTrackerHintedMainColor", Color_Main_Default); - extraColor = CVar_GetRGBA("gCheckTrackerHintedExtraColor", Color_Hinted_Extra_Default); + mainColor = CVarGetColor("gCheckTrackerHintedMainColor", Color_Main_Default); + extraColor = CVarGetColor("gCheckTrackerHintedExtraColor", Color_Hinted_Extra_Default); } else if (*thisCheckStatus == RCSHOW_CHECKED) { - if (!showHidden && CVar_GetS32("gCheckTrackerCheckedHide", 0)) + if (!showHidden && CVarGetInteger("gCheckTrackerCheckedHide", 0)) return; - mainColor = CVar_GetRGBA("gCheckTrackerCheckedMainColor", Color_Main_Default); - extraColor = CVar_GetRGBA("gCheckTrackerCheckedExtraColor", Color_Checked_Extra_Default); + mainColor = CVarGetColor("gCheckTrackerCheckedMainColor", Color_Main_Default); + extraColor = CVarGetColor("gCheckTrackerCheckedExtraColor", Color_Checked_Extra_Default); } else if (*thisCheckStatus == RCSHOW_SCUMMED) { - if (!showHidden && CVar_GetS32("gCheckTrackerScummedHide", 0)) + if (!showHidden && CVarGetInteger("gCheckTrackerScummedHide", 0)) return; - mainColor = CVar_GetRGBA("gCheckTrackerScummedMainColor", Color_Main_Default); - extraColor = CVar_GetRGBA("gCheckTrackerScummedExtraColor", Color_Scummed_Extra_Default); + mainColor = CVarGetColor("gCheckTrackerScummedMainColor", Color_Main_Default); + extraColor = CVarGetColor("gCheckTrackerScummedExtraColor", Color_Scummed_Extra_Default); } else if (*thisCheckStatus == RCSHOW_SAVED) { - if (!showHidden && CVar_GetS32("gCheckTrackerSavedHide", 0)) + if (!showHidden && CVarGetInteger("gCheckTrackerSavedHide", 0)) return; - mainColor = CVar_GetRGBA("gCheckTrackerSavedMainColor", Color_Main_Default); - extraColor = CVar_GetRGBA("gCheckTrackerSavedExtraColor", Color_Saved_Extra_Default); + mainColor = CVarGetColor("gCheckTrackerSavedMainColor", Color_Main_Default); + extraColor = CVarGetColor("gCheckTrackerSavedExtraColor", Color_Saved_Extra_Default); } //Main Text @@ -870,9 +870,9 @@ static std::set rainbowCVars = { int hue = 0; void RainbowTick() { - float freqHue = hue * 2 * M_PI / (360 * CVar_GetFloat("gCosmetics.RainbowSpeed", 0.6f)); + float freqHue = hue * 2 * M_PI / (360 * CVarGetFloat("gCosmetics.RainbowSpeed", 0.6f)); for (auto cvar : rainbowCVars) { - if (CVar_GetS32((cvar + "RBM").c_str(), 0) == 0) + if (CVarGetInteger((cvar + "RBM").c_str(), 0) == 0) continue; Color_RGBA8 newColor; @@ -881,7 +881,7 @@ void RainbowTick() { newColor.b = sin(freqHue + (4 * M_PI / 3)) * 127 + 128; newColor.a = 255; - CVar_SetRGBA(cvar.c_str(), newColor); + CVarSetColor(cvar.c_str(), newColor); } hue++; @@ -891,8 +891,8 @@ void RainbowTick() { void ImGuiDrawTwoColorPickerSection(const char* text, const char* cvarMainName, const char* cvarExtraName, Color_RGBA8& main_color, Color_RGBA8& extra_color, Color_RGBA8& main_default_color, Color_RGBA8& extra_default_color, const char* cvarHideName) { - Color_RGBA8 cvarMainColor = CVar_GetRGBA(cvarMainName, main_default_color); - Color_RGBA8 cvarExtraColor = CVar_GetRGBA(cvarExtraName, extra_default_color); + Color_RGBA8 cvarMainColor = CVarGetColor(cvarMainName, main_default_color); + Color_RGBA8 cvarExtraColor = CVarGetColor(cvarExtraName, extra_default_color); main_color = cvarMainColor; extra_color = cvarExtraColor; @@ -914,7 +914,7 @@ void ImGuiDrawTwoColorPickerSection(const char* text, const char* cvarMainName, ImVec4(main_color.r, main_color.g, main_color.b, main_color.a), ImVec4(main_default_color.r, main_default_color.g, main_default_color.b, main_default_color.a))) { - main_color = CVar_GetRGBA(cvarMainName, main_default_color); + main_color = CVarGetColor(cvarMainName, main_default_color); }; ImGui::PopItemWidth(); @@ -925,7 +925,7 @@ void ImGuiDrawTwoColorPickerSection(const char* text, const char* cvarMainName, ImVec4(extra_color.r, extra_color.g, extra_color.b, extra_color.a), ImVec4(extra_default_color.r, extra_default_color.g, extra_default_color.b, extra_default_color.a))) { - extra_color = CVar_GetRGBA(cvarExtraName, extra_default_color); + extra_color = CVarGetColor(cvarExtraName, extra_default_color); } ImGui::PopItemWidth(); @@ -942,7 +942,7 @@ const char* buttonStrings[] = { "A Button", "B Button", "C-Up", "C-Down", "C-Le "Z Button", "R Button", "Start", "D-Up", "D-Down", "D-Left", "D-Right" }; void DrawCheckTrackerOptions(bool& open) { if (!open) { - CVar_SetS32("gCheckTrackerSettingsEnabled", 0); + CVarSetInteger("gCheckTrackerSettingsEnabled", 0); return; } @@ -966,7 +966,7 @@ void DrawCheckTrackerOptions(bool& open) { ImVec4(Color_Bg_Default.r, Color_Bg_Default.g, Color_Bg_Default.b, Color_Bg_Default.a), false, true)) { - Color_Background = CVar_GetRGBA("gCheckTrackerBgColor", Color_Bg_Default); + Color_Background = CVarGetColor("gCheckTrackerBgColor", Color_Bg_Default); } ImGui::PopItemWidth(); @@ -974,13 +974,13 @@ void DrawCheckTrackerOptions(bool& open) { ImGui::SameLine(); UIWidgets::EnhancementCombobox("gCheckTrackerWindowType", windowType, 2, 1); - if (CVar_GetS32("gCheckTrackerWindowType", 1) == 0) { + if (CVarGetInteger("gCheckTrackerWindowType", 1) == 0) { UIWidgets::EnhancementCheckbox("Enable Dragging", "gCheckTrackerHudEditMode"); UIWidgets::EnhancementCheckbox("Only enable while paused", "gCheckTrackerShowOnlyPaused"); ImGui::Text("Display Mode"); ImGui::SameLine(); UIWidgets::EnhancementCombobox("gCheckTrackerDisplayType", displayType, 2, 0); - if (CVar_GetS32("gCheckTrackerDisplayType", 0) > 0) { + if (CVarGetInteger("gCheckTrackerDisplayType", 0) > 0) { ImGui::Text("Combo Button 1"); ImGui::SameLine(); UIWidgets::EnhancementCombobox("gCheckTrackerComboButton1", buttonStrings, 14, 6); @@ -1012,27 +1012,27 @@ void DrawCheckTrackerOptions(bool& open) { } void InitCheckTracker() { - SohImGui::AddWindow("Randomizer", "Check Tracker", DrawCheckTracker, CVar_GetS32("gCheckTrackerEnabled", 0) == 1); + SohImGui::AddWindow("Randomizer", "Check Tracker", DrawCheckTracker, CVarGetInteger("gCheckTrackerEnabled", 0) == 1); SohImGui::AddWindow("Randomizer", "Check Tracker Settings", DrawCheckTrackerOptions); - Color_Background = CVar_GetRGBA("gCheckTrackerBgColor", Color_Bg_Default); - Color_Area_Incomplete_Main = CVar_GetRGBA("gCheckTrackerAreaMainIncompleteColor", Color_Main_Default); - Color_Area_Incomplete_Extra = CVar_GetRGBA("gCheckTrackerAreaExtraIncompleteColor", Color_Area_Incomplete_Extra_Default); - Color_Area_Complete_Main = CVar_GetRGBA("gCheckTrackerAreaMainCompleteColor", Color_Main_Default); - Color_Area_Complete_Extra = CVar_GetRGBA("gCheckTrackerAreaExtraCompleteColor", Color_Area_Complete_Extra_Default); - Color_Unchecked_Main = CVar_GetRGBA("gCheckTrackerUncheckedMainColor", Color_Main_Default); - Color_Unchecked_Extra = CVar_GetRGBA("gCheckTrackerUncheckedExtraColor", Color_Unchecked_Extra_Default); - Color_Skipped_Main = CVar_GetRGBA("gCheckTrackerSkippedMainColor", Color_Main_Default); - Color_Skipped_Extra = CVar_GetRGBA("gCheckTrackerSkippedExtraColor", Color_Skipped_Extra_Default); - Color_Seen_Main = CVar_GetRGBA("gCheckTrackerSeenMainColor", Color_Main_Default); - Color_Seen_Extra = CVar_GetRGBA("gCheckTrackerSeenExtraColor", Color_Seen_Extra_Default); - Color_Hinted_Main = CVar_GetRGBA("gCheckTrackerHintedMainColor", Color_Main_Default); - Color_Hinted_Extra = CVar_GetRGBA("gCheckTrackerHintedExtraColor", Color_Hinted_Extra_Default); - Color_Checked_Main = CVar_GetRGBA("gCheckTrackerCheckedMainColor", Color_Main_Default); - Color_Checked_Extra = CVar_GetRGBA("gCheckTrackerCheckedExtraColor", Color_Checked_Extra_Default); - Color_Scummed_Main = CVar_GetRGBA("gCheckTrackerScummedMainColor", Color_Main_Default); - Color_Scummed_Extra = CVar_GetRGBA("gCheckTrackerScummedExtraColor", Color_Scummed_Extra_Default); - Color_Saved_Main = CVar_GetRGBA("gCheckTrackerSavedMainColor", Color_Main_Default); - Color_Saved_Extra = CVar_GetRGBA("gCheckTrackerSavedExtraColor", Color_Saved_Extra_Default); + Color_Background = CVarGetColor("gCheckTrackerBgColor", Color_Bg_Default); + Color_Area_Incomplete_Main = CVarGetColor("gCheckTrackerAreaMainIncompleteColor", Color_Main_Default); + Color_Area_Incomplete_Extra = CVarGetColor("gCheckTrackerAreaExtraIncompleteColor", Color_Area_Incomplete_Extra_Default); + Color_Area_Complete_Main = CVarGetColor("gCheckTrackerAreaMainCompleteColor", Color_Main_Default); + Color_Area_Complete_Extra = CVarGetColor("gCheckTrackerAreaExtraCompleteColor", Color_Area_Complete_Extra_Default); + Color_Unchecked_Main = CVarGetColor("gCheckTrackerUncheckedMainColor", Color_Main_Default); + Color_Unchecked_Extra = CVarGetColor("gCheckTrackerUncheckedExtraColor", Color_Unchecked_Extra_Default); + Color_Skipped_Main = CVarGetColor("gCheckTrackerSkippedMainColor", Color_Main_Default); + Color_Skipped_Extra = CVarGetColor("gCheckTrackerSkippedExtraColor", Color_Skipped_Extra_Default); + Color_Seen_Main = CVarGetColor("gCheckTrackerSeenMainColor", Color_Main_Default); + Color_Seen_Extra = CVarGetColor("gCheckTrackerSeenExtraColor", Color_Seen_Extra_Default); + Color_Hinted_Main = CVarGetColor("gCheckTrackerHintedMainColor", Color_Main_Default); + Color_Hinted_Extra = CVarGetColor("gCheckTrackerHintedExtraColor", Color_Hinted_Extra_Default); + Color_Checked_Main = CVarGetColor("gCheckTrackerCheckedMainColor", Color_Main_Default); + Color_Checked_Extra = CVarGetColor("gCheckTrackerCheckedExtraColor", Color_Checked_Extra_Default); + Color_Scummed_Main = CVarGetColor("gCheckTrackerScummedMainColor", Color_Main_Default); + Color_Scummed_Extra = CVarGetColor("gCheckTrackerScummedExtraColor", Color_Scummed_Extra_Default); + Color_Saved_Main = CVarGetColor("gCheckTrackerSavedMainColor", Color_Main_Default); + Color_Saved_Extra = CVarGetColor("gCheckTrackerSavedExtraColor", Color_Saved_Extra_Default); Ship::RegisterHook([](OSContPad* cont_pad) { trackerButtonsPressed = cont_pad; diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp index 2856b31e5..53315d636 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include extern "C" { @@ -607,7 +607,7 @@ void InitEntranceTrackingData() { void DrawEntranceTracker(bool& open) { if (!open) { - CVar_SetS32("gEntranceTrackerEnabled", 0); + CVarSetInteger("gEntranceTrackerEnabled", 0); return; } @@ -717,8 +717,8 @@ void DrawEntranceTracker(bool& open) { nextTreeState = 2; } - uint8_t destToggle = CVar_GetS32("gEntranceTrackerSortBy", 0); - uint8_t groupToggle = CVar_GetS32("gEntranceTrackerGroupBy", 0); + uint8_t destToggle = CVarGetInteger("gEntranceTrackerSortBy", 0); + uint8_t groupToggle = CVarGetInteger("gEntranceTrackerGroupBy", 0); // Combine destToggle and groupToggle to get a range of 0-3 uint8_t groupType = destToggle + (groupToggle * 2); @@ -765,8 +765,8 @@ void DrawEntranceTracker(bool& open) { bool isDiscovered = IsEntranceDiscovered(entrance.index); - bool showOriginal = (!destToggle ? CVar_GetS32("gEntranceTrackerShowTo", 0) : CVar_GetS32("gEntranceTrackerShowFrom", 0)) || isDiscovered; - bool showOverride = (!destToggle ? CVar_GetS32("gEntranceTrackerShowFrom", 0) : CVar_GetS32("gEntranceTrackerShowTo", 0)) || isDiscovered; + bool showOriginal = (!destToggle ? CVarGetInteger("gEntranceTrackerShowTo", 0) : CVarGetInteger("gEntranceTrackerShowFrom", 0)) || isDiscovered; + bool showOverride = (!destToggle ? CVarGetInteger("gEntranceTrackerShowFrom", 0) : CVarGetInteger("gEntranceTrackerShowTo", 0)) || isDiscovered; const char* origSrcAreaName = spoilerEntranceGroupNames[original->srcGroup].c_str(); const char* origTypeName = groupTypeNames[original->type].c_str(); @@ -779,7 +779,7 @@ void DrawEntranceTracker(bool& open) { const char* rplcDstName = showOverride ? override->destination.c_str() : ""; // Filter for entrances by group name, type, source/destination names, and meta tags - if ((!locationSearch.IsActive() && (showOriginal || showOverride || !CVar_GetS32("gEntranceTrackerCollapseUndiscovered", 0))) || + if ((!locationSearch.IsActive() && (showOriginal || showOverride || !CVarGetInteger("gEntranceTrackerCollapseUndiscovered", 0))) || ((showOriginal && (locationSearch.PassFilter(origSrcName) || locationSearch.PassFilter(origDstName) || locationSearch.PassFilter(origSrcAreaName) || locationSearch.PassFilter(origTypeName) || locationSearch.PassFilter(original->metaTag.c_str()))) || @@ -817,8 +817,8 @@ void DrawEntranceTracker(bool& open) { bool isDiscovered = IsEntranceDiscovered(entrance.index); - bool showOriginal = (!destToggle ? CVar_GetS32("gEntranceTrackerShowTo", 0) : CVar_GetS32("gEntranceTrackerShowFrom", 0)) || isDiscovered; - bool showOverride = (!destToggle ? CVar_GetS32("gEntranceTrackerShowFrom", 0) : CVar_GetS32("gEntranceTrackerShowTo", 0)) || isDiscovered; + bool showOriginal = (!destToggle ? CVarGetInteger("gEntranceTrackerShowTo", 0) : CVarGetInteger("gEntranceTrackerShowFrom", 0)) || isDiscovered; + bool showOverride = (!destToggle ? CVarGetInteger("gEntranceTrackerShowFrom", 0) : CVarGetInteger("gEntranceTrackerShowTo", 0)) || isDiscovered; const char* unknown = "???"; @@ -831,18 +831,18 @@ void DrawEntranceTracker(bool& open) { // Handle highlighting and auto scroll if (LinkIsInArea(original) != -1) { - if (CVar_GetS32("gEntranceTrackerHighlightAvailable", 0)) { + if (CVarGetInteger("gEntranceTrackerHighlightAvailable", 0)) { color = COLOR_GREEN; } if (doAreaScroll) { doAreaScroll = false; - if (CVar_GetS32("gEntranceTrackerAutoScroll", 0)) { + if (CVarGetInteger("gEntranceTrackerAutoScroll", 0)) { ImGui::SetScrollHereY(0.0f); } } } else if (original->index == lastEntranceIndex) { - if (CVar_GetS32("gEntranceTrackerHighlightPrevious", 0)) { + if (CVarGetInteger("gEntranceTrackerHighlightPrevious", 0)) { color = COLOR_ORANGE; } } @@ -887,5 +887,5 @@ void DrawEntranceTracker(bool& open) { } void InitEntranceTracker() { - SohImGui::AddWindow("Randomizer", "Entrance Tracker", DrawEntranceTracker, CVar_GetS32("gEntranceTrackerEnabled", 0) == 1); + SohImGui::AddWindow("Randomizer", "Entrance Tracker", DrawEntranceTracker, CVarGetInteger("gEntranceTrackerEnabled", 0) == 1); } diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index e96972be4..11202a5ae 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include extern "C" { @@ -352,11 +352,11 @@ ItemTrackerNumbers GetItemCurrentAndMax(ItemTrackerItem item) { #define IM_COL_PURPLE IM_COL32(180, 90, 200, 255) void DrawItemCount(ItemTrackerItem item) { - int iconSize = CVar_GetS32("gItemTrackerIconSize", 36); + int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); ItemTrackerNumbers currentAndMax = GetItemCurrentAndMax(item); ImVec2 p = ImGui::GetCursorScreenPos(); - int32_t trackerNumberDisplayMode = CVar_GetS32("gItemTrackerCapacityTrack", 1); - int32_t trackerKeyNumberDisplayMode = CVar_GetS32("gItemTrackerKeyTrack", 0); + int32_t trackerNumberDisplayMode = CVarGetInteger("gItemTrackerCapacityTrack", 1); + int32_t trackerKeyNumberDisplayMode = CVarGetInteger("gItemTrackerKeyTrack", 0); if (item.id == ITEM_KEY_SMALL && IsValidSaveFile()) { std::string currentString = ""; @@ -387,7 +387,7 @@ void DrawItemCount(ItemTrackerItem item) { ImU32 currentColor = IM_COL_WHITE; ImU32 maxColor = item.id == QUEST_SKULL_TOKEN ? IM_COL_RED : IM_COL_GREEN; - bool shouldAlignToLeft = CVar_GetS32("gItemTrackerCurrentOnLeft", 0) && + bool shouldAlignToLeft = CVarGetInteger("gItemTrackerCurrentOnLeft", 0) && trackerNumberDisplayMode != ITEM_TRACKER_NUMBER_CAPACITY && trackerNumberDisplayMode != ITEM_TRACKER_NUMBER_AMMO; @@ -446,7 +446,7 @@ void DrawItemCount(ItemTrackerItem item) { void DrawEquip(ItemTrackerItem item) { bool hasEquip = (item.data & gSaveContext.inventory.equipment) != 0; - int iconSize = CVar_GetS32("gItemTrackerIconSize", 36); + int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); ImGui::Image(SohImGui::GetTextureByName(hasEquip && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); @@ -455,7 +455,7 @@ void DrawEquip(ItemTrackerItem item) { void DrawQuest(ItemTrackerItem item) { bool hasQuestItem = (item.data & gSaveContext.inventory.questItems) != 0; - int iconSize = CVar_GetS32("gItemTrackerIconSize", 36); + int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); ImGui::BeginGroup(); ImGui::Image(SohImGui::GetTextureByName(hasQuestItem && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); @@ -471,7 +471,7 @@ void DrawQuest(ItemTrackerItem item) { void DrawItem(ItemTrackerItem item) { uint32_t actualItemId = INV_CONTENT(item.id); - int iconSize = CVar_GetS32("gItemTrackerIconSize", 36); + int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); bool hasItem = actualItemId != ITEM_NONE; if (item.id == ITEM_NONE) { @@ -532,7 +532,7 @@ void DrawBottle(ItemTrackerItem item) { item = actualItemTrackerItemMap[actualItemId]; } - int iconSize = CVar_GetS32("gItemTrackerIconSize", 36); + int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); ImGui::Image(SohImGui::GetTextureByName(hasItem && IsValidSaveFile() ? item.name : item.nameFaded), ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1)); @@ -543,7 +543,7 @@ void DrawDungeonItem(ItemTrackerItem item) { uint32_t itemId = item.id; ImU32 dungeonColor = IM_COL_WHITE; uint32_t bitMask = 1 << (item.id - ITEM_KEY_BOSS); // Bitset starts at ITEM_KEY_BOSS == 0. the rest are sequential - int iconSize = CVar_GetS32("gItemTrackerIconSize", 36); + int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); bool hasItem = (bitMask & gSaveContext.inventory.dungeonItems[item.data]) != 0; bool hasSmallKey = (gSaveContext.inventory.dungeonKeys[item.data]) >= 0; ImGui::BeginGroup(); @@ -587,7 +587,7 @@ void DrawDungeonItem(ItemTrackerItem item) { } void DrawSong(ItemTrackerItem item) { - int iconSize = CVar_GetS32("gItemTrackerIconSize", 36); + int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); uint32_t bitMask = 1 << item.id; bool hasSong = (bitMask & gSaveContext.inventory.questItems) != 0; ImVec2 p = ImGui::GetCursorScreenPos(); @@ -601,8 +601,8 @@ static ImVector itemTrackerNotes; void DrawNotes(bool resizeable = false) { ImGui::BeginGroup(); - int iconSize = CVar_GetS32("gItemTrackerIconSize", 36); - int iconSpacing = CVar_GetS32("gItemTrackerIconSpacing", 12); + int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); + int iconSpacing = CVarGetInteger("gItemTrackerIconSpacing", 12); struct ItemTrackerNotes { static int TrackerNotesResizeCallback(ImGuiInputTextCallbackData* data) { @@ -627,7 +627,7 @@ void DrawNotes(bool resizeable = false) { ImVec2 size = resizeable ? ImVec2(-FLT_MIN, ImGui::GetContentRegionAvail().y) : ImVec2(((iconSize + iconSpacing) * 6) - 8, 200); ItemTrackerNotes::TrackerNotesInputTextMultiline("##ItemTrackerNotes", &itemTrackerNotes, size, ImGuiInputTextFlags_AllowTabInput); if (ImGui::IsItemDeactivatedAfterEdit() && IsValidSaveFile()) { - CVar_SetString(("gItemTrackerNotes" + std::to_string(gSaveContext.fileNum)).c_str(), std::string(std::begin(itemTrackerNotes), std::end(itemTrackerNotes)).c_str()); + CVarSetString(("gItemTrackerNotes" + std::to_string(gSaveContext.fileNum)).c_str(), std::string(std::begin(itemTrackerNotes), std::end(itemTrackerNotes)).c_str()); SohImGui::RequestCvarSaveOnNextTick(); } ImGui::EndGroup(); @@ -642,11 +642,11 @@ void BeginFloatingWindows(std::string UniqueName, ImGuiWindowFlags flags = 0) { windowFlags |= ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoResize; } - if (!CVar_GetS32("gItemTrackerWindowType", 0)) { + if (!CVarGetInteger("gItemTrackerWindowType", 0)) { ImGui::SetNextWindowViewport(ImGui::GetMainViewport()->ID); windowFlags |= ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoScrollbar; - if (!CVar_GetS32("gItemTrackerHudEditMode", 0)) { + if (!CVarGetInteger("gItemTrackerHudEditMode", 0)) { windowFlags |= ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoMove; } } @@ -667,9 +667,9 @@ void EndFloatingWindows() { * Takes in a vector of ItemTrackerItem and draws them in rows of N items */ void DrawItemsInRows(std::vector items, int columns = 6) { - int iconSize = CVar_GetS32("gItemTrackerIconSize", 36); - int iconSpacing = CVar_GetS32("gItemTrackerIconSpacing", 12); - int topPadding = CVar_GetS32("gItemTrackerWindowType", 0) ? 20 : 0; + int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); + int iconSpacing = CVarGetInteger("gItemTrackerIconSpacing", 12); + int topPadding = CVarGetInteger("gItemTrackerWindowType", 0) ? 20 : 0; for (int i = 0; i < items.size(); i++) { int row = i / columns; @@ -684,8 +684,8 @@ void DrawItemsInRows(std::vector items, int columns = 6) { * Takes in a vector of ItemTrackerItem and draws them evenly spread across a circle */ void DrawItemsInACircle(std::vector items) { - int iconSize = CVar_GetS32("gItemTrackerIconSize", 36); - int iconSpacing = CVar_GetS32("gItemTrackerIconSpacing", 12); + int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); + int iconSpacing = CVarGetInteger("gItemTrackerIconSpacing", 12); ImVec2 max = ImGui::GetWindowContentRegionMax(); float radius = (iconSize + iconSpacing) * 2; @@ -705,8 +705,8 @@ void DrawItemsInACircle(std::vector items) { * to then call DrawItemsInRows */ std::vector GetDungeonItemsVector(std::vector dungeons, int columns = 6) { - int iconSize = CVar_GetS32("gItemTrackerIconSize", 36); - int iconSpacing = CVar_GetS32("gItemTrackerIconSpacing", 12); + int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); + int iconSpacing = CVarGetInteger("gItemTrackerIconSpacing", 12); std::vector dungeonItems = {}; int rowCount = 0; @@ -752,7 +752,7 @@ std::vector GetDungeonItemsVector(std::vector options, s32 defaultValue) { - s32 currentValue = CVar_GetS32(cvar, defaultValue); + s32 currentValue = CVarGetInteger(cvar, defaultValue); std::string hiddenLabel = "##" + std::string(cvar); ImGui::Text(label); #ifdef __WIIU__ @@ -765,7 +765,7 @@ void LabeledComboBoxRightAligned(const char* label, const char* cvar, std::vecto if (ImGui::BeginCombo(hiddenLabel.c_str(), options[currentValue].c_str())) { for (int i = 0; i < options.size(); i++) { if (ImGui::Selectable(options[i].c_str())) { - CVar_SetS32(cvar, i); + CVarSetInteger(cvar, i); SohImGui::RequestCvarSaveOnNextTick(); shouldUpdateVectors = true; } @@ -780,9 +780,9 @@ void PaddedEnhancementCheckbox(const char* text, const char* cvarName, s32 defau if (padTop) { ImGui::Dummy(ImVec2(0.0f, 0.0f)); } - bool val = (bool)CVar_GetS32(cvarName, defaultValue); + bool val = (bool)CVarGetInteger(cvarName, defaultValue); if (ImGui::Checkbox(text, &val)) { - CVar_SetS32(cvarName, val); + CVarSetInteger(cvarName, val); SohImGui::RequestCvarSaveOnNextTick(); shouldUpdateVectors = true; } @@ -802,8 +802,8 @@ void UpdateVectors() { dungeonRewards.insert(dungeonRewards.end(), dungeonRewardMedallions.begin(), dungeonRewardMedallions.end()); dungeonItems.clear(); - if (CVar_GetS32("gItemTrackerDisplayDungeonItemsHorizontal", 1) && CVar_GetS32("gItemTrackerDungeonItemsDisplayType", 0) == 2) { - if (CVar_GetS32("gItemTrackerDisplayDungeonItemsMaps", 1)) { + if (CVarGetInteger("gItemTrackerDisplayDungeonItemsHorizontal", 1) && CVarGetInteger("gItemTrackerDungeonItemsDisplayType", 0) == 2) { + if (CVarGetInteger("gItemTrackerDisplayDungeonItemsMaps", 1)) { dungeonItems = GetDungeonItemsVector(itemTrackerDungeonsWithMapsHorizontal, 12); // Manually adding Thieves Hideout to an open spot so we don't get an additional row for one item dungeonItems[23] = ITEM_TRACKER_ITEM(ITEM_KEY_SMALL, SCENE_GERUDOWAY, DrawDungeonItem); @@ -813,7 +813,7 @@ void UpdateVectors() { dungeonItems[15] = ITEM_TRACKER_ITEM(ITEM_KEY_SMALL, SCENE_GERUDOWAY, DrawDungeonItem); } } else { - if (CVar_GetS32("gItemTrackerDisplayDungeonItemsMaps", 1)) { + if (CVarGetInteger("gItemTrackerDisplayDungeonItemsMaps", 1)) { dungeonItems = GetDungeonItemsVector(itemTrackerDungeonsWithMapsCompact); // Manually adding Thieves Hideout to an open spot so we don't get an additional row for one item dungeonItems[35] = ITEM_TRACKER_ITEM(ITEM_KEY_SMALL, SCENE_GERUDOWAY, DrawDungeonItem); @@ -823,28 +823,28 @@ void UpdateVectors() { } mainWindowItems.clear(); - if (CVar_GetS32("gItemTrackerInventoryItemsDisplayType", 1) == 1) { + if (CVarGetInteger("gItemTrackerInventoryItemsDisplayType", 1) == 1) { mainWindowItems.insert(mainWindowItems.end(), inventoryItems.begin(), inventoryItems.end()); } - if (CVar_GetS32("gItemTrackerEquipmentItemsDisplayType", 1) == 1) { + if (CVarGetInteger("gItemTrackerEquipmentItemsDisplayType", 1) == 1) { mainWindowItems.insert(mainWindowItems.end(), equipmentItems.begin(), equipmentItems.end()); } - if (CVar_GetS32("gItemTrackerMiscItemsDisplayType", 1) == 1) { + if (CVarGetInteger("gItemTrackerMiscItemsDisplayType", 1) == 1) { mainWindowItems.insert(mainWindowItems.end(), miscItems.begin(), miscItems.end()); } - if (CVar_GetS32("gItemTrackerDungeonRewardsDisplayType", 1) == 1) { + if (CVarGetInteger("gItemTrackerDungeonRewardsDisplayType", 1) == 1) { mainWindowItems.insert(mainWindowItems.end(), dungeonRewardStones.begin(), dungeonRewardStones.end()); mainWindowItems.insert(mainWindowItems.end(), dungeonRewardMedallions.begin(), dungeonRewardMedallions.end()); } - if (CVar_GetS32("gItemTrackerSongsDisplayType", 1) == 1) { - if (CVar_GetS32("gItemTrackerMiscItemsDisplayType", 1) == 1 && CVar_GetS32("gItemTrackerDungeonRewardsDisplayType", 1) != 1) { + if (CVarGetInteger("gItemTrackerSongsDisplayType", 1) == 1) { + if (CVarGetInteger("gItemTrackerMiscItemsDisplayType", 1) == 1 && CVarGetInteger("gItemTrackerDungeonRewardsDisplayType", 1) != 1) { mainWindowItems.push_back(ITEM_TRACKER_ITEM(ITEM_NONE, 0, DrawItem)); mainWindowItems.push_back(ITEM_TRACKER_ITEM(ITEM_NONE, 0, DrawItem)); mainWindowItems.push_back(ITEM_TRACKER_ITEM(ITEM_NONE, 0, DrawItem)); } mainWindowItems.insert(mainWindowItems.end(), songItems.begin(), songItems.end()); } - if (CVar_GetS32("gItemTrackerDungeonItemsDisplayType", 0) == 1) { + if (CVarGetInteger("gItemTrackerDungeonItemsDisplayType", 0) == 1) { mainWindowItems.insert(mainWindowItems.end(), dungeonItems.begin(), dungeonItems.end()); } @@ -854,56 +854,56 @@ void UpdateVectors() { void DrawItemTracker(bool& open) { UpdateVectors(); if (!open) { - CVar_SetS32("gItemTrackerEnabled", 0); + CVarSetInteger("gItemTrackerEnabled", 0); return; } - int iconSize = CVar_GetS32("gItemTrackerIconSize", 36); - int iconSpacing = CVar_GetS32("gItemTrackerIconSpacing", 12); - int comboButton1Mask = buttonMap[CVar_GetS32("gItemTrackerComboButton1", 6)]; - int comboButton2Mask = buttonMap[CVar_GetS32("gItemTrackerComboButton2", 8)]; + int iconSize = CVarGetInteger("gItemTrackerIconSize", 36); + int iconSpacing = CVarGetInteger("gItemTrackerIconSpacing", 12); + int comboButton1Mask = buttonMap[CVarGetInteger("gItemTrackerComboButton1", 6)]; + int comboButton2Mask = buttonMap[CVarGetInteger("gItemTrackerComboButton2", 8)]; bool comboButtonsHeld = buttonsPressed != nullptr && buttonsPressed[0].button & comboButton1Mask && buttonsPressed[0].button & comboButton2Mask; - bool isPaused = CVar_GetS32("gItemTrackerShowOnlyPaused", 0) == 0 || gPlayState != nullptr && gPlayState->pauseCtx.state > 0; + bool isPaused = CVarGetInteger("gItemTrackerShowOnlyPaused", 0) == 0 || gPlayState != nullptr && gPlayState->pauseCtx.state > 0; - if (CVar_GetS32("gItemTrackerWindowType", 0) == 1 || isPaused && (CVar_GetS32("gItemTrackerDisplayType", 0) == 0 ? CVar_GetS32("gItemTrackerEnabled", 0) : comboButtonsHeld)) { + if (CVarGetInteger("gItemTrackerWindowType", 0) == 1 || isPaused && (CVarGetInteger("gItemTrackerDisplayType", 0) == 0 ? CVarGetInteger("gItemTrackerEnabled", 0) : comboButtonsHeld)) { if ( - (CVar_GetS32("gItemTrackerInventoryItemsDisplayType", 1) == 1) || - (CVar_GetS32("gItemTrackerEquipmentItemsDisplayType", 1) == 1) || - (CVar_GetS32("gItemTrackerMiscItemsDisplayType", 1) == 1) || - (CVar_GetS32("gItemTrackerDungeonRewardsDisplayType", 1) == 1) || - (CVar_GetS32("gItemTrackerSongsDisplayType", 1) == 1) || - (CVar_GetS32("gItemTrackerDungeonItemsDisplayType", 0) == 1) || - (CVar_GetS32("gItemTrackerNotesDisplayType", 0) == 1) + (CVarGetInteger("gItemTrackerInventoryItemsDisplayType", 1) == 1) || + (CVarGetInteger("gItemTrackerEquipmentItemsDisplayType", 1) == 1) || + (CVarGetInteger("gItemTrackerMiscItemsDisplayType", 1) == 1) || + (CVarGetInteger("gItemTrackerDungeonRewardsDisplayType", 1) == 1) || + (CVarGetInteger("gItemTrackerSongsDisplayType", 1) == 1) || + (CVarGetInteger("gItemTrackerDungeonItemsDisplayType", 0) == 1) || + (CVarGetInteger("gItemTrackerNotesDisplayType", 0) == 1) ) { BeginFloatingWindows("Item Tracker##main window"); DrawItemsInRows(mainWindowItems, 6); - if (CVar_GetS32("gItemTrackerNotesDisplayType", 0) == 1 && CVar_GetS32("gItemTrackerDisplayType", 0) == 0) { + if (CVarGetInteger("gItemTrackerNotesDisplayType", 0) == 1 && CVarGetInteger("gItemTrackerDisplayType", 0) == 0) { DrawNotes(); } EndFloatingWindows(); } - if (CVar_GetS32("gItemTrackerInventoryItemsDisplayType", 1) == 2) { + if (CVarGetInteger("gItemTrackerInventoryItemsDisplayType", 1) == 2) { BeginFloatingWindows("Inventory Items Tracker"); DrawItemsInRows(inventoryItems); EndFloatingWindows(); } - if (CVar_GetS32("gItemTrackerEquipmentItemsDisplayType", 1) == 2) { + if (CVarGetInteger("gItemTrackerEquipmentItemsDisplayType", 1) == 2) { BeginFloatingWindows("Equipment Items Tracker"); DrawItemsInRows(equipmentItems, 3); EndFloatingWindows(); } - if (CVar_GetS32("gItemTrackerMiscItemsDisplayType", 1) == 2) { + if (CVarGetInteger("gItemTrackerMiscItemsDisplayType", 1) == 2) { BeginFloatingWindows("Misc Items Tracker"); DrawItemsInRows(miscItems, 4); EndFloatingWindows(); } - if (CVar_GetS32("gItemTrackerDungeonRewardsDisplayType", 1) == 2) { + if (CVarGetInteger("gItemTrackerDungeonRewardsDisplayType", 1) == 2) { BeginFloatingWindows("Dungeon Rewards Tracker"); - if (CVar_GetS32("gItemTrackerDungeonRewardsCircle", 0) == 1) { + if (CVarGetInteger("gItemTrackerDungeonRewardsCircle", 0) == 1) { ImGui::BeginGroup(); DrawItemsInACircle(dungeonRewardMedallions); ImGui::EndGroup(); @@ -916,16 +916,16 @@ void DrawItemTracker(bool& open) { EndFloatingWindows(); } - if (CVar_GetS32("gItemTrackerSongsDisplayType", 1) == 2) { + if (CVarGetInteger("gItemTrackerSongsDisplayType", 1) == 2) { BeginFloatingWindows("Songs Tracker"); DrawItemsInRows(songItems); EndFloatingWindows(); } - if (CVar_GetS32("gItemTrackerDungeonItemsDisplayType", 0) == 2) { + if (CVarGetInteger("gItemTrackerDungeonItemsDisplayType", 0) == 2) { BeginFloatingWindows("Dungeon Items Tracker"); - if (CVar_GetS32("gItemTrackerDisplayDungeonItemsHorizontal", 1)) { - if (CVar_GetS32("gItemTrackerDisplayDungeonItemsMaps", 1)) { + if (CVarGetInteger("gItemTrackerDisplayDungeonItemsHorizontal", 1)) { + if (CVarGetInteger("gItemTrackerDisplayDungeonItemsMaps", 1)) { DrawItemsInRows(dungeonItems, 12); } else { DrawItemsInRows(dungeonItems, 8); @@ -936,7 +936,7 @@ void DrawItemTracker(bool& open) { EndFloatingWindows(); } - if (CVar_GetS32("gItemTrackerNotesDisplayType", 0) == 2 && CVar_GetS32("gItemTrackerDisplayType", 0) == 0) { + if (CVarGetInteger("gItemTrackerNotesDisplayType", 0) == 2 && CVarGetInteger("gItemTrackerDisplayType", 0) == 0) { ImGui::SetNextWindowSize(ImVec2(400,300), ImGuiCond_FirstUseEver); BeginFloatingWindows("Personal Notes", ImGuiWindowFlags_NoFocusOnAppearing); DrawNotes(true); @@ -950,7 +950,7 @@ const char* itemTrackerKeyTrackOptions[3] = { "Collected / Max", "Current / Coll void DrawItemTrackerOptions(bool& open) { if (!open) { - CVar_SetS32("gItemTrackerSettingsEnabled", 0); + CVarSetInteger("gItemTrackerSettingsEnabled", 0); return; } @@ -972,21 +972,21 @@ void DrawItemTrackerOptions(bool& open) { ImGui::SameLine(); ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x); if (ImGui::ColorEdit4("BG Color##gItemTrackerBgColor", (float*)&ChromaKeyBackground, ImGuiColorEditFlags_AlphaPreview | ImGuiColorEditFlags_AlphaBar | ImGuiColorEditFlags_NoLabel)) { - CVar_SetFloat("gItemTrackerBgColorR", ChromaKeyBackground.x); - CVar_SetFloat("gItemTrackerBgColorG", ChromaKeyBackground.y); - CVar_SetFloat("gItemTrackerBgColorB", ChromaKeyBackground.z); - CVar_SetFloat("gItemTrackerBgColorA", ChromaKeyBackground.w); + CVarSetFloat("gItemTrackerBgColorR", ChromaKeyBackground.x); + CVarSetFloat("gItemTrackerBgColorG", ChromaKeyBackground.y); + CVarSetFloat("gItemTrackerBgColorB", ChromaKeyBackground.z); + CVarSetFloat("gItemTrackerBgColorA", ChromaKeyBackground.w); SohImGui::RequestCvarSaveOnNextTick(); } ImGui::PopItemWidth(); LabeledComboBoxRightAligned("Window Type", "gItemTrackerWindowType", { "Floating", "Window" }, 0); - if (CVar_GetS32("gItemTrackerWindowType", 0) == 0) { + if (CVarGetInteger("gItemTrackerWindowType", 0) == 0) { PaddedEnhancementCheckbox("Enable Dragging", "gItemTrackerHudEditMode", 0); PaddedEnhancementCheckbox("Only enable while paused", "gItemTrackerShowOnlyPaused", 0); LabeledComboBoxRightAligned("Display Mode", "gItemTrackerDisplayType", { "Always", "Combo Button Hold" }, 0); - if (CVar_GetS32("gItemTrackerDisplayType", 0) > 0) { + if (CVarGetInteger("gItemTrackerDisplayType", 0) > 0) { LabeledComboBoxRightAligned("Combo Button 1", "gItemTrackerComboButton1", { "A", "B", "C-Up", "C-Down", "C-Left", "C-Right", "L", "Z", "R", "Start", "D-Up", "D-Down", "D-Left", "D-Right" }, 6); LabeledComboBoxRightAligned("Combo Button 2", "gItemTrackerComboButton2", { "A", "B", "C-Up", "C-Down", "C-Left", "C-Right", "L", "Z", "R", "Start", "D-Up", "D-Down", "D-Left", "D-Right" }, 8); } @@ -999,7 +999,7 @@ void DrawItemTrackerOptions(bool& open) { UIWidgets::EnhancementCombobox("gItemTrackerCapacityTrack", itemTrackerCapacityTrackOptions, 5, 1); UIWidgets::InsertHelpHoverText("Customize what the numbers under each item are tracking." "\n\nNote: items without capacity upgrades will track ammo even in capacity mode"); - if (CVar_GetS32("gItemTrackerCapacityTrack", 1) == ITEM_TRACKER_NUMBER_CURRENT_CAPACITY_ONLY || CVar_GetS32("gItemTrackerCapacityTrack", 1) == ITEM_TRACKER_NUMBER_CURRENT_AMMO_ONLY) { + if (CVarGetInteger("gItemTrackerCapacityTrack", 1) == ITEM_TRACKER_NUMBER_CURRENT_CAPACITY_ONLY || CVarGetInteger("gItemTrackerCapacityTrack", 1) == ITEM_TRACKER_NUMBER_CURRENT_AMMO_ONLY) { PaddedEnhancementCheckbox("Align count to left side", "gItemTrackerCurrentOnLeft", 0); } ImGui::Text("Key Count Tracking"); @@ -1012,19 +1012,19 @@ void DrawItemTrackerOptions(bool& open) { LabeledComboBoxRightAligned("Equipment", "gItemTrackerEquipmentItemsDisplayType", { "Hidden", "Main Window", "Seperate" }, 1); LabeledComboBoxRightAligned("Misc", "gItemTrackerMiscItemsDisplayType", { "Hidden", "Main Window", "Seperate" }, 1); LabeledComboBoxRightAligned("Dungeon Rewards", "gItemTrackerDungeonRewardsDisplayType", { "Hidden", "Main Window", "Seperate" }, 1); - if (CVar_GetS32("gItemTrackerDungeonRewardsDisplayType", 1) == 2) { + if (CVarGetInteger("gItemTrackerDungeonRewardsDisplayType", 1) == 2) { PaddedEnhancementCheckbox("Circle display", "gItemTrackerDungeonRewardsCircle", 1); } LabeledComboBoxRightAligned("Songs", "gItemTrackerSongsDisplayType", { "Hidden", "Main Window", "Seperate" }, 1); LabeledComboBoxRightAligned("Dungeon Items", "gItemTrackerDungeonItemsDisplayType", { "Hidden", "Main Window", "Seperate" }, 0); - if (CVar_GetS32("gItemTrackerDungeonItemsDisplayType", 0) != 0) { - if (CVar_GetS32("gItemTrackerDungeonItemsDisplayType", 0) == 2) { + if (CVarGetInteger("gItemTrackerDungeonItemsDisplayType", 0) != 0) { + if (CVarGetInteger("gItemTrackerDungeonItemsDisplayType", 0) == 2) { PaddedEnhancementCheckbox("Horizontal display", "gItemTrackerDisplayDungeonItemsHorizontal", 1); } PaddedEnhancementCheckbox("Maps and compasses", "gItemTrackerDisplayDungeonItemsMaps", 1); } - if (CVar_GetS32("gItemTrackerDisplayType", 0) != 1) { + if (CVarGetInteger("gItemTrackerDisplayType", 0) != 1) { LabeledComboBoxRightAligned("Personal notes", "gItemTrackerNotesDisplayType", { "Hidden", "Main Window", "Seperate" }, 0); } @@ -1035,12 +1035,12 @@ void DrawItemTrackerOptions(bool& open) { } void InitItemTracker() { - SohImGui::AddWindow("Randomizer", "Item Tracker", DrawItemTracker, CVar_GetS32("gItemTrackerEnabled", 0) == 1); + SohImGui::AddWindow("Randomizer", "Item Tracker", DrawItemTracker, CVarGetInteger("gItemTrackerEnabled", 0) == 1); SohImGui::AddWindow("Randomizer", "Item Tracker Settings", DrawItemTrackerOptions); - float trackerBgR = CVar_GetFloat("gItemTrackerBgColorR", 0); - float trackerBgG = CVar_GetFloat("gItemTrackerBgColorG", 0); - float trackerBgB = CVar_GetFloat("gItemTrackerBgColorB", 0); - float trackerBgA = CVar_GetFloat("gItemTrackerBgColorA", 1); + float trackerBgR = CVarGetFloat("gItemTrackerBgColorR", 0); + float trackerBgG = CVarGetFloat("gItemTrackerBgColorG", 0); + float trackerBgB = CVarGetFloat("gItemTrackerBgColorB", 0); + float trackerBgA = CVarGetFloat("gItemTrackerBgColorA", 1); ChromaKeyBackground = { trackerBgR, trackerBgG, @@ -1055,11 +1055,11 @@ void InitItemTracker() { buttonsPressed = cont_pad; }); Ship::RegisterHook([](uint32_t fileNum) { - const char* initialTrackerNotes = CVar_GetString(("gItemTrackerNotes" + std::to_string(fileNum)).c_str(), ""); + const char* initialTrackerNotes = CVarGetString(("gItemTrackerNotes" + std::to_string(fileNum)).c_str(), ""); strcpy(itemTrackerNotes.Data, initialTrackerNotes); }); Ship::RegisterHook([](uint32_t fileNum) { - CVar_SetString(("gItemTrackerNotes" + std::to_string(fileNum)).c_str(), ""); + CVarSetString(("gItemTrackerNotes" + std::to_string(fileNum)).c_str(), ""); SohImGui::RequestCvarSaveOnNextTick(); }); } diff --git a/soh/soh/Enhancements/sfx-editor/SfxEditor.cpp b/soh/soh/Enhancements/sfx-editor/SfxEditor.cpp index 357b911f2..f336189d0 100644 --- a/soh/soh/Enhancements/sfx-editor/SfxEditor.cpp +++ b/soh/soh/Enhancements/sfx-editor/SfxEditor.cpp @@ -2,7 +2,7 @@ #include "sequence.h" #include #include -#include +#include #include #include #include "../randomizer/3drando/random.hpp" @@ -216,7 +216,7 @@ void Draw_SfxTab(const std::string& tabId, const std::map(seqData).c_str())) { - CVar_SetS32(cvarKey.c_str(), value); + CVarSetInteger(cvarKey.c_str(), value); SohImGui::RequestCvarSaveOnNextTick(); UpdateCurrentBGM(defaultValue, type); } @@ -299,16 +299,16 @@ void Draw_SfxTab(const std::string& tabId, const std::map(id); } } @@ -386,7 +386,7 @@ extern "C" u16 SfxEditor_GetReverseReplacementSeq(u16 seqId) { void DrawSfxEditor(bool& open) { if (!open) { - CVar_SetS32("gSfxEditor", 0); + CVarSetInteger("gSfxEditor", 0); return; } ImGui::SetNextWindowSize(ImVec2(900, 630), ImGuiCond_FirstUseEver); diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index fe4986f02..9ec46e4cc 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -12,11 +12,11 @@ #define IMGUI_DEFINE_MATH_OPERATORS #include #include -#include +#include #include -#include -#include -#include +#include +#include +#include #ifdef __SWITCH__ #include @@ -82,22 +82,22 @@ namespace GameMenuBar { } void BindAudioSlider(const char* name, const char* key, float defaultValue, SeqPlayers playerId) { - float value = CVar_GetFloat(key, defaultValue); + float value = CVarGetFloat(key, defaultValue); ImGui::Text(name, static_cast(100 * value)); if (ImGui::SliderFloat((std::string("##") + key).c_str(), &value, 0.0f, 1.0f, "")) { const float volume = floorf(value * 100) / 100; - CVar_SetFloat(key, volume); + CVarSetFloat(key, volume); SohImGui::RequestCvarSaveOnNextTick(); Audio_SetGameVolume(playerId, volume); } } void UpdateAudio() { - Audio_SetGameVolume(SEQ_BGM_MAIN, CVar_GetFloat("gMainMusicVolume", 1)); - Audio_SetGameVolume(SEQ_BGM_SUB, CVar_GetFloat("gSubMusicVolume", 1)); - Audio_SetGameVolume(SEQ_FANFARE, CVar_GetFloat("gSFXMusicVolume", 1)); - Audio_SetGameVolume(SEQ_SFX, CVar_GetFloat("gFanfareVolume", 1)); + Audio_SetGameVolume(SEQ_BGM_MAIN, CVarGetFloat("gMainMusicVolume", 1)); + Audio_SetGameVolume(SEQ_BGM_SUB, CVarGetFloat("gSubMusicVolume", 1)); + Audio_SetGameVolume(SEQ_FANFARE, CVarGetFloat("gSFXMusicVolume", 1)); + Audio_SetGameVolume(SEQ_SFX, CVarGetFloat("gFanfareVolume", 1)); } // MARK: - Delegates @@ -153,12 +153,12 @@ namespace GameMenuBar { ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0, 0)); ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f); ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f)); - if (ImGui::Button(GetWindowButtonText("Controller Configuration", CVar_GetS32("gControllerConfigurationEnabled", 0)).c_str())) + if (ImGui::Button(GetWindowButtonText("Controller Configuration", CVarGetInteger("gControllerConfigurationEnabled", 0)).c_str())) { - bool currentValue = CVar_GetS32("gControllerConfigurationEnabled", 0); - CVar_SetS32("gControllerConfigurationEnabled", !currentValue); + bool currentValue = CVarGetInteger("gControllerConfigurationEnabled", 0); + CVarSetInteger("gControllerConfigurationEnabled", !currentValue); SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::ToggleInputEditorWindow(CVar_GetS32("gControllerConfigurationEnabled", 0)); + SohImGui::ToggleInputEditorWindow(CVarGetInteger("gControllerConfigurationEnabled", 0)); } ImGui::PopStyleColor(1); ImGui::PopStyleVar(3); @@ -188,18 +188,18 @@ namespace GameMenuBar { #ifndef __APPLE__ UIWidgets::EnhancementSliderFloat("Internal Resolution: %d %%", "##IMul", "gInternalResolution", 0.5f, 2.0f, "", 1.0f, true, true); UIWidgets::Tooltip("Multiplies your output resolution by the value inputted, as a more intensive but effective form of anti-aliasing"); - SohImGui::SetResolutionMultiplier(CVar_GetFloat("gInternalResolution", 1)); + SohImGui::SetResolutionMultiplier(CVarGetFloat("gInternalResolution", 1)); #endif #ifndef __WIIU__ UIWidgets::PaddedEnhancementSliderInt("MSAA: %d", "##IMSAA", "gMSAAValue", 1, 8, "", 1, false, true, false); UIWidgets::Tooltip("Activates multi-sample anti-aliasing when above 1x up to 8x for 8 samples for every pixel"); - SohImGui::SetMSAALevel(CVar_GetS32("gMSAAValue", 1)); + SohImGui::SetMSAALevel(CVarGetInteger("gMSAAValue", 1)); #endif if (SohImGui::WindowBackend() == SohImGui::Backend::DX11) { const char* cvar = "gExtraLatencyThreshold"; - int val = CVar_GetS32(cvar, 80); + int val = CVarGetInteger(cvar, 80); val = fmax(fmin(val, 360), 0); int fps = val; @@ -218,7 +218,7 @@ namespace GameMenuBar { std::string PlusBTNELT = " + ##ExtraLatencyThreshold"; if (ImGui::Button(MinusBTNELT.c_str())) { val--; - CVar_SetS32(cvar, val); + CVarSetInteger(cvar, val); SohImGui::RequestCvarSaveOnNextTick(); } ImGui::SameLine(); @@ -232,7 +232,7 @@ namespace GameMenuBar { #endif if (ImGui::SliderInt("##ExtraLatencyThreshold", &val, 0, 360, "", ImGuiSliderFlags_AlwaysClamp)) { - CVar_SetS32(cvar, val); + CVarSetInteger(cvar, val); SohImGui::RequestCvarSaveOnNextTick(); } ImGui::PopItemWidth(); @@ -242,7 +242,7 @@ namespace GameMenuBar { ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); if (ImGui::Button(PlusBTNELT.c_str())) { val++; - CVar_SetS32(cvar, val); + CVarSetInteger(cvar, val); SohImGui::RequestCvarSaveOnNextTick(); } @@ -338,11 +338,11 @@ namespace GameMenuBar { " - Skulltula Tokens: Small skulltula chest\n" ); if (UIWidgets::EnhancementCombobox("gChestSizeAndTextureMatchesContents", chestSizeAndTextureMatchesContentsOptions, 4, 0)) { - if (CVar_GetS32("gChestSizeAndTextureMatchesContents", 0) == 0) { - CVar_SetS32("gChestSizeDependsStoneOfAgony", 0); + if (CVarGetInteger("gChestSizeAndTextureMatchesContents", 0) == 0) { + CVarSetInteger("gChestSizeDependsStoneOfAgony", 0); } } - if (CVar_GetS32("gChestSizeAndTextureMatchesContents", 0) > 0) { + if (CVarGetInteger("gChestSizeAndTextureMatchesContents", 0) > 0) { UIWidgets::PaddedEnhancementCheckbox("Chests of Agony", "gChestSizeDependsStoneOfAgony", true, false); UIWidgets::Tooltip("Only change the size/texture of chests if you have the Stone of Agony."); } @@ -461,7 +461,7 @@ namespace GameMenuBar { { UIWidgets::EnhancementCheckbox("Change Red Potion Effect", "gRedPotionEffect"); UIWidgets::Tooltip("Enable the following changes to the amount of health restored by Red Potions"); - bool disabledRedPotion = !CVar_GetS32("gRedPotionEffect", 0); + bool disabledRedPotion = !CVarGetInteger("gRedPotionEffect", 0); const char* disabledTooltipRedPotion = "This option is disabled because \"Change Red Potion Effect\" is turned off"; UIWidgets::EnhancementSliderInt("Red Potion Health: %d", "##REDPOTIONHEALTH", "gRedPotionHealth", 1, 100, "", 0, true, disabledRedPotion, disabledTooltipRedPotion); UIWidgets::Tooltip("Changes the amount of health restored by Red Potions"); @@ -472,7 +472,7 @@ namespace GameMenuBar { UIWidgets::EnhancementCheckbox("Change Green Potion Effect", "gGreenPotionEffect"); UIWidgets::Tooltip("Enable the following changes to the amount of mana restored by Green Potions"); - bool disabledGreenPotion = !CVar_GetS32("gGreenPotionEffect", 0); + bool disabledGreenPotion = !CVarGetInteger("gGreenPotionEffect", 0); const char* disabledTooltipGreenPotion = "This option is disabled because \"Change Green Potion Effect\" is turned off"; UIWidgets::EnhancementSliderInt("Green Potion Mana: %d", "##GREENPOTIONMANA", "gGreenPotionMana", 1, 100, "", 0, true, disabledGreenPotion, disabledTooltipGreenPotion); UIWidgets::Tooltip("Changes the amount of mana restored by Green Potions, base max mana is 48, max upgraded mana is 96"); @@ -483,7 +483,7 @@ namespace GameMenuBar { UIWidgets::EnhancementCheckbox("Change Blue Potion Effects", "gBluePotionEffects"); UIWidgets::Tooltip("Enable the following changes to the amount of health and mana restored by Blue Potions"); - bool disabledBluePotion = !CVar_GetS32("gBluePotionEffects", 0); + bool disabledBluePotion = !CVarGetInteger("gBluePotionEffects", 0); const char* disabledTooltipBluePotion = "This option is disabled because \"Change Blue Potion Effects\" is turned off"; UIWidgets::EnhancementSliderInt("Blue Potion Health: %d", "##BLUEPOTIONHEALTH", "gBluePotionHealth", 1, 100, "", 0, true, disabledBluePotion, disabledTooltipBluePotion); UIWidgets::Tooltip("Changes the amount of health restored by Blue Potions"); @@ -501,7 +501,7 @@ namespace GameMenuBar { UIWidgets::EnhancementCheckbox("Change Milk Effect", "gMilkEffect"); UIWidgets::Tooltip("Enable the following changes to the amount of health restored by Milk"); - bool disabledMilk = !CVar_GetS32("gMilkEffect", 0); + bool disabledMilk = !CVarGetInteger("gMilkEffect", 0); const char* disabledTooltipMilk = "This option is disabled because \"Change Milk Effect\" is turned off"; UIWidgets::EnhancementSliderInt("Milk Health: %d", "##MILKHEALTH", "gMilkHealth", 1, 100, "", 0, true, disabledMilk, disabledTooltipMilk); UIWidgets::Tooltip("Changes the amount of health restored by Milk"); @@ -512,7 +512,7 @@ namespace GameMenuBar { UIWidgets::EnhancementCheckbox("Separate Half Milk Effect", "gSeparateHalfMilkEffect", disabledMilk, disabledTooltipMilk); UIWidgets::Tooltip("Enable the following changes to the amount of health restored by Half Milk\nIf this is disabled, Half Milk will behave the same as Full Milk."); - bool disabledHalfMilk = disabledMilk || !CVar_GetS32("gSeparateHalfMilkEffect", 0); + bool disabledHalfMilk = disabledMilk || !CVarGetInteger("gSeparateHalfMilkEffect", 0); const char* disabledTooltipHalfMilk = "This option is disabled because \"Separate Half Milk Effect\" is turned off"; UIWidgets::EnhancementSliderInt("Half Milk Health: %d", "##HALFMILKHEALTH", "gHalfMilkHealth", 1, 100, "", 0, true, disabledHalfMilk, disabledTooltipHalfMilk); UIWidgets::Tooltip("Changes the amount of health restored by Half Milk"); @@ -523,7 +523,7 @@ namespace GameMenuBar { UIWidgets::EnhancementCheckbox("Change Fairy Effect", "gFairyEffect"); UIWidgets::Tooltip("Enable the following changes to the amount of health restored by Fairies"); - bool disabledFairy = !CVar_GetS32("gFairyEffect", 0); + bool disabledFairy = !CVarGetInteger("gFairyEffect", 0); const char* disabledTooltipFairy = "This option is disabled because \"Change Fairy Effect\" is turned off"; UIWidgets::EnhancementSliderInt("Fairy: %d", "##FAIRYHEALTH", "gFairyHealth", 1, 100, "", 0, true, disabledFairy, disabledTooltipFairy); UIWidgets::Tooltip("Changes the amount of health restored by Fairies"); @@ -534,7 +534,7 @@ namespace GameMenuBar { UIWidgets::EnhancementCheckbox("Change Fairy Revive Effect", "gFairyReviveEffect"); UIWidgets::Tooltip("Enable the following changes to the amount of health restored by Fairy Revivals"); - bool disabledFairyRevive = !CVar_GetS32("gFairyReviveEffect", 0); + bool disabledFairyRevive = !CVarGetInteger("gFairyReviveEffect", 0); const char* disabledTooltipFairyRevive = "This option is disabled because \"Change Fairy Revive Effect\" is turned off"; UIWidgets::EnhancementSliderInt("Fairy Revival: %d", "##FAIRYREVIVEHEALTH", "gFairyReviveHealth", 1, 100, "", 0, true, disabledFairyRevive, disabledTooltipFairyRevive); UIWidgets::Tooltip("Changes the amount of health restored by Fairy Revivals"); @@ -549,7 +549,7 @@ namespace GameMenuBar { if (ImGui::BeginMenu("Shooting Gallery")) { UIWidgets::EnhancementCheckbox("Customize Behavior", "gCustomizeShootingGallery"); UIWidgets::Tooltip("Turn on/off changes to the shooting gallery behavior"); - bool disabled = !CVar_GetS32("gCustomizeShootingGallery", 0); + bool disabled = !CVarGetInteger("gCustomizeShootingGallery", 0); const char* disabledTooltip = "This option is disabled because \"Customize Behavior\" is turned off"; UIWidgets::PaddedEnhancementCheckbox("Instant Win", "gInstantShootingGalleryWin", true, false, disabled, disabledTooltip); UIWidgets::Tooltip("Skips the shooting gallery minigame"); @@ -567,7 +567,7 @@ namespace GameMenuBar { if (ImGui::BeginMenu("Bombchu Bowling")) { UIWidgets::EnhancementCheckbox("Customize Behavior", "gCustomizeBombchuBowling"); UIWidgets::Tooltip("Turn on/off changes to the bombchu bowling behavior"); - bool disabled = CVar_GetS32("gCustomizeBombchuBowling", 0) == 0; + bool disabled = CVarGetInteger("gCustomizeBombchuBowling", 0) == 0; const char* disabledTooltip = "This option is disabled because \"Customize Behavior\" is turned off"; UIWidgets::PaddedEnhancementCheckbox("Remove Small Cucco", "gBombchuBowlingNoSmallCucco", true, false, disabled, disabledTooltip); UIWidgets::Tooltip("Prevents the small cucco from appearing in the bombchu bowling minigame"); @@ -583,7 +583,7 @@ namespace GameMenuBar { if (ImGui::BeginMenu("Fishing")) { UIWidgets::EnhancementCheckbox("Customize Behavior", "gCustomizeFishing"); UIWidgets::Tooltip("Turn on/off changes to the fishing behavior"); - bool disabled = !CVar_GetS32("gCustomizeFishing", 0); + bool disabled = !CVarGetInteger("gCustomizeFishing", 0); const char* disabledTooltip = "This option is disabled because \"Customize Behavior\" is turned off"; UIWidgets::PaddedEnhancementCheckbox("Instant Fishing", "gInstantFishing", true, false, disabled, disabledTooltip); UIWidgets::Tooltip("All fish will be caught instantly"); @@ -669,7 +669,7 @@ namespace GameMenuBar { UIWidgets::Tooltip("Allow you to rotate Link on the Equipment menu with the C-buttons\nUse C-Up or C-Down to reset Link's rotation"); UIWidgets::EnhancementRadioButton("Rotate Link with Right Stick", "gPauseLiveLinkRotation", 3); UIWidgets::Tooltip("Allow you to rotate Link on the Equipment menu with the Right Stick\nYou can zoom in by pointing up and reset Link's rotation by pointing down"); - if (CVar_GetS32("gPauseLiveLinkRotation", 0) != 0) { + if (CVarGetInteger("gPauseLiveLinkRotation", 0) != 0) { UIWidgets::EnhancementSliderInt("Rotation Speed: %d", "##MinRotationSpeed", "gPauseLiveLinkRotationSpeed", 1, 20, ""); } UIWidgets::PaddedSeparator(); @@ -697,7 +697,7 @@ namespace GameMenuBar { UIWidgets::Tooltip("Randomize the animation played on the menu after a certain time"); UIWidgets::EnhancementRadioButton("Random cycle (Idle)", "gPauseLiveLink", 17); UIWidgets::Tooltip("Randomize the animation played on the menu after a certain time (Idle animations only)"); - if (CVar_GetS32("gPauseLiveLink", 0) >= 16) { + if (CVarGetInteger("gPauseLiveLink", 0) >= 16) { UIWidgets::EnhancementSliderInt("Frame to wait: %d", "##MinFrameCount", "gMinFrameCount", 1, 1000, "", 0, true); } @@ -741,8 +741,8 @@ namespace GameMenuBar { UIWidgets::Tooltip("Make Anubis fireballs do fire damage when reflected back at them with the Mirror Shield"); UIWidgets::PaddedEnhancementCheckbox("Fix Megaton Hammer crouch stab", "gCrouchStabHammerFix", true, false); UIWidgets::Tooltip("Make the Megaton Hammer's crouch stab able to destroy rocks without first swinging it normally"); - if (CVar_GetS32("gCrouchStabHammerFix", 0) == 0) { - CVar_SetS32("gCrouchStabFix", 0); + if (CVarGetInteger("gCrouchStabHammerFix", 0) == 0) { + CVarSetInteger("gCrouchStabFix", 0); } else { UIWidgets::PaddedEnhancementCheckbox("Remove power crouch stab", "gCrouchStabFix", true, false); UIWidgets::Tooltip("Make crouch stabbing always do the same damage as a regular slash"); @@ -792,32 +792,32 @@ namespace GameMenuBar { ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f); ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f)); - if (ImGui::Button(GetWindowButtonText("Customize Game Controls", CVar_GetS32("gGameControlEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) + if (ImGui::Button(GetWindowButtonText("Customize Game Controls", CVarGetInteger("gGameControlEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { - bool currentValue = CVar_GetS32("gGameControlEditorEnabled", 0); - CVar_SetS32("gGameControlEditorEnabled", !currentValue); + bool currentValue = CVarGetInteger("gGameControlEditorEnabled", 0); + CVarSetInteger("gGameControlEditorEnabled", !currentValue); SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Game Control Editor", CVar_GetS32("gGameControlEditorEnabled", 0)); + SohImGui::EnableWindow("Game Control Editor", CVarGetInteger("gGameControlEditorEnabled", 0)); } - if (ImGui::Button(GetWindowButtonText("Cosmetics Editor", CVar_GetS32("gCosmeticsEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) + if (ImGui::Button(GetWindowButtonText("Cosmetics Editor", CVarGetInteger("gCosmeticsEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { - bool currentValue = CVar_GetS32("gCosmeticsEditorEnabled", 0); - CVar_SetS32("gCosmeticsEditorEnabled", !currentValue); + bool currentValue = CVarGetInteger("gCosmeticsEditorEnabled", 0); + CVarSetInteger("gCosmeticsEditorEnabled", !currentValue); SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Cosmetics Editor", CVar_GetS32("gCosmeticsEditorEnabled", 0)); + SohImGui::EnableWindow("Cosmetics Editor", CVarGetInteger("gCosmeticsEditorEnabled", 0)); } - if (ImGui::Button(GetWindowButtonText("SFX Editor", CVar_GetS32("gSfxEditor", 0)).c_str(), ImVec2(-1.0f, 0.0f))) + if (ImGui::Button(GetWindowButtonText("SFX Editor", CVarGetInteger("gSfxEditor", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { - bool currentValue = CVar_GetS32("gSfxEditor", 0); - CVar_SetS32("gSfxEditor", !currentValue); + bool currentValue = CVarGetInteger("gSfxEditor", 0); + CVarSetInteger("gSfxEditor", !currentValue); SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("SFX Editor", CVar_GetS32("gSfxEditor", 0)); + SohImGui::EnableWindow("SFX Editor", CVarGetInteger("gSfxEditor", 0)); } - if (ImGui::Button(GetWindowButtonText("Gameplay Stats", CVar_GetS32("gGameplayStatsEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { - bool currentValue = CVar_GetS32("gGameplayStatsEnabled", 0); - CVar_SetS32("gGameplayStatsEnabled", !currentValue); + if (ImGui::Button(GetWindowButtonText("Gameplay Stats", CVarGetInteger("gGameplayStatsEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { + bool currentValue = CVarGetInteger("gGameplayStatsEnabled", 0); + CVarSetInteger("gGameplayStatsEnabled", !currentValue); SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Gameplay Stats", CVar_GetS32("gGameplayStatsEnabled", 0)); + SohImGui::EnableWindow("Gameplay Stats", CVarGetInteger("gGameplayStatsEnabled", 0)); } ImGui::PopStyleVar(3); ImGui::PopStyleColor(1); @@ -834,7 +834,7 @@ namespace GameMenuBar { int maxFps = 360; #endif - int val = CVar_GetS32(fps_cvar, minFps); + int val = CVarGetInteger(fps_cvar, minFps); val = fmax(fmin(val, maxFps), 20); #ifdef __WIIU__ @@ -862,7 +862,7 @@ namespace GameMenuBar { #else val--; #endif - CVar_SetS32(fps_cvar, val); + CVarSetInteger(fps_cvar, val); SohImGui::RequestCvarSaveOnNextTick(); } ImGui::SameLine(); @@ -889,7 +889,7 @@ namespace GameMenuBar { val = 20; } - CVar_SetS32(fps_cvar, val); + CVarSetInteger(fps_cvar, val); SohImGui::RequestCvarSaveOnNextTick(); } ImGui::PopItemWidth(); @@ -909,7 +909,7 @@ namespace GameMenuBar { #else val++; #endif - CVar_SetS32(fps_cvar, val); + CVarSetInteger(fps_cvar, val); SohImGui::RequestCvarSaveOnNextTick(); } } @@ -923,7 +923,7 @@ namespace GameMenuBar { int hz = roundf(SohImGui::WindowRefreshRate()); if (hz >= 20 && hz <= 360) { - CVar_SetS32(fps_cvar, hz); + CVarSetInteger(fps_cvar, hz); SohImGui::RequestCvarSaveOnNextTick(); } } @@ -933,12 +933,12 @@ namespace GameMenuBar { UIWidgets::EnhancementCheckbox("Disable LOD", "gDisableLOD"); UIWidgets::Tooltip("Turns off the Level of Detail setting, making models use their higher-poly variants at any distance"); if (UIWidgets::PaddedEnhancementCheckbox("Disable Draw Distance", "gDisableDrawDistance", true, false)) { - if (CVar_GetS32("gDisableDrawDistance", 0) == 0) { - CVar_SetS32("gDisableKokiriDrawDistance", 0); + if (CVarGetInteger("gDisableDrawDistance", 0) == 0) { + CVarSetInteger("gDisableKokiriDrawDistance", 0); } } UIWidgets::Tooltip("Turns off the objects draw distance, making objects being visible from a longer range"); - if (CVar_GetS32("gDisableDrawDistance", 0) == 1) { + if (CVarGetInteger("gDisableDrawDistance", 0) == 1) { UIWidgets::PaddedEnhancementCheckbox("Kokiri Draw Distance", "gDisableKokiriDrawDistance", true, false); UIWidgets::Tooltip("The Kokiri are mystical beings that fade into view when approached\nEnabling this will remove their draw distance"); } @@ -947,13 +947,13 @@ namespace GameMenuBar { #ifdef __SWITCH__ UIWidgets::Spacer(0); - int slot = CVar_GetS32("gSwitchPerfMode", (int)Ship::SwitchProfiles::STOCK); + int slot = CVarGetInteger("gSwitchPerfMode", (int)Ship::SwitchProfiles::STOCK); ImGui::Text("Switch performance mode"); if (ImGui::BeginCombo("##perf", SWITCH_CPU_PROFILES[slot])) { for (int sId = 0; sId <= Ship::SwitchProfiles::POWERSAVINGM3; sId++) { if (ImGui::Selectable(SWITCH_CPU_PROFILES[sId], sId == slot)) { SPDLOG_INFO("Profile:: %s", SWITCH_CPU_PROFILES[sId]); - CVar_SetS32("gSwitchPerfMode", sId); + CVarSetInteger("gSwitchPerfMode", sId); Ship::Switch::ApplyOverclock(); SohImGui::RequestCvarSaveOnNextTick(); } @@ -1011,9 +1011,9 @@ namespace GameMenuBar { UIWidgets::Tooltip("This syncs the ingame time with the real world time"); { - static int32_t betaQuestEnabled = CVar_GetS32("gEnableBetaQuest", 0); + static int32_t betaQuestEnabled = CVarGetInteger("gEnableBetaQuest", 0); static int32_t lastBetaQuestEnabled = betaQuestEnabled; - static int32_t betaQuestWorld = CVar_GetS32("gBetaQuestWorld", 0xFFEF); + static int32_t betaQuestWorld = CVarGetInteger("gBetaQuestWorld", 0xFFEF); static int32_t lastBetaQuestWorld = betaQuestWorld; if (!isBetaQuestEnabled) { @@ -1023,7 +1023,7 @@ namespace GameMenuBar { UIWidgets::PaddedEnhancementCheckbox("Enable Beta Quest", "gEnableBetaQuest", true, false); UIWidgets::Tooltip("Turns on OoT Beta Quest. *WARNING* This will reset your game."); - betaQuestEnabled = CVar_GetS32("gEnableBetaQuest", 0); + betaQuestEnabled = CVarGetInteger("gEnableBetaQuest", 0); if (betaQuestEnabled) { if (betaQuestEnabled != lastBetaQuestEnabled) { betaQuestWorld = 0; @@ -1055,15 +1055,15 @@ namespace GameMenuBar { } else { lastBetaQuestWorld = betaQuestWorld = 0xFFEF; - CVar_SetS32("gBetaQuestWorld", betaQuestWorld); + CVarSetInteger("gBetaQuestWorld", betaQuestWorld); } if (betaQuestEnabled != lastBetaQuestEnabled || betaQuestWorld != lastBetaQuestWorld) { // Reset the game if the beta quest state or world changed because beta quest happens on redirecting the title screen cutscene. lastBetaQuestEnabled = betaQuestEnabled; lastBetaQuestWorld = betaQuestWorld; - CVar_SetS32("gEnableBetaQuest", betaQuestEnabled); - CVar_SetS32("gBetaQuestWorld", betaQuestWorld); + CVarSetInteger("gEnableBetaQuest", betaQuestEnabled); + CVarSetInteger("gBetaQuestWorld", betaQuestWorld); SohImGui::DispatchConsoleCommand("reset"); @@ -1077,7 +1077,7 @@ namespace GameMenuBar { } if (ImGui::Button("Change Age")) { - CVar_SetS32("gSwitchAge", 1); + CVarSetInteger("gSwitchAge", 1); } UIWidgets::Tooltip("Switches links age and reloads the area."); @@ -1094,7 +1094,7 @@ namespace GameMenuBar { UIWidgets::Tooltip("Enables Skulltula Debug, when moving the cursor in the menu above various map icons (boss key, compass, map screen locations, etc) will set the GS bits in that area.\nUSE WITH CAUTION AS IT DOES NOT UPDATE THE GS COUNT."); UIWidgets::PaddedEnhancementCheckbox("Fast File Select", "gSkipLogoTitle", true, false); UIWidgets::Tooltip("Load the game to the selected menu or file\n\"Zelda Map Select\" require debug mode else you will fallback to File choose menu\nUsing a file number that don't have save will create a save file only if you toggle on \"Create a new save if none ?\" else it will bring you to the File choose menu"); - if (CVar_GetS32("gSkipLogoTitle", 0)) { + if (CVarGetInteger("gSkipLogoTitle", 0)) { const char* FastFileSelect[5] = { "File N.1", "File N.2", @@ -1114,46 +1114,46 @@ namespace GameMenuBar { ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0,0)); ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f); ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f)); - if (ImGui::Button(GetWindowButtonText("Stats", CVar_GetS32("gStatsEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) + if (ImGui::Button(GetWindowButtonText("Stats", CVarGetInteger("gStatsEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { - bool currentValue = CVar_GetS32("gStatsEnabled", 0); - CVar_SetS32("gStatsEnabled", !currentValue); + bool currentValue = CVarGetInteger("gStatsEnabled", 0); + CVarSetInteger("gStatsEnabled", !currentValue); SohImGui::ToggleStatisticsWindow(true); SohImGui::RequestCvarSaveOnNextTick(); } UIWidgets::Tooltip("Shows the stats window, with your FPS and frametimes, and the OS you're playing on"); UIWidgets::Spacer(0); - if (ImGui::Button(GetWindowButtonText("Console", CVar_GetS32("gConsoleEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) + if (ImGui::Button(GetWindowButtonText("Console", CVarGetInteger("gConsoleEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { - bool currentValue = CVar_GetS32("gConsoleEnabled", 0); - CVar_SetS32("gConsoleEnabled", !currentValue); + bool currentValue = CVarGetInteger("gConsoleEnabled", 0); + CVarSetInteger("gConsoleEnabled", !currentValue); SohImGui::RequestCvarSaveOnNextTick(); SohImGui::ToggleConsoleWindow(!currentValue); } UIWidgets::Tooltip("Enables the console window, allowing you to input commands, type help for some examples"); UIWidgets::Spacer(0); - if (ImGui::Button(GetWindowButtonText("Save Editor", CVar_GetS32("gSaveEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) + if (ImGui::Button(GetWindowButtonText("Save Editor", CVarGetInteger("gSaveEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { - bool currentValue = CVar_GetS32("gSaveEditorEnabled", 0); - CVar_SetS32("gSaveEditorEnabled", !currentValue); + bool currentValue = CVarGetInteger("gSaveEditorEnabled", 0); + CVarSetInteger("gSaveEditorEnabled", !currentValue); SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Save Editor", CVar_GetS32("gSaveEditorEnabled", 0)); + SohImGui::EnableWindow("Save Editor", CVarGetInteger("gSaveEditorEnabled", 0)); } UIWidgets::Spacer(0); - if (ImGui::Button(GetWindowButtonText("Collision Viewer", CVar_GetS32("gCollisionViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) + if (ImGui::Button(GetWindowButtonText("Collision Viewer", CVarGetInteger("gCollisionViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { - bool currentValue = CVar_GetS32("gCollisionViewerEnabled", 0); - CVar_SetS32("gCollisionViewerEnabled", !currentValue); + bool currentValue = CVarGetInteger("gCollisionViewerEnabled", 0); + CVarSetInteger("gCollisionViewerEnabled", !currentValue); SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Collision Viewer", CVar_GetS32("gCollisionViewerEnabled", 0)); + SohImGui::EnableWindow("Collision Viewer", CVarGetInteger("gCollisionViewerEnabled", 0)); } UIWidgets::Spacer(0); - if (ImGui::Button(GetWindowButtonText("Actor Viewer", CVar_GetS32("gActorViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) + if (ImGui::Button(GetWindowButtonText("Actor Viewer", CVarGetInteger("gActorViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { - bool currentValue = CVar_GetS32("gActorViewerEnabled", 0); - CVar_SetS32("gActorViewerEnabled", !currentValue); + bool currentValue = CVarGetInteger("gActorViewerEnabled", 0); + CVarSetInteger("gActorViewerEnabled", !currentValue); SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Actor Viewer", CVar_GetS32("gActorViewerEnabled", 0)); + SohImGui::EnableWindow("Actor Viewer", CVarGetInteger("gActorViewerEnabled", 0)); } ImGui::PopStyleVar(3); ImGui::PopStyleColor(1); @@ -1174,52 +1174,52 @@ namespace GameMenuBar { #else static ImVec2 buttonSize(200.0f, 0.0f); #endif - if (ImGui::Button(GetWindowButtonText("Randomizer Settings", CVar_GetS32("gRandomizerSettingsEnabled", 0)).c_str(), buttonSize)) + if (ImGui::Button(GetWindowButtonText("Randomizer Settings", CVarGetInteger("gRandomizerSettingsEnabled", 0)).c_str(), buttonSize)) { - bool currentValue = CVar_GetS32("gRandomizerSettingsEnabled", 0); - CVar_SetS32("gRandomizerSettingsEnabled", !currentValue); + bool currentValue = CVarGetInteger("gRandomizerSettingsEnabled", 0); + CVarSetInteger("gRandomizerSettingsEnabled", !currentValue); SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Randomizer Settings", CVar_GetS32("gRandomizerSettingsEnabled", 0)); + SohImGui::EnableWindow("Randomizer Settings", CVarGetInteger("gRandomizerSettingsEnabled", 0)); } ImGui::Dummy(ImVec2(0.0f, 0.0f)); - if (ImGui::Button(GetWindowButtonText("Item Tracker", CVar_GetS32("gItemTrackerEnabled", 0)).c_str(), buttonSize)) + if (ImGui::Button(GetWindowButtonText("Item Tracker", CVarGetInteger("gItemTrackerEnabled", 0)).c_str(), buttonSize)) { - bool currentValue = CVar_GetS32("gItemTrackerEnabled", 0); - CVar_SetS32("gItemTrackerEnabled", !currentValue); + bool currentValue = CVarGetInteger("gItemTrackerEnabled", 0); + CVarSetInteger("gItemTrackerEnabled", !currentValue); SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Item Tracker", CVar_GetS32("gItemTrackerEnabled", 0)); + SohImGui::EnableWindow("Item Tracker", CVarGetInteger("gItemTrackerEnabled", 0)); } ImGui::Dummy(ImVec2(0.0f, 0.0f)); - if (ImGui::Button(GetWindowButtonText("Item Tracker Settings", CVar_GetS32("gItemTrackerSettingsEnabled", 0)).c_str(), buttonSize)) + if (ImGui::Button(GetWindowButtonText("Item Tracker Settings", CVarGetInteger("gItemTrackerSettingsEnabled", 0)).c_str(), buttonSize)) { - bool currentValue = CVar_GetS32("gItemTrackerSettingsEnabled", 0); - CVar_SetS32("gItemTrackerSettingsEnabled", !currentValue); + bool currentValue = CVarGetInteger("gItemTrackerSettingsEnabled", 0); + CVarSetInteger("gItemTrackerSettingsEnabled", !currentValue); SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Item Tracker Settings", CVar_GetS32("gItemTrackerSettingsEnabled", 0)); + SohImGui::EnableWindow("Item Tracker Settings", CVarGetInteger("gItemTrackerSettingsEnabled", 0)); } ImGui::Dummy(ImVec2(0.0f, 0.0f)); - if (ImGui::Button(GetWindowButtonText("Entrance Tracker", CVar_GetS32("gEntranceTrackerEnabled", 0)).c_str(), buttonSize)) + if (ImGui::Button(GetWindowButtonText("Entrance Tracker", CVarGetInteger("gEntranceTrackerEnabled", 0)).c_str(), buttonSize)) { - bool currentValue = CVar_GetS32("gEntranceTrackerEnabled", 0); - CVar_SetS32("gEntranceTrackerEnabled", !currentValue); + bool currentValue = CVarGetInteger("gEntranceTrackerEnabled", 0); + CVarSetInteger("gEntranceTrackerEnabled", !currentValue); SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Entrance Tracker", CVar_GetS32("gEntranceTrackerEnabled", 0)); + SohImGui::EnableWindow("Entrance Tracker", CVarGetInteger("gEntranceTrackerEnabled", 0)); } ImGui::Dummy(ImVec2(0.0f, 0.0f)); - if (ImGui::Button(GetWindowButtonText("Check Tracker", CVar_GetS32("gCheckTrackerEnabled", 0)).c_str(), buttonSize)) + if (ImGui::Button(GetWindowButtonText("Check Tracker", CVarGetInteger("gCheckTrackerEnabled", 0)).c_str(), buttonSize)) { - bool currentValue = CVar_GetS32("gCheckTrackerEnabled", 0); - CVar_SetS32("gCheckTrackerEnabled", !currentValue); + bool currentValue = CVarGetInteger("gCheckTrackerEnabled", 0); + CVarSetInteger("gCheckTrackerEnabled", !currentValue); SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Check Tracker", CVar_GetS32("gCheckTrackerEnabled", 0)); + SohImGui::EnableWindow("Check Tracker", CVarGetInteger("gCheckTrackerEnabled", 0)); } ImGui::Dummy(ImVec2(0.0f, 0.0f)); - if (ImGui::Button(GetWindowButtonText("Check Tracker Settings", CVar_GetS32("gCheckTrackerSettingsEnabled", 0)).c_str(), buttonSize)) + if (ImGui::Button(GetWindowButtonText("Check Tracker Settings", CVarGetInteger("gCheckTrackerSettingsEnabled", 0)).c_str(), buttonSize)) { - bool currentValue = CVar_GetS32("gCheckTrackerSettingsEnabled", 0); - CVar_SetS32("gCheckTrackerSettingsEnabled", !currentValue); + bool currentValue = CVarGetInteger("gCheckTrackerSettingsEnabled", 0); + CVarSetInteger("gCheckTrackerSettingsEnabled", !currentValue); SohImGui::RequestCvarSaveOnNextTick(); - SohImGui::EnableWindow("Check Tracker Settings", CVar_GetS32("gCheckTrackerSettingsEnabled", 0)); + SohImGui::EnableWindow("Check Tracker Settings", CVarGetInteger("gCheckTrackerSettingsEnabled", 0)); } ImGui::PopStyleVar(3); ImGui::PopStyleColor(1); @@ -1278,7 +1278,7 @@ namespace GameMenuBar { UIWidgets::EnhancementCheckbox("Crowd Control", "gCrowdControl"); UIWidgets::Tooltip("Will attempt to connect to the Crowd Control server. Check out crowdcontrol.live for more information."); - if (CVar_GetS32("gCrowdControl", 0)) { + if (CVarGetInteger("gCrowdControl", 0)) { CrowdControl::Instance->Enable(); } else { CrowdControl::Instance->Disable(); @@ -1293,7 +1293,7 @@ namespace GameMenuBar { "Enemies that need more than Deku Nuts + either Deku Sticks or a sword to kill are excluded from spawning in \"clear enemy\" rooms." ); - if (CVar_GetS32("gRandomizedEnemies", 0)) { + if (CVarGetInteger("gRandomizedEnemies", 0)) { bool disableSeededEnemies = !gSaveContext.n64ddFlag && gSaveContext.fileNum >= 0 && gSaveContext.fileNum <= 2; const char* disableSeededEnemiesText = "This setting is disabled because it relies on a randomizer savefile."; diff --git a/soh/soh/GbiWrap.cpp b/soh/soh/GbiWrap.cpp index a63fa8fe7..eb9e6be36 100644 --- a/soh/soh/GbiWrap.cpp +++ b/soh/soh/GbiWrap.cpp @@ -16,10 +16,10 @@ int32_t OTRGetLastScancode(); void ResourceMgr_CacheDirectory(const char* resName); void ResourceMgr_LoadFile(const char* resName); char* ResourceMgr_LoadFileFromDisk(const char* filePath); -char* ResourceMgr_LoadTexByName(char* texPath); +char* GetResourceDataByName(char* texPath); uint16_t ResourceMgr_LoadTexWidthByName(char* texPath); uint16_t ResourceMgr_LoadTexHeightByName(char* texPath); -uint32_t ResourceMgr_LoadTexSizeByName(char* texPath); +size_t GetResourceTexSizeByName(const char* name); char* ResourceMgr_LoadTexOrDListByName(char* filePath); char* ResourceMgr_LoadPlayerAnimByName(char* animPath); char* ResourceMgr_GetNameByCRC(uint64_t crc, char* alloc); @@ -91,4 +91,4 @@ extern "C" void gSPInvalidateTexCache(Gfx* pkt, uintptr_t texAddr) } __gSPInvalidateTexCache(pkt, texAddr); - } \ No newline at end of file + } diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index d63aee918..b8bb3f668 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -7,24 +7,19 @@ #include #include -#include -#include #include #include #include "z64animation.h" #include "z64bgcheck.h" #include "Enhancements/gameconsole.h" -#include -#include +#include #ifdef _WIN32 #include #else #include #endif -#include #include -#include #include #define DRMP3_IMPLEMENTATION #include @@ -66,8 +61,6 @@ #endif - -#include #include "Enhancements/custom-message/CustomMessageTypes.h" #include #include "Enhancements/item-tables/ItemTableManager.h" @@ -78,6 +71,35 @@ CrowdControl* CrowdControl::Instance; #endif +#include "libultraship/libultraship.h" + +// Resource Types/Factories +#include "soh/resource/type/Animation.h" +#include "soh/resource/type/AudioSample.h" +#include "soh/resource/type/AudioSequence.h" +#include "soh/resource/type/AudioSoundFont.h" +#include "soh/resource/type/CollisionHeader.h" +#include "soh/resource/type/Cutscene.h" +#include "soh/resource/type/Path.h" +#include "soh/resource/type/PlayerAnimation.h" +#include "soh/resource/type/Scene.h" +#include "soh/resource/type/Skeleton.h" +#include "soh/resource/type/SkeletonLimb.h" +#include "soh/resource/type/Text.h" +#include "soh/resource/importer/AnimationFactory.h" +#include "soh/resource/importer/AudioSampleFactory.h" +#include "soh/resource/importer/AudioSequenceFactory.h" +#include "soh/resource/importer/AudioSoundFontFactory.h" +#include "soh/resource/importer/CollisionHeaderFactory.h" +#include "soh/resource/importer/CutsceneFactory.h" +#include "soh/resource/importer/PathFactory.h" +#include "soh/resource/importer/PlayerAnimationFactory.h" +#include "soh/resource/importer/SceneFactory.h" +#include "soh/resource/importer/SkeletonFactory.h" +#include "soh/resource/importer/SkeletonLimbFactory.h" +#include "soh/resource/importer/TextFactory.h" +#include "soh/resource/importer/BackgroundFactory.h" + OTRGlobals* OTRGlobals::Instance; SaveManager* SaveManager::Instance; CustomMessageManager* CustomMessageManager::Instance; @@ -121,6 +143,21 @@ OTRGlobals::OTRGlobals() { OOT_PAL_GC_DBG2 }; context = Ship::Window::CreateInstance("Ship of Harkinian", OTRFiles); + + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Animation, std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_PlayerAnimation, std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Room, std::make_shared()); // Is room scene? maybe? + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_CollisionHeader, std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Skeleton, std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_SkeletonLimb, std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Path, std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Cutscene, std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Text, std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_AudioSample, std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_AudioSoundFont, std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_AudioSequence, std::make_shared()); + context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory(Ship::ResourceType::SOH_Background, std::make_shared()); + gSaveStateMgr = std::make_shared(); gRandomizer = std::make_shared(); @@ -454,9 +491,9 @@ extern "C" void InitOTR() { time_t now = time(NULL); tm *tm_now = localtime(&now); if (tm_now->tm_mon == 11 && tm_now->tm_mday >= 24 && tm_now->tm_mday <= 25) { - CVar_RegisterS32("gLetItSnow", 1); + CVarRegisterInteger("gLetItSnow", 1); } else { - CVar_Clear("gLetItSnow"); + CVarClear("gLetItSnow"); } #ifdef ENABLE_CROWD_CONTROL CrowdControl::Instance = new CrowdControl(); @@ -586,7 +623,7 @@ extern "C" void Graph_ProcessGfxCommands(Gfx* commands) { audio.cv_to_thread.notify_one(); std::vector> mtx_replacements; - int target_fps = CVar_GetS32("gInterpolationFPS", 20); + int target_fps = CVarGetInteger("gInterpolationFPS", 20); static int last_fps; static int last_update_rate; static int time; @@ -617,7 +654,7 @@ extern "C" void Graph_ProcessGfxCommands(Gfx* commands) { OTRGlobals::Instance->context->SetTargetFps(fps); - int threshold = CVar_GetS32("gExtraLatencyThreshold", 80); + int threshold = CVarGetInteger("gExtraLatencyThreshold", 80); OTRGlobals::Instance->context->SetMaximumFrameLatency(threshold > 0 && target_fps >= threshold ? 2 : 1); RunCommands(commands, mtx_replacements); @@ -795,21 +832,17 @@ extern "C" char* ResourceMgr_LoadJPEG(char* data, int dataSize) return (char*)finalBuffer; } -extern "C" char* ResourceMgr_LoadTexByName(const char* texPath); - extern "C" uint16_t ResourceMgr_LoadTexWidthByName(char* texPath); extern "C" uint16_t ResourceMgr_LoadTexHeightByName(char* texPath); -extern "C" uint32_t ResourceMgr_LoadTexSizeByName(const char* texPath); - extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) { auto res = ResourceMgr_LoadResource(filePath); - if (res->ResType == Ship::ResourceType::DisplayList) - return (char*)&((std::static_pointer_cast(res))->instructions[0]); - else if (res->ResType == Ship::ResourceType::Array) - return (char*)(std::static_pointer_cast(res))->vertices.data(); + if (res->Type == Ship::ResourceType::DisplayList) + return (char*)&((std::static_pointer_cast(res))->Instructions[0]); + else if (res->Type == Ship::ResourceType::Array) + return (char*)(std::static_pointer_cast(res))->Vertices.data(); else { std::string Path = filePath; if (ResourceMgr_IsGameMasterQuest()) { @@ -818,7 +851,7 @@ extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) { Path.replace(pos, 7, "/mq/"); } } - return ResourceMgr_LoadTexByName(Path.c_str()); + return (char*)GetResourceDataByName(Path.c_str(), false); } } @@ -835,7 +868,7 @@ extern "C" char* ResourceMgr_LoadPlayerAnimByName(const char* animPath) { extern "C" Gfx* ResourceMgr_LoadGfxByName(const char* path) { auto res = std::static_pointer_cast(ResourceMgr_LoadResource(path)); - return (Gfx*)&res->instructions[0]; + return (Gfx*)&res->Instructions[0]; } typedef struct { @@ -865,11 +898,11 @@ extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchNa }*/ // Index refers to individual gfx words, which are half the size on 32-bit - if (sizeof(uintptr_t) < 8) { - index /= 2; - } + // if (sizeof(uintptr_t) < 8) { + // index /= 2; + // } - Gfx* gfx = (Gfx*)&res->instructions[index]; + Gfx* gfx = (Gfx*)&res->Instructions[index]; if (!originalGfx.contains(path) || !originalGfx[path].contains(patchName)) { originalGfx[path][patchName] = { @@ -886,7 +919,7 @@ extern "C" void ResourceMgr_UnpatchGfxByName(const char* path, const char* patch auto res = std::static_pointer_cast( OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path)); - Gfx* gfx = (Gfx*)&res->instructions[originalGfx[path][patchName].index]; + Gfx* gfx = (Gfx*)&res->Instructions[originalGfx[path][patchName].index]; *gfx = originalGfx[path][patchName].instruction; originalGfx[path].erase(patchName); @@ -897,154 +930,48 @@ extern "C" char* ResourceMgr_LoadArrayByName(const char* path) { auto res = std::static_pointer_cast(ResourceMgr_LoadResource(path)); - return (char*)res->scalars.data(); + return (char*)res->Scalars.data(); } extern "C" char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path) { auto res = std::static_pointer_cast(ResourceMgr_LoadResource(path)); - if (res->CachedGameAsset != nullptr) - return (char*)res->CachedGameAsset; - else - { - Vec3s* data = (Vec3s*)malloc(sizeof(Vec3s) * res->scalars.size()); + // 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; + 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; + // res->CachedGameAsset = data; return (char*)data; - } + // } } -extern "C" CollisionHeader* ResourceMgr_LoadColByName(const char* path) -{ - auto colRes = std::static_pointer_cast(ResourceMgr_LoadResource(path)); - - if (colRes->CachedGameAsset != nullptr) - return (CollisionHeader*)colRes->CachedGameAsset; - - CollisionHeader* colHeader = (CollisionHeader*)malloc(sizeof(CollisionHeader)); - - colHeader->minBounds.x = colRes->absMinX; - colHeader->minBounds.y = colRes->absMinY; - colHeader->minBounds.z = colRes->absMinZ; - - colHeader->maxBounds.x = colRes->absMaxX; - colHeader->maxBounds.y = colRes->absMaxY; - colHeader->maxBounds.z = colRes->absMaxZ; - - colHeader->vtxList = (Vec3s*)malloc(sizeof(Vec3s) * colRes->vertices.size()); - colHeader->numVertices = colRes->vertices.size(); - - for (size_t i = 0; i < colRes->vertices.size(); i++) - { - colHeader->vtxList[i].x = colRes->vertices[i].x; - colHeader->vtxList[i].y = colRes->vertices[i].y; - colHeader->vtxList[i].z = colRes->vertices[i].z; - } - - colHeader->polyList = (CollisionPoly*)malloc(sizeof(CollisionPoly) * colRes->polygons.size()); - colHeader->numPolygons = colRes->polygons.size(); - - for (size_t i = 0; i < colRes->polygons.size(); i++) - { - colHeader->polyList[i].type = colRes->polygons[i].type; - colHeader->polyList[i].flags_vIA = colRes->polygons[i].vtxA; - colHeader->polyList[i].flags_vIB = colRes->polygons[i].vtxB; - colHeader->polyList[i].vIC = colRes->polygons[i].vtxC; - colHeader->polyList[i].normal.x = colRes->polygons[i].a; - colHeader->polyList[i].normal.y = colRes->polygons[i].b; - colHeader->polyList[i].normal.z = colRes->polygons[i].c; - colHeader->polyList[i].dist = colRes->polygons[i].d; - } - - colHeader->surfaceTypeList = (SurfaceType*)malloc(colRes->polygonTypes.size() * sizeof(SurfaceType)); - - for (size_t i = 0; i < colRes->polygonTypes.size(); i++) - { - colHeader->surfaceTypeList[i].data[0] = colRes->polygonTypes[i] >> 32; - colHeader->surfaceTypeList[i].data[1] = colRes->polygonTypes[i] & 0xFFFFFFFF; - } - - colHeader->cameraDataList = (CamData*)malloc(sizeof(CamData) * colRes->camData->entries.size()); - - for (size_t i = 0; i < colRes->camData->entries.size(); i++) - { - colHeader->cameraDataList[i].cameraSType = colRes->camData->entries[i]->cameraSType; - colHeader->cameraDataList[i].numCameras = colRes->camData->entries[i]->numData; - - int idx = colRes->camData->entries[i]->cameraPosDataIdx; - - colHeader->cameraDataList[i].camPosData = (Vec3s*)malloc(sizeof(Vec3s)); - - if (colRes->camData->cameraPositionData.size() > 0) - { - colHeader->cameraDataList[i].camPosData->x = colRes->camData->cameraPositionData[idx]->x; - colHeader->cameraDataList[i].camPosData->y = colRes->camData->cameraPositionData[idx]->y; - colHeader->cameraDataList[i].camPosData->z = colRes->camData->cameraPositionData[idx]->z; - } - else - { - colHeader->cameraDataList[i].camPosData->x = 0; - colHeader->cameraDataList[i].camPosData->y = 0; - colHeader->cameraDataList[i].camPosData->z = 0; - } - } - - colHeader->numWaterBoxes = colRes->waterBoxes.size(); - colHeader->waterBoxes = (WaterBox*)malloc(sizeof(WaterBox) * colHeader->numWaterBoxes); - - for (int i = 0; i < colHeader->numWaterBoxes; i++) - { - colHeader->waterBoxes[i].xLength = colRes->waterBoxes[i].xLength; - colHeader->waterBoxes[i].ySurface = colRes->waterBoxes[i].ySurface; - colHeader->waterBoxes[i].xMin = colRes->waterBoxes[i].xMin; - colHeader->waterBoxes[i].zMin = colRes->waterBoxes[i].zMin; - colHeader->waterBoxes[i].xLength = colRes->waterBoxes[i].xLength; - colHeader->waterBoxes[i].zLength = colRes->waterBoxes[i].zLength; - colHeader->waterBoxes[i].properties = colRes->waterBoxes[i].properties; - } - - colRes->CachedGameAsset = colHeader; - - return (CollisionHeader*)colHeader; +extern "C" CollisionHeader* ResourceMgr_LoadColByName(const char* path) { + return (CollisionHeader*)GetResourceDataByName(path, false); } -extern "C" Vtx* ResourceMgr_LoadVtxByName(const char* path) -{ - auto res = std::static_pointer_cast(ResourceMgr_LoadResource(path)); - return (Vtx*)res->vertices.data(); +extern "C" Vtx* ResourceMgr_LoadVtxByName(char* path) { + return (Vtx*)GetResourceDataByName(path, false); } -extern "C" SequenceData ResourceMgr_LoadSeqByName(const char* path) -{ - auto file = std::static_pointer_cast(OTRGlobals::Instance->context->GetResourceManager() - ->LoadResource(path)); - - SequenceData seqData; - seqData.seqNumber = file->seqNumber; - seqData.medium = file->medium; - seqData.cachePolicy = file->cachePolicy; - seqData.numFonts = file->fonts.size(); - - for (int i = 0; i < seqData.numFonts; i++) - seqData.fonts[i] = file->fonts[i]; - - seqData.seqData = file->seqData.data(); - seqData.seqDataSize = file->seqData.size(); - - return seqData; +extern "C" SequenceData ResourceMgr_LoadSeqByName(const char* path) { + SequenceData* sequence = (SequenceData*)GetResourceDataByName(path, false); + return *sequence; } std::map cachedCustomSFs; extern "C" SoundFontSample* ReadCustomSample(const char* path) { - + return nullptr; +/* if (!ExtensionCache.contains(path)) return nullptr; @@ -1097,189 +1024,15 @@ extern "C" SoundFontSample* ReadCustomSample(const char* path) { } return nullptr; +*/ } -extern "C" SoundFontSample* ResourceMgr_LoadAudioSample(const char* path) -{ - if (std::string(path) == "") - return nullptr; - - if (cachedCustomSFs.find(path) != cachedCustomSFs.end()) - return cachedCustomSFs[path]; - - SoundFontSample* cSample = ReadCustomSample(path); - - if (cSample != nullptr) - return cSample; - - auto sample = std::static_pointer_cast(ResourceMgr_LoadResource(path)); - - if (sample == nullptr) - return NULL; - - if (sample->CachedGameAsset != nullptr) - { - SoundFontSample* sampleC = (SoundFontSample*)sample->CachedGameAsset; - return (SoundFontSample*)sample->CachedGameAsset; - } - else - { - SoundFontSample* sampleC = new SoundFontSample; - - sampleC->sampleAddr = sample->data.data(); - - sampleC->size = sample->data.size(); - sampleC->codec = sample->codec; - sampleC->medium = sample->medium; - sampleC->unk_bit26 = sample->unk_bit26; - sampleC->unk_bit25 = sample->unk_bit25; - - sampleC->book = (AdpcmBook*) malloc(sizeof(AdpcmBook) + sample->book.books.size() * sizeof(int16_t)); - sampleC->book->npredictors = sample->book.npredictors; - sampleC->book->order = sample->book.order; - - for (size_t i = 0; i < sample->book.books.size(); i++) - sampleC->book->book[i] = sample->book.books[i]; - - sampleC->loop = new AdpcmLoop; - sampleC->loop->start = sample->loop.start; - sampleC->loop->end = sample->loop.end; - sampleC->loop->count = sample->loop.count; - - for (int i = 0; i < 16; i++) - sampleC->loop->state[i] = 0; - - for (size_t i = 0; i < sample->loop.states.size(); i++) - sampleC->loop->state[i] = sample->loop.states[i]; - - sample->CachedGameAsset = sampleC; - return sampleC; - } +extern "C" SoundFontSample* ResourceMgr_LoadAudioSample(const char* path) { + return (SoundFontSample*)GetResourceDataByName(path, false); } extern "C" SoundFont* ResourceMgr_LoadAudioSoundFont(const char* path) { - auto soundFont = std::static_pointer_cast(ResourceMgr_LoadResource(path)); - - if (soundFont == nullptr) - return NULL; - - if (soundFont->CachedGameAsset != nullptr) - { - return (SoundFont*)soundFont->CachedGameAsset; - } - else - { - SoundFont* soundFontC = (SoundFont*)malloc(sizeof(SoundFont)); - - soundFontC->fntIndex = soundFont->id; - soundFontC->numDrums = soundFont->drums.size(); - soundFontC->numInstruments = soundFont->instruments.size(); - soundFontC->numSfx = soundFont->soundEffects.size(); - soundFontC->sampleBankId1 = soundFont->data1 >> 8; - soundFontC->sampleBankId2 = soundFont->data1 & 0xFF; - - soundFontC->drums = (Drum**)malloc(sizeof(Drum*) * soundFont->drums.size()); - - for (size_t i = 0; i < soundFont->drums.size(); i++) - { - Drum* drum = (Drum*)malloc(sizeof(Drum)); - - drum->releaseRate = soundFont->drums[i].releaseRate; - drum->pan = soundFont->drums[i].pan; - drum->loaded = 0; - - if (soundFont->drums[i].env.size() == 0) - drum->envelope = NULL; - else - { - drum->envelope = (AdsrEnvelope*)malloc(sizeof(AdsrEnvelope) * soundFont->drums[i].env.size()); - - for (size_t k = 0; k < soundFont->drums[i].env.size(); k++) - { - drum->envelope[k].delay = BE16SWAP(soundFont->drums[i].env[k]->delay); - drum->envelope[k].arg = BE16SWAP(soundFont->drums[i].env[k]->arg); - } - } - - drum->sound.sample = ResourceMgr_LoadAudioSample(soundFont->drums[i].sampleFileName.c_str()); - drum->sound.tuning = soundFont->drums[i].tuning; - - soundFontC->drums[i] = drum; - } - - soundFontC->instruments = (Instrument**)malloc(sizeof(Instrument*) * soundFont->instruments.size()); - - for (size_t i = 0; i < soundFont->instruments.size(); i++) { - - if (soundFont->instruments[i].isValidEntry) - { - Instrument* inst = (Instrument*)malloc(sizeof(Instrument)); - - inst->loaded = 0; - inst->releaseRate = soundFont->instruments[i].releaseRate; - inst->normalRangeLo = soundFont->instruments[i].normalRangeLo; - inst->normalRangeHi = soundFont->instruments[i].normalRangeHi; - - if (soundFont->instruments[i].env.size() == 0) - inst->envelope = NULL; - else - { - inst->envelope = (AdsrEnvelope*)malloc(sizeof(AdsrEnvelope) * soundFont->instruments[i].env.size()); - - for (int k = 0; k < soundFont->instruments[i].env.size(); k++) - { - inst->envelope[k].delay = BE16SWAP(soundFont->instruments[i].env[k]->delay); - inst->envelope[k].arg = BE16SWAP(soundFont->instruments[i].env[k]->arg); - } - } - if (soundFont->instruments[i].lowNotesSound != nullptr) - { - inst->lowNotesSound.sample = - ResourceMgr_LoadAudioSample(soundFont->instruments[i].lowNotesSound->sampleFileName.c_str()); - inst->lowNotesSound.tuning = soundFont->instruments[i].lowNotesSound->tuning; - } else { - inst->lowNotesSound.sample = NULL; - inst->lowNotesSound.tuning = 0; - } - - if (soundFont->instruments[i].normalNotesSound != nullptr) { - inst->normalNotesSound.sample = - ResourceMgr_LoadAudioSample(soundFont->instruments[i].normalNotesSound->sampleFileName.c_str()); - inst->normalNotesSound.tuning = soundFont->instruments[i].normalNotesSound->tuning; - - } else { - inst->normalNotesSound.sample = NULL; - inst->normalNotesSound.tuning = 0; - } - - if (soundFont->instruments[i].highNotesSound != nullptr) { - inst->highNotesSound.sample = - ResourceMgr_LoadAudioSample(soundFont->instruments[i].highNotesSound->sampleFileName.c_str()); - inst->highNotesSound.tuning = soundFont->instruments[i].highNotesSound->tuning; - } else { - inst->highNotesSound.sample = NULL; - inst->highNotesSound.tuning = 0; - } - - soundFontC->instruments[i] = inst; - } - else - { - soundFontC->instruments[i] = nullptr; - } - } - - soundFontC->soundEffects = (SoundFontSound*)malloc(sizeof(SoundFontSound) * soundFont->soundEffects.size()); - - for (size_t i = 0; i < soundFont->soundEffects.size(); i++) - { - soundFontC->soundEffects[i].sample = ResourceMgr_LoadAudioSample(soundFont->soundEffects[i]->sampleFileName.c_str()); - soundFontC->soundEffects[i].tuning = soundFont->soundEffects[i]->tuning; - } - - soundFont->CachedGameAsset = soundFontC; - return soundFontC; - } + return (SoundFont*)GetResourceDataByName(path, false); } extern "C" int ResourceMgr_OTRSigCheck(char* imgData) @@ -1301,263 +1054,15 @@ extern "C" int ResourceMgr_OTRSigCheck(char* imgData) } extern "C" AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path) { - auto res = std::static_pointer_cast(ResourceMgr_LoadResource(path)); - - if (res->CachedGameAsset != nullptr) - return (AnimationHeaderCommon*)res->CachedGameAsset; - - AnimationHeaderCommon* anim = nullptr; - - if (res->type == Ship::AnimationType::Normal) { - AnimationHeader* animNormal = (AnimationHeader*)malloc(sizeof(AnimationHeader)); - - animNormal->common.frameCount = res->frameCount; - animNormal->frameData = (int16_t*)malloc(res->rotationValues.size() * sizeof(int16_t)); - - for (size_t i = 0; i < res->rotationValues.size(); i++) - animNormal->frameData[i] = res->rotationValues[i]; - - animNormal->jointIndices = (JointIndex*)malloc(res->rotationIndices.size() * sizeof(Vec3s)); - - for (size_t i = 0; i < res->rotationIndices.size(); i++) { - animNormal->jointIndices[i].x = res->rotationIndices[i].x; - animNormal->jointIndices[i].y = res->rotationIndices[i].y; - animNormal->jointIndices[i].z = res->rotationIndices[i].z; - } - - animNormal->staticIndexMax = res->limit; - - anim = (AnimationHeaderCommon*)animNormal; - } - else if (res->type == Ship::AnimationType::Curve) - { - TransformUpdateIndex* animCurve = (TransformUpdateIndex*)malloc(sizeof(TransformUpdateIndex)); - - animCurve->copyValues = (s16*)malloc(res->copyValuesArr.size() * sizeof(s16)); - - for (size_t i = 0; i < res->copyValuesArr.size(); i++) - animCurve->copyValues[i] = res->copyValuesArr[i]; - - animCurve->transformData = (TransformData*)malloc(res->transformDataArr.size() * sizeof(TransformData)); - - for (size_t i = 0; i < res->transformDataArr.size(); i++) - { - animCurve->transformData[i].unk_00 = res->transformDataArr[i].unk_00; - animCurve->transformData[i].unk_02 = res->transformDataArr[i].unk_02; - animCurve->transformData[i].unk_04 = res->transformDataArr[i].unk_04; - animCurve->transformData[i].unk_06 = res->transformDataArr[i].unk_06; - animCurve->transformData[i].unk_08 = res->transformDataArr[i].unk_08; - } - - animCurve->refIndex = (u8*)malloc(res->refIndexArr.size()); - for (size_t i = 0; i < res->refIndexArr.size(); i++) - animCurve->refIndex[i] = res->refIndexArr[i]; - - anim = (AnimationHeaderCommon*)animCurve; - } - else { - LinkAnimationHeader* animLink = (LinkAnimationHeader*)malloc(sizeof(LinkAnimationHeader)); - animLink->common.frameCount = res->frameCount; - animLink->segment = (void*)res->segPtr; - - anim = (AnimationHeaderCommon*)animLink; - } - - res->CachedGameAsset = anim; - - return anim; + return (AnimationHeaderCommon*)GetResourceDataByName(path, false); } extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path) { - auto res = std::static_pointer_cast(ResourceMgr_LoadResource(path)); - - if (res->CachedGameAsset != nullptr) - return (SkeletonHeader*)res->CachedGameAsset; - - SkeletonHeader* baseHeader = nullptr; - - if (res->type == Ship::SkeletonType::Normal) - { - baseHeader = (SkeletonHeader*)malloc(sizeof(SkeletonHeader)); - } - else if (res->type == Ship::SkeletonType::Curve) - { - SkelCurveLimbList* curve = (SkelCurveLimbList*)malloc(sizeof(SkelCurveLimbList)); - curve->limbCount = res->limbCount; - curve->limbs = (SkelCurveLimb**)malloc(res->limbCount * sizeof(SkelCurveLimb*)); - baseHeader = (SkeletonHeader*)curve; - } - else { - FlexSkeletonHeader* flex = (FlexSkeletonHeader*)malloc(sizeof(FlexSkeletonHeader)); - flex->dListCount = res->dListCount; - - baseHeader = (SkeletonHeader*)flex; - } - - if (res->type != Ship::SkeletonType::Curve) - { - baseHeader->limbCount = res->limbCount; - baseHeader->segment = (void**)malloc(sizeof(StandardLimb*) * res->limbTable.size()); - } - - for (size_t i = 0; i < res->limbTable.size(); i++) { - std::string limbStr = res->limbTable[i]; - auto limb = std::static_pointer_cast(ResourceMgr_LoadResource(limbStr.c_str())); - - if (limb->limbType == Ship::LimbType::LOD) { - LodLimb* limbC = (LodLimb*)malloc(sizeof(LodLimb)); - limbC->jointPos.x = limb->transX; - limbC->jointPos.y = limb->transY; - limbC->jointPos.z = limb->transZ; - limbC->child = limb->childIndex; - limbC->sibling = limb->siblingIndex; - - if (limb->dListPtr != "") { - auto dList = ResourceMgr_LoadGfxByName(limb->dListPtr.c_str()); - limbC->dLists[0] = dList; - } else { - limbC->dLists[0] = nullptr; - } - - if (limb->dList2Ptr != "") { - auto dList = ResourceMgr_LoadGfxByName(limb->dList2Ptr.c_str()); - limbC->dLists[1] = dList; - } else { - limbC->dLists[1] = nullptr; - } - - baseHeader->segment[i] = limbC; - } - else if (limb->limbType == Ship::LimbType::Standard) - { - const auto limbC = new StandardLimb; - limbC->jointPos.x = limb->transX; - limbC->jointPos.y = limb->transY; - limbC->jointPos.z = limb->transZ; - limbC->child = limb->childIndex; - limbC->sibling = limb->siblingIndex; - limbC->dList = nullptr; - - if (!limb->dListPtr.empty()) { - const auto dList = ResourceMgr_LoadGfxByName(limb->dListPtr.c_str()); - limbC->dList = dList; - } - - baseHeader->segment[i] = limbC; - } - else if (limb->limbType == Ship::LimbType::Curve) - { - const auto limbC = new SkelCurveLimb; - - limbC->firstChildIdx = limb->childIndex; - limbC->nextLimbIdx = limb->siblingIndex; - limbC->dList[0] = nullptr; - limbC->dList[1] = nullptr; - - if (!limb->dListPtr.empty()) { - const auto dList = ResourceMgr_LoadGfxByName(limb->dListPtr.c_str()); - limbC->dList[0] = dList; - } - - if (!limb->dList2Ptr.empty()) { - const auto dList = ResourceMgr_LoadGfxByName(limb->dList2Ptr.c_str()); - limbC->dList[1] = dList; - } - - const auto curve = reinterpret_cast(baseHeader); - curve->limbs[i] = limbC; - } - else if (limb->limbType == Ship::LimbType::Skin) - { - const auto limbC = new SkinLimb; - limbC->jointPos.x = limb->transX; - limbC->jointPos.y = limb->transY; - limbC->jointPos.z = limb->transZ; - limbC->child = limb->childIndex; - limbC->sibling = limb->siblingIndex; - - if (limb->skinSegmentType == Ship::ZLimbSkinType::SkinType_DList) - limbC->segmentType = static_cast(limb->skinSegmentType); - else if (limb->skinSegmentType == Ship::ZLimbSkinType::SkinType_4) - limbC->segmentType = 4; - else if (limb->skinSegmentType == Ship::ZLimbSkinType::SkinType_5) - limbC->segmentType = 5; - else - limbC->segmentType = 0; - - if (limb->skinSegmentType == Ship::ZLimbSkinType::SkinType_DList) - limbC->segment = ResourceMgr_LoadGfxByName(limb->skinDList.c_str()); - else if (limb->skinSegmentType == Ship::ZLimbSkinType::SkinType_4) { - const auto animData = new SkinAnimatedLimbData; - const int skinDataSize = limb->skinData.size(); - - animData->totalVtxCount = limb->skinVtxCnt; - animData->limbModifCount = skinDataSize; - animData->limbModifications = new SkinLimbModif[animData->limbModifCount]; - animData->dlist = ResourceMgr_LoadGfxByName(limb->skinDList2.c_str()); - - for (size_t i = 0; i < skinDataSize; i++) - { - animData->limbModifications[i].vtxCount = limb->skinData[i].unk_8_arr.size(); - animData->limbModifications[i].transformCount = limb->skinData[i].unk_C_arr.size(); - animData->limbModifications[i].unk_4 = limb->skinData[i].unk_4; - - animData->limbModifications[i].skinVertices = new SkinVertex[limb->skinData[i].unk_8_arr.size()]; - - for (int k = 0; k < limb->skinData[i].unk_8_arr.size(); k++) - { - animData->limbModifications[i].skinVertices[k].index = limb->skinData[i].unk_8_arr[k].unk_0; - animData->limbModifications[i].skinVertices[k].s = limb->skinData[i].unk_8_arr[k].unk_2; - animData->limbModifications[i].skinVertices[k].t = limb->skinData[i].unk_8_arr[k].unk_4; - animData->limbModifications[i].skinVertices[k].normX = limb->skinData[i].unk_8_arr[k].unk_6; - animData->limbModifications[i].skinVertices[k].normY = limb->skinData[i].unk_8_arr[k].unk_7; - animData->limbModifications[i].skinVertices[k].normZ = limb->skinData[i].unk_8_arr[k].unk_8; - animData->limbModifications[i].skinVertices[k].alpha = limb->skinData[i].unk_8_arr[k].unk_9; - } - - animData->limbModifications[i].limbTransformations = - new SkinTransformation[limb->skinData[i].unk_C_arr.size()]; - - for (int k = 0; k < limb->skinData[i].unk_C_arr.size(); k++) - { - animData->limbModifications[i].limbTransformations[k].limbIndex = limb->skinData[i].unk_C_arr[k].unk_0; - animData->limbModifications[i].limbTransformations[k].x = limb->skinData[i].unk_C_arr[k].x; - animData->limbModifications[i].limbTransformations[k].y = limb->skinData[i].unk_C_arr[k].y; - animData->limbModifications[i].limbTransformations[k].z = limb->skinData[i].unk_C_arr[k].z; - animData->limbModifications[i].limbTransformations[k].scale = limb->skinData[i].unk_C_arr[k].unk_8; - } - } - - limbC->segment = animData; - - //limbC->segment = nullptr; - } - - /*if (limb->dListPtr != "") { - auto dList = ResourceMgr_LoadGfxByName((char*)limb->dListPtr.c_str()); - limbC->unk_8 = dList; - } - else { - limbC->unk_8 = nullptr; - }*/ - - baseHeader->segment[i] = limbC; - } - else - { - // OTRTODO: Print error here... - } - } - - res->CachedGameAsset = baseHeader; - - return baseHeader; + return (SkeletonHeader*)GetResourceDataByName(path, false); } -extern "C" s32* ResourceMgr_LoadCSByName(const char* path) -{ - auto res = std::static_pointer_cast(ResourceMgr_LoadResource(path)); - return (s32*)res->commands.data(); +extern "C" s32* ResourceMgr_LoadCSByName(const char* path) { + return (s32*)GetResourceDataByName(path, false); } std::filesystem::path GetSaveFile(std::shared_ptr Conf) { @@ -1936,7 +1441,7 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) { if (player->getItemEntry.getItemId == RG_ICE_TRAP) { u16 iceTrapTextId = Random(0, NUM_ICE_TRAP_MESSAGES); messageEntry = CustomMessageManager::Instance->RetrieveMessage(Randomizer::IceTrapRandoMessageTableID, iceTrapTextId); - if (CVar_GetS32("gLetItSnow", 0)) { + if (CVarGetInteger("gLetItSnow", 0)) { messageEntry = CustomMessageManager::Instance->RetrieveMessage(Randomizer::IceTrapRandoMessageTableID, NUM_ICE_TRAP_MESSAGES + 1); } } else if (player->getItemEntry.getItemId >= RG_DEKU_TREE_MAP && player->getItemEntry.getItemId <= RG_ICE_CAVERN_MAP) { @@ -1998,12 +1503,12 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) { RandomizerInf randoInf = (RandomizerInf)((textId - (TEXT_SHOP_ITEM_RANDOM + NUM_SHOP_ITEMS)) + RAND_INF_SHOP_ITEMS_KF_SHOP_ITEM_1); messageEntry = OTRGlobals::Instance->gRandomizer->GetMerchantMessage(randoInf, TEXT_SHOP_ITEM_RANDOM_CONFIRM); } - } else if (CVar_GetS32("gRandomizeRupeeNames", 0) && + } else if (CVarGetInteger("gRandomizeRupeeNames", 0) && (textId == TEXT_BLUE_RUPEE || textId == TEXT_RED_RUPEE || textId == TEXT_PURPLE_RUPEE || textId == TEXT_HUGE_RUPEE)) { messageEntry = Randomizer::GetRupeeMessage(textId); // In rando, replace Navi's general overworld hints with rando-related gameplay tips - } else if (CVar_GetS32("gRandoRelevantNavi", 1) && textId >= 0x0140 && textId <= 0x015F) { + } else if (CVarGetInteger("gRandoRelevantNavi", 1) && textId >= 0x0140 && textId <= 0x015F) { u16 naviTextId = Random(0, NUM_NAVI_MESSAGES); messageEntry = CustomMessageManager::Instance->RetrieveMessage(Randomizer::NaviRandoMessageTableID, naviTextId); } else if (Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS) && textId == TEXT_BEAN_SALESMAN) { @@ -2024,7 +1529,7 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) { } } if (textId == TEXT_GS_NO_FREEZE || textId == TEXT_GS_FREEZE) { - if (CVar_GetS32("gInjectItemCounts", 0) != 0) { + if (CVarGetInteger("gInjectItemCounts", 0) != 0) { // The freeze text cannot be manually dismissed and must be auto-dismissed. // This is fine and even wanted when skull tokens are not shuffled, but when // when they are shuffled we don't want to be able to manually dismiss the box. @@ -2032,7 +1537,7 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) { // animation until the text box auto-dismisses. // RANDOTODO: Implement a way to determine if an item came from a skulltula and // inject the auto-dismiss control code if it did. - if (CVar_GetS32("gSkulltulaFreeze", 0) != 0 && + if (CVarGetInteger("gSkulltulaFreeze", 0) != 0 && !(gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_TOKENS) != RO_TOKENSANITY_OFF)) { textId = TEXT_GS_NO_FREEZE; } else { @@ -2042,15 +1547,15 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) { CustomMessageManager::ReplaceStringInMessage(messageEntry, "{{gsCount}}", std::to_string(gSaveContext.inventory.gsTokens + 1)); } } - if (textId == TEXT_HEART_CONTAINER && CVar_GetS32("gInjectItemCounts", 0)) { + if (textId == TEXT_HEART_CONTAINER && CVarGetInteger("gInjectItemCounts", 0)) { messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, TEXT_HEART_CONTAINER); CustomMessageManager::ReplaceStringInMessage(messageEntry, "{{heartContainerCount}}", std::to_string(gSaveContext.sohStats.heartContainers + 1)); } - if (textId == TEXT_HEART_PIECE && CVar_GetS32("gInjectItemCounts", 0)) { + if (textId == TEXT_HEART_PIECE && CVarGetInteger("gInjectItemCounts", 0)) { messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, TEXT_HEART_PIECE); CustomMessageManager::ReplaceStringInMessage(messageEntry, "{{heartPieceCount}}", std::to_string(gSaveContext.sohStats.heartPieces + 1)); } - if (textId == TEXT_MARKET_GUARD_NIGHT && CVar_GetS32("gMarketSneak", 0) && play->sceneNum == SCENE_ENTRA_N) { + if (textId == TEXT_MARKET_GUARD_NIGHT && CVarGetInteger("gMarketSneak", 0) && play->sceneNum == SCENE_ENTRA_N) { messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, TEXT_MARKET_GUARD_NIGHT); } if (messageEntry.textBoxType != -1) { diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h index e8f068429..6b93bd2c7 100644 --- a/soh/soh/OTRGlobals.h +++ b/soh/soh/OTRGlobals.h @@ -62,10 +62,8 @@ char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize); void ResourceMgr_LoadFile(const char* resName); char* ResourceMgr_LoadFileFromDisk(const char* filePath); char* ResourceMgr_LoadJPEG(char* data, int dataSize); -char* ResourceMgr_LoadTexByName(const char* texPath); uint16_t ResourceMgr_LoadTexWidthByName(char* texPath); uint16_t ResourceMgr_LoadTexHeightByName(char* texPath); -uint32_t ResourceMgr_LoadTexSizeByName(char* texPath); char* ResourceMgr_LoadTexOrDListByName(const char* filePath); char* ResourceMgr_LoadPlayerAnimByName(const char* animPath); AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path); @@ -77,7 +75,7 @@ void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName); char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path); Vtx* ResourceMgr_LoadVtxByCRC(uint64_t crc); -Vtx* ResourceMgr_LoadVtxByName(const char* path); +Vtx* ResourceMgr_LoadVtxByName(char* path); SoundFont* ResourceMgr_LoadAudioSoundFont(const char* path); SequenceData ResourceMgr_LoadSeqByName(const char* path); SoundFontSample* ResourceMgr_LoadAudioSample(const char* path); diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index 0e613edc0..9df4a72b4 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -5,7 +5,7 @@ #include "functions.h" #include "macros.h" #include -#include +#include #define NOGDI // avoid various windows defines that conflict with things in z64.h #include @@ -801,7 +801,7 @@ void SaveManager::AddPostFunction(const std::string& name, PostFunc func) { void SaveManager::CreateDefaultGlobal() { gSaveContext.audioSetting = 0; gSaveContext.zTargetSetting = 0; - gSaveContext.language = CVar_GetS32("gLanguages", LANGUAGE_ENG); + gSaveContext.language = CVarGetInteger("gLanguages", LANGUAGE_ENG); SaveGlobal(); } @@ -1962,7 +1962,7 @@ void SaveManager::ConvertFromUnversioned() { gSaveContext.zTargetSetting = data[SRAM_HEADER_ZTARGET] & 1; gSaveContext.language = data[SRAM_HEADER_LANGUAGE]; if (gSaveContext.language >= LANGUAGE_MAX) { - gSaveContext.language = CVar_GetS32("gLanguages", LANGUAGE_ENG); + gSaveContext.language = CVarGetInteger("gLanguages", LANGUAGE_ENG); } SaveGlobal(); diff --git a/soh/soh/SaveManager.h b/soh/soh/SaveManager.h index 39669c520..32d4f2fbd 100644 --- a/soh/soh/SaveManager.h +++ b/soh/soh/SaveManager.h @@ -1,6 +1,6 @@ #pragma once -#include +#include typedef struct { u8 valid; diff --git a/soh/soh/UIWidgets.cpp b/soh/soh/UIWidgets.cpp index 651487551..4c1fcd0a0 100644 --- a/soh/soh/UIWidgets.cpp +++ b/soh/soh/UIWidgets.cpp @@ -10,9 +10,9 @@ #define IMGUI_DEFINE_MATH_OPERATORS #include #include -#include +#include -#include +#include #include "soh/Enhancements/cosmetics/CosmeticsEditor.h" namespace UIWidgets { @@ -59,7 +59,7 @@ namespace UIWidgets { defaultColors.b = default_colors.z; defaultColors.a = default_colors.w; - Color_RGBA8 cvarColor = CVar_GetRGBA(cvarname, defaultColors); + Color_RGBA8 cvarColor = CVarGetColor(cvarname, defaultColors); ColorArray.x = cvarColor.r / 255.0; ColorArray.y = cvarColor.g / 255.0; @@ -202,9 +202,9 @@ namespace UIWidgets { ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true); ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f); } - bool val = (bool)CVar_GetS32(cvarName, defaultValue); + bool val = (bool)CVarGetInteger(cvarName, defaultValue); if (CustomCheckbox(text, &val, disabled, disabledGraphic)) { - CVar_SetS32(cvarName, val); + CVarSetInteger(cvarName, val); SohImGui::RequestCvarSaveOnNextTick(); changed = true; } @@ -233,10 +233,10 @@ namespace UIWidgets { } void EnhancementCombo(const std::string& name, const char* cvarName, const std::vector& items, int defaultValue) { - if (ImGui::BeginCombo(name.c_str(), items[static_cast(CVar_GetS32(cvarName, defaultValue))].c_str())) { + if (ImGui::BeginCombo(name.c_str(), items[static_cast(CVarGetInteger(cvarName, defaultValue))].c_str())) { for (int settingIndex = 0; settingIndex < (int) items.size(); settingIndex++) { if (ImGui::Selectable(items[settingIndex].c_str())) { - CVar_SetS32(cvarName, settingIndex); + CVarSetInteger(cvarName, settingIndex); SohImGui::RequestCvarSaveOnNextTick(); } @@ -250,14 +250,14 @@ namespace UIWidgets { if (FirstTimeValue <= 0) { FirstTimeValue = 0; } - uint8_t selected = CVar_GetS32(name, FirstTimeValue); + uint8_t selected = CVarGetInteger(name, FirstTimeValue); uint8_t DefaultValue = selected; std::string comboName = std::string("##") + std::string(name); if (ImGui::BeginCombo(comboName.c_str(), ComboArray[DefaultValue])) { for (uint8_t i = 0; i < arraySize; i++) { if (strlen(ComboArray[i]) > 1) { if (ImGui::Selectable(ComboArray[i], i == selected)) { - CVar_SetS32(name, i); + CVarSetInteger(name, i); selected = i; changed = true; SohImGui::RequestCvarSaveOnNextTick(); @@ -294,7 +294,7 @@ namespace UIWidgets { bool EnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, int defaultValue, bool PlusMinusButton, bool disabled, const char* disabledTooltipText) { bool changed = false; - int val = CVar_GetS32(cvarName, defaultValue); + int val = CVarGetInteger(cvarName, defaultValue); float alpha; if (disabled) { @@ -315,7 +315,7 @@ namespace UIWidgets { MinusBTNName += cvarName; if (ImGui::Button(MinusBTNName.c_str())) { val--; - CVar_SetS32(cvarName, val); + CVarSetInteger(cvarName, val); SohImGui::RequestCvarSaveOnNextTick(); changed = true; } @@ -337,7 +337,7 @@ namespace UIWidgets { } if (ImGui::SliderInt(id, &val, min, max, format)) { - CVar_SetS32(cvarName, val); + CVarSetInteger(cvarName, val); SohImGui::RequestCvarSaveOnNextTick(); changed = true; } @@ -355,7 +355,7 @@ namespace UIWidgets { ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); if (ImGui::Button(PlusBTNName.c_str())) { val++; - CVar_SetS32(cvarName, val); + CVarSetInteger(cvarName, val); SohImGui::RequestCvarSaveOnNextTick(); changed = true; } @@ -372,7 +372,7 @@ namespace UIWidgets { if (val < min) { val = min; - CVar_SetS32(cvarName, val); + CVarSetInteger(cvarName, val); SohImGui::RequestCvarSaveOnNextTick(); changed = true; } @@ -380,7 +380,7 @@ namespace UIWidgets { if (val > max) { val = max; - CVar_SetS32(cvarName, val); + CVarSetInteger(cvarName, val); SohImGui::RequestCvarSaveOnNextTick(); changed = true; } @@ -390,7 +390,7 @@ namespace UIWidgets { bool EnhancementSliderFloat(const char* text, const char* id, const char* cvarName, float min, float max, const char* format, float defaultValue, bool isPercentage, bool PlusMinusButton, bool disabled, const char* disabledTooltipText) { bool changed = false; - float val = CVar_GetFloat(cvarName, defaultValue); + float val = CVarGetFloat(cvarName, defaultValue); if (disabled) { ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true); @@ -412,7 +412,7 @@ namespace UIWidgets { } else { val -= 0.01f; } - CVar_SetFloat(cvarName, val); + CVarSetFloat(cvarName, val); SohImGui::RequestCvarSaveOnNextTick(); changed = true; } @@ -430,9 +430,9 @@ namespace UIWidgets { } if (ImGui::SliderFloat(id, &val, min, max, format)) { if (isPercentage) { - CVar_SetFloat(cvarName, roundf(val * 100) / 100); + CVarSetFloat(cvarName, roundf(val * 100) / 100); } else { - CVar_SetFloat(cvarName, val); + CVarSetFloat(cvarName, val); } SohImGui::RequestCvarSaveOnNextTick(); changed = true; @@ -451,7 +451,7 @@ namespace UIWidgets { } else { val += 0.01f; } - CVar_SetFloat(cvarName, val); + CVarSetFloat(cvarName, val); SohImGui::RequestCvarSaveOnNextTick(); changed = true; } @@ -467,14 +467,14 @@ namespace UIWidgets { if (val < min) { val = min; - CVar_SetFloat(cvarName, val); + CVarSetFloat(cvarName, val); SohImGui::RequestCvarSaveOnNextTick(); changed = true; } if (val > max) { val = max; - CVar_SetFloat(cvarName, val); + CVarSetFloat(cvarName, val); SohImGui::RequestCvarSaveOnNextTick(); changed = true; } @@ -507,9 +507,9 @@ namespace UIWidgets { make_invisible += text; make_invisible += cvarName; - int val = CVar_GetS32(cvarName, 0); + int val = CVarGetInteger(cvarName, 0); if (ImGui::RadioButton(make_invisible.c_str(), id == val)) { - CVar_SetS32(cvarName, id); + CVarSetInteger(cvarName, id); SohImGui::RequestCvarSaveOnNextTick(); } ImGui::SameLine(); @@ -536,8 +536,8 @@ namespace UIWidgets { colorsRGBA.b = defaultcolors.z; colorsRGBA.a = has_alpha ? defaultcolors.w : 255.0f; - CVar_SetRGBA(cvarName, colorsRGBA); - CVar_SetS32(Cvar_RBM.c_str(), 0); //On click disable rainbow mode. + CVarSetColor(cvarName, colorsRGBA); + CVarSetInteger(Cvar_RBM.c_str(), 0); //On click disable rainbow mode. SohImGui::RequestCvarSaveOnNextTick(); changed = true; } @@ -566,8 +566,8 @@ namespace UIWidgets { NewColors.r = fmin(fmax(colors->x * 255, 0), 255); NewColors.g = fmin(fmax(colors->y * 255, 0), 255); NewColors.b = fmin(fmax(colors->z * 255, 0), 255); - CVar_SetRGBA(cvarName, NewColors); - CVar_SetS32(Cvar_RBM.c_str(), 0); // On click disable rainbow mode. + CVarSetColor(cvarName, NewColors); + CVarSetInteger(Cvar_RBM.c_str(), 0); // On click disable rainbow mode. SohImGui::RequestCvarSaveOnNextTick(); changed = true; } @@ -578,7 +578,7 @@ namespace UIWidgets { void DrawLockColorCheckbox(const char* cvarName) { std::string Cvar_Lock = cvarName; Cvar_Lock += "Lock"; - s32 lock = CVar_GetS32(Cvar_Lock.c_str(), 0); + s32 lock = CVarGetInteger(Cvar_Lock.c_str(), 0); std::string FullName = "Lock##" + Cvar_Lock; EnhancementCheckbox(FullName.c_str(), Cvar_Lock.c_str()); Tooltip("Prevents this color from being changed upon selecting \"Randomize all\""); @@ -618,7 +618,7 @@ namespace UIWidgets { colors.b = ColorRGBA.z * 255.0; colors.a = 255.0; - CVar_SetRGBA(cvarName, colors); + CVarSetColor(cvarName, colors); SohImGui::RequestCvarSaveOnNextTick(); changed = true; } @@ -634,7 +634,7 @@ namespace UIWidgets { colors.b = ColorRGBA.z * 255.0; colors.a = ColorRGBA.w * 255.0; - CVar_SetRGBA(cvarName, colors); + CVarSetColor(cvarName, colors); SohImGui::RequestCvarSaveOnNextTick(); changed = true; } diff --git a/soh/soh/frame_interpolation.cpp b/soh/soh/frame_interpolation.cpp index e578c855c..f4709d3bc 100644 --- a/soh/soh/frame_interpolation.cpp +++ b/soh/soh/frame_interpolation.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -451,7 +451,7 @@ void FrameInterpolation_StartRecord(void) { current_recording = {}; current_path.clear(); current_path.push_back(¤t_recording.root_path); - if (CVar_GetS32("gInterpolationFPS", 20) != 20) { + if (CVarGetInteger("gInterpolationFPS", 20) != 20) { is_recording = true; } } diff --git a/soh/soh/resource/importer/AnimationFactory.cpp b/soh/soh/resource/importer/AnimationFactory.cpp new file mode 100644 index 000000000..ff4b26755 --- /dev/null +++ b/soh/soh/resource/importer/AnimationFactory.cpp @@ -0,0 +1,103 @@ +#include "soh/resource/importer/AnimationFactory.h" +#include "soh/resource/type/Animation.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr AnimationFactory::ReadResource(uint32_t version, std::shared_ptr reader) { + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) { + SPDLOG_ERROR("Failed to load Animation with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::AnimationFactoryV0::ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) { + std::shared_ptr animation = std::static_pointer_cast(resource); + + ResourceVersionFactory::ParseFileBinary(reader, animation); + + AnimationType animType = (AnimationType)reader->ReadUInt32(); + animation->type = animType; + + if (animType == AnimationType::Normal) { + // Set frame count + animation->animationData.animationHeader.common.frameCount = reader->ReadInt16(); + + // Populate frame data + uint32_t rotValuesCnt = reader->ReadUInt32(); + animation->rotationValues.reserve(rotValuesCnt); + for (uint32_t i = 0; i < rotValuesCnt; i++) { + animation->rotationValues.push_back(reader->ReadUInt16()); + } + animation->animationData.animationHeader.frameData = (int16_t*)animation->rotationValues.data(); + + // Populate joint indices + uint32_t rotIndCnt = reader->ReadUInt32(); + animation->rotationIndices.reserve(rotIndCnt); + for (size_t i = 0; i < rotIndCnt; i++) { + uint16_t x = reader->ReadUInt16(); + uint16_t y = reader->ReadUInt16(); + uint16_t z = reader->ReadUInt16(); + animation->rotationIndices.push_back(RotationIndex(x, y, z)); + } + animation->animationData.animationHeader.jointIndices = (JointIndex*)animation->rotationIndices.data(); + + // Set static index max + animation->animationData.animationHeader.staticIndexMax = reader->ReadInt16(); + } else if (animType == AnimationType::Curve) { + // Read frame count (unused in this animation type) + reader->ReadInt16(); + + // Set refIndex + uint32_t refArrCnt = reader->ReadUInt32(); + animation->refIndexArr.reserve(refArrCnt); + for (uint32_t i = 0; i < refArrCnt; i++) { + animation->refIndexArr.push_back(reader->ReadUByte()); + } + animation->animationData.transformUpdateIndex.refIndex = animation->refIndexArr.data(); + + // Populate transform data + uint32_t transformDataCnt = reader->ReadUInt32(); + animation->transformDataArr.reserve(transformDataCnt); + for (uint32_t i = 0; i < transformDataCnt; i++) { + TransformData data; + data.unk_00 = reader->ReadUInt16(); + data.unk_02 = reader->ReadInt16(); + data.unk_04 = reader->ReadInt16(); + data.unk_06 = reader->ReadInt16(); + data.unk_08 = reader->ReadFloat(); + + animation->transformDataArr.push_back(data); + } + animation->animationData.transformUpdateIndex.transformData = animation->transformDataArr.data(); + + // Populate copy values + uint32_t copyValuesCnt = reader->ReadUInt32(); + animation->copyValuesArr.reserve(copyValuesCnt); + for (uint32_t i = 0; i < copyValuesCnt; i++) { + animation->copyValuesArr.push_back(reader->ReadInt16()); + } + animation->animationData.transformUpdateIndex.copyValues = animation->copyValuesArr.data(); + } else if (animType == AnimationType::Link) { + // Read the frame count + animation->animationData.linkAnimationHeader.common.frameCount = reader->ReadInt16(); + + // Read the segment pointer (always 32 bit, doesn't adjust for system pointer size) + animation->animationData.linkAnimationHeader.segment = (void*)reader->ReadUInt32(); + } else if (animType == AnimationType::Legacy) { + SPDLOG_DEBUG("BEYTAH ANIMATION?!"); + } +} +} // namespace Ship diff --git a/soh/soh/resource/importer/AnimationFactory.h b/soh/soh/resource/importer/AnimationFactory.h new file mode 100644 index 000000000..319cf68c2 --- /dev/null +++ b/soh/soh/resource/importer/AnimationFactory.h @@ -0,0 +1,16 @@ +#pragma once + +#include "Resource.h" +#include "ResourceFactory.h" + +namespace Ship { +class AnimationFactory : public ResourceFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class AnimationFactoryV0 : public ResourceVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/AudioSampleFactory.cpp b/soh/soh/resource/importer/AudioSampleFactory.cpp new file mode 100644 index 000000000..9044b7748 --- /dev/null +++ b/soh/soh/resource/importer/AudioSampleFactory.cpp @@ -0,0 +1,143 @@ +#include "soh/resource/importer/AudioSampleFactory.h" +#include "soh/resource/type/AudioSample.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr AudioSampleFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 2: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load AudioSample with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::AudioSampleFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr audioSample = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, audioSample); + + audioSample->sample.codec = reader->ReadUByte(); + audioSample->sample.medium = reader->ReadUByte(); + audioSample->sample.unk_bit26 = reader->ReadUByte(); + audioSample->sample.unk_bit25 = reader->ReadUByte(); + audioSample->sample.size = reader->ReadUInt32(); + + audioSample->audioSampleData.reserve(audioSample->sample.size); + for (uint32_t i = 0; i < audioSample->sample.size; i++) { + audioSample->audioSampleData.push_back(reader->ReadUByte()); + } + audioSample->sample.sampleAddr = audioSample->audioSampleData.data(); + + audioSample->loop.start = reader->ReadUInt32(); + audioSample->loop.end = reader->ReadUInt32(); + audioSample->loop.count = reader->ReadUInt32(); + + audioSample->loopStateCount = reader->ReadUInt32(); + for (int i = 0; i < 16; i++) { + audioSample->loop.state[i] = 0; + } + for (uint32_t i = 0; i < audioSample->loopStateCount; i++) { + audioSample->loop.state[i] = reader->ReadInt16(); + } + audioSample->sample.loop = &audioSample->loop; + + audioSample->book.order = reader->ReadInt32(); + audioSample->book.npredictors = reader->ReadInt32(); + audioSample->bookDataCount = reader->ReadUInt32(); + + audioSample->bookData.reserve(audioSample->bookDataCount); + for (uint32_t i = 0; i < audioSample->bookDataCount; i++) { + audioSample->bookData.push_back(reader->ReadInt16()); + } + audioSample->book.book = audioSample->bookData.data(); + audioSample->sample.book = &audioSample->book; +} +} // namespace Ship + + +/* +in ResourceMgr_LoadAudioSample we used to have +-------------- + if (cachedCustomSFs.find(path) != cachedCustomSFs.end()) + return cachedCustomSFs[path]; + + SoundFontSample* cSample = ReadCustomSample(path); + + if (cSample != nullptr) + return cSample; +-------------- +before the rest of the standard sample reading, this is the ReadCustomSample code we used to have + +extern "C" SoundFontSample* ReadCustomSample(const char* path) { + + if (!ExtensionCache.contains(path)) + return nullptr; + + ExtensionEntry entry = ExtensionCache[path]; + + auto sampleRaw = OTRGlobals::Instance->context->GetResourceManager()->LoadFile(entry.path); + uint32_t* strem = (uint32_t*)sampleRaw->Buffer.get(); + uint8_t* strem2 = (uint8_t*)strem; + + SoundFontSample* sampleC = new SoundFontSample; + + if (entry.ext == "wav") { + drwav_uint32 channels; + drwav_uint32 sampleRate; + drwav_uint64 totalPcm; + drmp3_int16* pcmData = + drwav_open_memory_and_read_pcm_frames_s16(strem2, sampleRaw->BufferSize, &channels, &sampleRate, &totalPcm, NULL); + sampleC->size = totalPcm; + sampleC->sampleAddr = (uint8_t*)pcmData; + sampleC->codec = CODEC_S16; + + sampleC->loop = new AdpcmLoop; + sampleC->loop->start = 0; + sampleC->loop->end = sampleC->size - 1; + sampleC->loop->count = 0; + sampleC->sampleRateMagicValue = 'RIFF'; + sampleC->sampleRate = sampleRate; + + cachedCustomSFs[path] = sampleC; + return sampleC; + } else if (entry.ext == "mp3") { + drmp3_config mp3Info; + drmp3_uint64 totalPcm; + drmp3_int16* pcmData = + drmp3_open_memory_and_read_pcm_frames_s16(strem2, sampleRaw->BufferSize, &mp3Info, &totalPcm, NULL); + + sampleC->size = totalPcm * mp3Info.channels * sizeof(short); + sampleC->sampleAddr = (uint8_t*)pcmData; + sampleC->codec = CODEC_S16; + + sampleC->loop = new AdpcmLoop; + sampleC->loop->start = 0; + sampleC->loop->end = sampleC->size; + sampleC->loop->count = 0; + sampleC->sampleRateMagicValue = 'RIFF'; + sampleC->sampleRate = mp3Info.sampleRate; + + cachedCustomSFs[path] = sampleC; + return sampleC; + } + + return nullptr; +} + +*/ diff --git a/soh/soh/resource/importer/AudioSampleFactory.h b/soh/soh/resource/importer/AudioSampleFactory.h new file mode 100644 index 000000000..a9bdc8997 --- /dev/null +++ b/soh/soh/resource/importer/AudioSampleFactory.h @@ -0,0 +1,18 @@ +#pragma once + +#include "Resource.h" +#include "ResourceFactory.h" + +namespace Ship { +class AudioSampleFactory : public ResourceFactory +{ + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class AudioSampleFactoryV0 : public ResourceVersionFactory +{ + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/AudioSequenceFactory.cpp b/soh/soh/resource/importer/AudioSequenceFactory.cpp new file mode 100644 index 000000000..3a5dbbb0c --- /dev/null +++ b/soh/soh/resource/importer/AudioSequenceFactory.cpp @@ -0,0 +1,54 @@ +#include "soh/resource/importer/AudioSequenceFactory.h" +#include "soh/resource/type/AudioSequence.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr AudioSequenceFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 2: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load AudioSequence with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::AudioSequenceFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr audioSequence = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, audioSequence); + + audioSequence->sequence.seqDataSize = reader->ReadInt32(); + audioSequence->sequenceData.reserve(audioSequence->sequence.seqDataSize); + for (uint32_t i = 0; i < audioSequence->sequence.seqDataSize; i++) { + audioSequence->sequenceData.push_back(reader->ReadChar()); + } + audioSequence->sequence.seqData = audioSequence->sequenceData.data(); + + audioSequence->sequence.seqNumber = reader->ReadUByte(); + audioSequence->sequence.medium = reader->ReadUByte(); + audioSequence->sequence.cachePolicy = reader->ReadUByte(); + + audioSequence->sequence.numFonts = reader->ReadUInt32(); + for (uint32_t i = 0; i < 16; i++) { + audioSequence->sequence.fonts[i] = 0; + } + for (uint32_t i = 0; i < audioSequence->sequence.numFonts; i++) { + audioSequence->sequence.fonts[i] = reader->ReadUByte(); + } +} +} // namespace Ship diff --git a/soh/soh/resource/importer/AudioSequenceFactory.h b/soh/soh/resource/importer/AudioSequenceFactory.h new file mode 100644 index 000000000..31ace1ff7 --- /dev/null +++ b/soh/soh/resource/importer/AudioSequenceFactory.h @@ -0,0 +1,18 @@ +#pragma once + +#include "Resource.h" +#include "ResourceFactory.h" + +namespace Ship { +class AudioSequenceFactory : public ResourceFactory +{ + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class AudioSequenceFactoryV0 : public ResourceVersionFactory +{ + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/AudioSoundFontFactory.cpp b/soh/soh/resource/importer/AudioSoundFontFactory.cpp new file mode 100644 index 000000000..287f680f0 --- /dev/null +++ b/soh/soh/resource/importer/AudioSoundFontFactory.cpp @@ -0,0 +1,187 @@ +#include "soh/resource/importer/AudioSoundFontFactory.h" +#include "soh/resource/type/AudioSoundFont.h" +#include "spdlog/spdlog.h" +#include "libultraship/bridge.h" + +namespace Ship { +std::shared_ptr AudioSoundFontFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 2: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load AudioSoundFont with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::AudioSoundFontFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr audioSoundFont = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, audioSoundFont); + + audioSoundFont->soundFont.fntIndex = reader->ReadInt32(); + audioSoundFont->medium = reader->ReadInt8(); + audioSoundFont->cachePolicy = reader->ReadInt8(); + + audioSoundFont->data1 = reader->ReadUInt16(); + audioSoundFont->soundFont.sampleBankId1 = audioSoundFont->data1 >> 8; + audioSoundFont->soundFont.sampleBankId2 = audioSoundFont->data1 & 0xFF; + + audioSoundFont->data2 = reader->ReadUInt16(); + audioSoundFont->data3 = reader->ReadUInt16(); + + uint32_t drumCount = reader->ReadUInt32(); + audioSoundFont->soundFont.numDrums = drumCount; + + uint32_t instrumentCount = reader->ReadUInt32(); + audioSoundFont->soundFont.numInstruments = instrumentCount; + + uint32_t soundEffectCount = reader->ReadUInt32(); + audioSoundFont->soundFont.numSfx = soundEffectCount; + + // 🥁 DRUMS 🥁 + audioSoundFont->drums.reserve(audioSoundFont->soundFont.numDrums); + audioSoundFont->drumAddresses.reserve(audioSoundFont->soundFont.numDrums); + for (uint32_t i = 0; i < audioSoundFont->soundFont.numDrums; i++) { + Drum drum; + drum.releaseRate = reader->ReadUByte(); + drum.pan = reader->ReadUByte(); + drum.loaded = reader->ReadUByte(); + drum.loaded = 0; // this was always getting set to zero in ResourceMgr_LoadAudioSoundFont + + uint32_t envelopeCount = reader->ReadUInt32(); + audioSoundFont->drumEnvelopeCounts.push_back(envelopeCount); + std::vector drumEnvelopes; + drumEnvelopes.reserve(audioSoundFont->drumEnvelopeCounts[i]); + for (uint32_t j = 0; j < audioSoundFont->drumEnvelopeCounts.back(); j++) { + AdsrEnvelope env; + + int16_t delay = reader->ReadInt16(); + int16_t arg = reader->ReadInt16(); + + env.delay = BE16SWAP(delay); + env.arg = BE16SWAP(arg); + + drumEnvelopes.push_back(env); + } + audioSoundFont->drumEnvelopeArrays.push_back(drumEnvelopes); + drum.envelope = audioSoundFont->drumEnvelopeArrays.back().data(); + + bool hasSample = reader->ReadInt8(); + std::string sampleFileName = reader->ReadString(); + drum.sound.tuning = reader->ReadFloat(); + + if (sampleFileName.empty()) { + drum.sound.sample = nullptr; + } else { + drum.sound.sample = static_cast(GetResourceDataByName(sampleFileName.c_str(), true)); + } + + audioSoundFont->drums.push_back(drum); + audioSoundFont->drumAddresses.push_back(&audioSoundFont->drums.back()); + } + audioSoundFont->soundFont.drums = audioSoundFont->drumAddresses.data(); + + // 🎺🎻🎷🎸🎹 INSTRUMENTS 🎹🎸🎷🎻🎺 + audioSoundFont->instruments.reserve(audioSoundFont->soundFont.numInstruments); + for (uint32_t i = 0; i < audioSoundFont->soundFont.numInstruments; i++) { + Instrument instrument; + + uint8_t isValidEntry = reader->ReadUByte(); + instrument.loaded = reader->ReadUByte(); + instrument.loaded = 0; // this was always getting set to zero in ResourceMgr_LoadAudioSoundFont + + instrument.normalRangeLo = reader->ReadUByte(); + instrument.normalRangeHi = reader->ReadUByte(); + instrument.releaseRate = reader->ReadUByte(); + + uint32_t envelopeCount = reader->ReadInt32(); + audioSoundFont->instrumentEnvelopeCounts.push_back(envelopeCount); + std::vector instrumentEnvelopes; + for (uint32_t j = 0; j < audioSoundFont->instrumentEnvelopeCounts.back(); j++) { + AdsrEnvelope env; + + int16_t delay = reader->ReadInt16(); + int16_t arg = reader->ReadInt16(); + + env.delay = BE16SWAP(delay); + env.arg = BE16SWAP(arg); + + instrumentEnvelopes.push_back(env); + } + audioSoundFont->instrumentEnvelopeArrays.push_back(instrumentEnvelopes); + instrument.envelope = audioSoundFont->instrumentEnvelopeArrays.back().data(); + + bool hasLowNoteSoundFontEntry = reader->ReadInt8(); + if (hasLowNoteSoundFontEntry) { + bool hasSampleRef = reader->ReadInt8(); + std::string sampleFileName = reader->ReadString(); + instrument.lowNotesSound.tuning = reader->ReadFloat(); + instrument.lowNotesSound.sample = static_cast(GetResourceDataByName(sampleFileName.c_str(), true)); + } else { + instrument.lowNotesSound.sample = nullptr; + instrument.lowNotesSound.tuning = 0; + } + + bool hasNormalNoteSoundFontEntry = reader->ReadInt8(); + if (hasNormalNoteSoundFontEntry) { + bool hasSampleRef = reader->ReadInt8(); + std::string sampleFileName = reader->ReadString(); + instrument.normalNotesSound.tuning = reader->ReadFloat(); + instrument.normalNotesSound.sample = static_cast(GetResourceDataByName(sampleFileName.c_str(), true)); + } else { + instrument.normalNotesSound.sample = nullptr; + instrument.normalNotesSound.tuning = 0; + } + + bool hasHighNoteSoundFontEntry = reader->ReadInt8(); + if (hasHighNoteSoundFontEntry) { + bool hasSampleRef = reader->ReadInt8(); + std::string sampleFileName = reader->ReadString(); + instrument.highNotesSound.tuning = reader->ReadFloat(); + instrument.highNotesSound.sample = static_cast(GetResourceDataByName(sampleFileName.c_str(), true)); + } else { + instrument.highNotesSound.sample = nullptr; + instrument.highNotesSound.tuning = 0; + } + + + audioSoundFont->instruments.push_back(instrument); + audioSoundFont->instrumentAddresses.push_back(isValidEntry ? + &audioSoundFont->instruments.back() : + nullptr); + } + audioSoundFont->soundFont.instruments = audioSoundFont->instrumentAddresses.data(); + + // 🔊 SOUND EFFECTS 🔊 + audioSoundFont->soundEffects.reserve(audioSoundFont->soundFont.numSfx); + for (uint32_t i = 0; i < audioSoundFont->soundFont.numSfx; i++) { + SoundFontSound soundEffect; + + bool hasSFEntry = reader->ReadInt8(); + if (hasSFEntry) { + bool hasSampleRef = reader->ReadInt8(); + std::string sampleFileName = reader->ReadString(); + soundEffect.tuning = reader->ReadFloat(); + soundEffect.sample = static_cast(GetResourceDataByName(sampleFileName.c_str(), true)); + } + + audioSoundFont->soundEffects.push_back(soundEffect); + } + audioSoundFont->soundFont.soundEffects = audioSoundFont->soundEffects.data(); +} +} // namespace Ship diff --git a/soh/soh/resource/importer/AudioSoundFontFactory.h b/soh/soh/resource/importer/AudioSoundFontFactory.h new file mode 100644 index 000000000..2dddee830 --- /dev/null +++ b/soh/soh/resource/importer/AudioSoundFontFactory.h @@ -0,0 +1,18 @@ +#pragma once + +#include "Resource.h" +#include "ResourceFactory.h" + +namespace Ship { +class AudioSoundFontFactory : public ResourceFactory +{ + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class AudioSoundFontFactoryV0 : public ResourceVersionFactory +{ + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/BackgroundFactory.cpp b/soh/soh/resource/importer/BackgroundFactory.cpp new file mode 100644 index 000000000..61e0ca220 --- /dev/null +++ b/soh/soh/resource/importer/BackgroundFactory.cpp @@ -0,0 +1,38 @@ +#include "soh/resource/importer/BackgroundFactory.h" +#include "soh/resource/type/Background.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr BackgroundFactory::ReadResource(uint32_t version, std::shared_ptr reader) { + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) { + SPDLOG_ERROR("Failed to load Background with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void BackgroundFactoryV0::ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) { + std::shared_ptr background = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, background); + + uint32_t dataSize = reader->ReadUInt32(); + + background->Data.reserve(dataSize); + + for (uint32_t i = 0; i < dataSize; i++) { + background->Data.push_back(reader->ReadUByte()); + } +} +} // namespace Ship diff --git a/soh/soh/resource/importer/BackgroundFactory.h b/soh/soh/resource/importer/BackgroundFactory.h new file mode 100644 index 000000000..00c67d4a2 --- /dev/null +++ b/soh/soh/resource/importer/BackgroundFactory.h @@ -0,0 +1,16 @@ +#pragma once + +#include "resource/Resource.h" +#include "resource/ResourceFactory.h" + +namespace Ship { +class BackgroundFactory : public ResourceFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class BackgroundFactoryV0 : public ResourceVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/CollisionHeaderFactory.cpp b/soh/soh/resource/importer/CollisionHeaderFactory.cpp new file mode 100644 index 000000000..d4a6a9a47 --- /dev/null +++ b/soh/soh/resource/importer/CollisionHeaderFactory.cpp @@ -0,0 +1,144 @@ +#include "soh/resource/importer/CollisionHeaderFactory.h" +#include "soh/resource/type/CollisionHeader.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr CollisionHeaderFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load Collision Header with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::CollisionHeaderFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr collisionHeader = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, collisionHeader); + + collisionHeader->collisionHeaderData.minBounds.x = reader->ReadInt16(); + collisionHeader->collisionHeaderData.minBounds.y = reader->ReadInt16(); + collisionHeader->collisionHeaderData.minBounds.z = reader->ReadInt16(); + + collisionHeader->collisionHeaderData.maxBounds.x = reader->ReadInt16(); + collisionHeader->collisionHeaderData.maxBounds.y = reader->ReadInt16(); + collisionHeader->collisionHeaderData.maxBounds.z = reader->ReadInt16(); + + collisionHeader->collisionHeaderData.numVertices = reader->ReadInt32(); + collisionHeader->vertices.reserve(collisionHeader->collisionHeaderData.numVertices); + for (int32_t i = 0; i < collisionHeader->collisionHeaderData.numVertices; i++) { + Vec3s vtx; + vtx.x = reader->ReadInt16(); + vtx.y = reader->ReadInt16(); + vtx.z = reader->ReadInt16(); + collisionHeader->vertices.push_back(vtx); + } + collisionHeader->collisionHeaderData.vtxList = collisionHeader->vertices.data(); + + collisionHeader->collisionHeaderData.numPolygons = reader->ReadUInt32(); + collisionHeader->polygons.reserve(collisionHeader->collisionHeaderData.numPolygons); + for (uint32_t i = 0; i < collisionHeader->collisionHeaderData.numPolygons; i++) { + CollisionPoly polygon; + + polygon.type = reader->ReadUInt16(); + + polygon.flags_vIA = reader->ReadUInt16(); + polygon.flags_vIB = reader->ReadUInt16(); + polygon.vIC = reader->ReadUInt16(); + + polygon.normal.x = reader->ReadUInt16(); + polygon.normal.y = reader->ReadUInt16(); + polygon.normal.z = reader->ReadUInt16(); + + polygon.dist = reader->ReadUInt16(); + + collisionHeader->polygons.push_back(polygon); + + } + collisionHeader->collisionHeaderData.polyList = collisionHeader->polygons.data(); + + collisionHeader->surfaceTypesCount = reader->ReadUInt32(); + collisionHeader->surfaceTypes.reserve(collisionHeader->surfaceTypesCount); + for (uint32_t i = 0; i < collisionHeader->surfaceTypesCount; i++) { + SurfaceType surfaceType; + + surfaceType.data[1] = reader->ReadUInt32(); + surfaceType.data[0] = reader->ReadUInt32(); + + collisionHeader->surfaceTypes.push_back(surfaceType); + } + collisionHeader->collisionHeaderData.surfaceTypeList = collisionHeader->surfaceTypes.data(); + + collisionHeader->camDataCount = reader->ReadUInt32(); + collisionHeader->camData.reserve(collisionHeader->camDataCount); + collisionHeader->camPosDataIndices.reserve(collisionHeader->camDataCount); + for (uint32_t i = 0; i < collisionHeader->camDataCount; i++) { + CamData camDataEntry; + camDataEntry.cameraSType = reader->ReadUInt16(); + camDataEntry.numCameras = reader->ReadInt16(); + collisionHeader->camData.push_back(camDataEntry); + + int32_t camPosDataIdx = reader->ReadInt32(); + collisionHeader->camPosDataIndices.push_back(camPosDataIdx); + } + + collisionHeader->camPosCount = reader->ReadInt32(); + collisionHeader->camPosData.reserve(collisionHeader->camPosCount); + for (int32_t i = 0; i < collisionHeader->camPosCount; i++) { + Vec3s pos; + pos.x = reader->ReadInt16(); + pos.y = reader->ReadInt16(); + pos.z = reader->ReadInt16(); + collisionHeader->camPosData.push_back(pos); + } + + Vec3s zero; + zero.x = 0; + zero.y = 0; + zero.z = 0; + collisionHeader->camPosDataZero = zero; + + for (size_t i = 0; i < collisionHeader->camDataCount; i++) { + int32_t idx = collisionHeader->camPosDataIndices[i]; + + if (collisionHeader->camPosCount > 0) { + collisionHeader->camData[i].camPosData = &collisionHeader->camPosData[idx]; + } else { + collisionHeader->camData[i].camPosData = &collisionHeader->camPosDataZero; + } + } + collisionHeader->collisionHeaderData.cameraDataList = collisionHeader->camData.data(); + collisionHeader->collisionHeaderData.cameraDataListLen = collisionHeader->camDataCount; + + collisionHeader->collisionHeaderData.numWaterBoxes = reader->ReadInt32(); + collisionHeader->waterBoxes.reserve(collisionHeader->collisionHeaderData.numWaterBoxes); + for (int32_t i = 0; i < collisionHeader->collisionHeaderData.numWaterBoxes; i++) { + WaterBox waterBox; + waterBox.xMin = reader->ReadInt16(); + waterBox.ySurface = reader->ReadInt16(); + waterBox.zMin = reader->ReadInt16(); + waterBox.xLength = reader->ReadInt16(); + waterBox.zLength = reader->ReadInt16(); + waterBox.properties = reader->ReadInt32(); + + collisionHeader->waterBoxes.push_back(waterBox); + } + collisionHeader->collisionHeaderData.waterBoxes = collisionHeader->waterBoxes.data(); +} +} diff --git a/soh/soh/resource/importer/CollisionHeaderFactory.h b/soh/soh/resource/importer/CollisionHeaderFactory.h new file mode 100644 index 000000000..3247036a9 --- /dev/null +++ b/soh/soh/resource/importer/CollisionHeaderFactory.h @@ -0,0 +1,16 @@ +#pragma once + +#include "Resource.h" +#include "ResourceFactory.h" + +namespace Ship { +class CollisionHeaderFactory : public ResourceFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class CollisionHeaderFactoryV0 : public ResourceVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/CutsceneFactory.cpp b/soh/soh/resource/importer/CutsceneFactory.cpp new file mode 100644 index 000000000..d837259f6 --- /dev/null +++ b/soh/soh/resource/importer/CutsceneFactory.cpp @@ -0,0 +1,473 @@ +#include "soh/resource/importer/CutsceneFactory.h" +#include "soh/resource/type/Cutscene.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr CutsceneFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load Cutscene with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +static inline uint32_t read_CMD_BBBB(std::shared_ptr reader) { + uint32_t v; + reader->Read((char*)&v, sizeof(uint32_t)); + + return v; +} + +static inline uint32_t read_CMD_BBH(std::shared_ptr reader) { + uint32_t v; + reader->Read((char*)&v, sizeof(uint32_t)); + + // swap the half word to match endianness + if (reader->GetEndianness() != Ship::Endianness::Native) { + uint8_t* b = (uint8_t*)&v; + uint8_t tmp = b[2]; + b[2] = b[3]; + b[3] = tmp; + } + + return v; +} + +static inline uint32_t read_CMD_HBB(std::shared_ptr reader) { + uint32_t v; + reader->Read((char*)&v, sizeof(uint32_t)); + + // swap the half word to match endianness + if (reader->GetEndianness() != Ship::Endianness::Native) { + uint8_t* b = (uint8_t*)&v; + uint8_t tmp = b[0]; + b[0] = b[1]; + b[1] = tmp; + } + + return v; +} + +static inline uint32_t read_CMD_HH(std::shared_ptr reader) { + uint32_t v; + reader->Read((char*)&v, sizeof(uint32_t)); + + // swap the half words to match endianness + if (reader->GetEndianness() != Ship::Endianness::Native) { + uint8_t* b = (uint8_t*)&v; + uint8_t tmp = b[0]; + b[0] = b[1]; + b[1] = tmp; + tmp = b[2]; + b[2] = b[3]; + b[3] = tmp; + } + + return v; +} + +void Ship::CutsceneFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr cutscene = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, cutscene); + + uint32_t numEntries = reader->ReadUInt32(); + cutscene->commands.reserve(numEntries); + + cutscene->numCommands = reader->ReadUInt32(); + cutscene->commands.push_back(cutscene->numCommands); + + cutscene->endFrame = reader->ReadUInt32(); + cutscene->commands.push_back(cutscene->endFrame); + + while (true) { + uint32_t commandId = reader->ReadUInt32(); + cutscene->commands.push_back(commandId); + + switch (commandId) { + case (uint32_t)CutsceneCommands::SetCameraPos: { + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + + while (true) { + uint32_t val = read_CMD_BBH(reader); + int8_t continueFlag = ((int8_t*)&val)[0]; + + cutscene->commands.push_back(val); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + + if (continueFlag == -1) { + break; + } + } + } break; + case (uint32_t)CutsceneCommands::SetCameraFocus: { + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + + while (true) { + uint32_t val = read_CMD_BBH(reader); + int8_t continueFlag = ((int8_t*)&val)[0]; + + cutscene->commands.push_back(val); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + + if (continueFlag == -1) { + break; + } + } + break; + } + case (uint32_t)CutsceneCommands::SpecialAction: { + uint32_t size = reader->ReadUInt32(); + cutscene->commands.push_back(size); + + for (uint32_t i = 0; i < size; i++) { + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + } + break; + } + case (uint32_t)CutsceneCommands::SetLighting: { + uint32_t size = reader->ReadUInt32(); + cutscene->commands.push_back(size); + + for (uint32_t i = 0; i < size; i++) { + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + } + break; + } + case (uint32_t)CutsceneCommands::SetCameraPosLink: { + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + + while (true) { + uint32_t val = read_CMD_BBH(reader); + int8_t continueFlag = ((int8_t*)&val)[0]; + + cutscene->commands.push_back(val); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + + if (continueFlag == -1) { + break; + } + } + break; + } + case (uint32_t)CutsceneCommands::SetCameraFocusLink: { + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + + while (true) { + uint32_t val = read_CMD_BBH(reader); + int8_t continueFlag = ((int8_t*)&val)[0]; + + cutscene->commands.push_back(val); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + + if (continueFlag == -1) { + break; + } + } + break; + } + case (uint32_t)CutsceneCommands::Cmd09: { + uint32_t size = reader->ReadUInt32(); + cutscene->commands.push_back(size); + + for (uint32_t i = 0; i < size; i++) { + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HBB(reader)); + cutscene->commands.push_back(read_CMD_BBH(reader)); + } + break; + } + case 0x15: + case (uint32_t)CutsceneCommands::Unknown: { + uint32_t size = reader->ReadUInt32(); + cutscene->commands.push_back(size); + + for (uint32_t i = 0; i < size; i++) { + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + } + } break; + case (uint32_t)CutsceneCommands::Textbox: { + uint32_t size = reader->ReadUInt32(); + cutscene->commands.push_back(size); + + for (uint32_t i = 0; i < size; i++) { + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + } + break; + } + case (uint32_t)CutsceneCommands::SetActorAction0: + case (uint32_t)CutsceneCommands::SetActorAction1: + case 17: + case 18: + case 23: + case 34: + case 39: + case 46: + case 76: + case 85: + case 93: + case 105: + case 107: + case 110: + case 119: + case 123: + case 138: + case 139: + case 144: + case (uint32_t)CutsceneCommands::SetActorAction2: + case 16: + case 24: + case 35: + case 40: + case 48: + case 64: + case 68: + case 70: + case 78: + case 80: + case 94: + case 116: + case 118: + case 120: + case 125: + case 131: + case 141: + case (uint32_t)CutsceneCommands::SetActorAction3: + case 36: + case 41: + case 50: + case 67: + case 69: + case 72: + case 74: + case 81: + case 106: + case 117: + case 121: + case 126: + case 132: + case (uint32_t)CutsceneCommands::SetActorAction4: + case 37: + case 42: + case 51: + case 53: + case 63: + case 65: + case 66: + case 75: + case 82: + case 108: + case 127: + case 133: + case (uint32_t)CutsceneCommands::SetActorAction5: + case 38: + case 43: + case 47: + case 54: + case 79: + case 83: + case 128: + case 135: + case (uint32_t)CutsceneCommands::SetActorAction6: + case 55: + case 77: + case 84: + case 90: + case 129: + case 136: + case (uint32_t)CutsceneCommands::SetActorAction7: + case 52: + case 57: + case 58: + case 88: + case 115: + case 130: + case 137: + case (uint32_t)CutsceneCommands::SetActorAction8: + case 60: + case 89: + case 111: + case 114: + case 134: + case 142: + case (uint32_t)CutsceneCommands::SetActorAction9: + case (uint32_t)CutsceneCommands::SetActorAction10: { + uint32_t size = reader->ReadUInt32(); + cutscene->commands.push_back(size); + + for (uint32_t i = 0; i < size; i++) { + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + } + + break; + } + case (uint32_t)CutsceneCommands::SetSceneTransFX: { + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + break; + } + case (uint32_t)CutsceneCommands::PlayBGM: { + uint32_t size = reader->ReadUInt32(); + cutscene->commands.push_back(size); + + for (uint32_t i = 0; i < size; i++) { + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + } + break; + } + case (uint32_t)CutsceneCommands::StopBGM: { + uint32_t size = reader->ReadUInt32(); + cutscene->commands.push_back(size); + + for (uint32_t i = 0; i < size; i++) { + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + } + break; + } + case (uint32_t)CutsceneCommands::FadeBGM: { + uint32_t size = reader->ReadUInt32(); + cutscene->commands.push_back(size); + + for (uint32_t i = 0; i < size; i++) { + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(reader->ReadUInt32()); + } + break; + } + case (uint32_t)CutsceneCommands::SetTime: { + uint32_t size = reader->ReadUInt32(); + cutscene->commands.push_back(size); + + for (uint32_t i = 0; i < size; i++) { + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HBB(reader)); + cutscene->commands.push_back(reader->ReadUInt32()); + } + break; + } + case (uint32_t)CutsceneCommands::Terminator: { + cutscene->commands.push_back(reader->ReadUInt32()); + cutscene->commands.push_back(read_CMD_HH(reader)); + cutscene->commands.push_back(read_CMD_HH(reader)); + break; + } + case 0xFFFFFFFF: // CS_END + { + cutscene->commands.push_back(reader->ReadUInt32()); + return; + } + default: + SPDLOG_TRACE("CutsceneV0: Unknown command {}\n", commandId); + // error? + break; + } + } +} +} // namespace Ship diff --git a/soh/soh/resource/importer/CutsceneFactory.h b/soh/soh/resource/importer/CutsceneFactory.h new file mode 100644 index 000000000..e1ec1cded --- /dev/null +++ b/soh/soh/resource/importer/CutsceneFactory.h @@ -0,0 +1,18 @@ +#pragma once + +#include "Resource.h" +#include "ResourceFactory.h" + +namespace Ship { +class CutsceneFactory : public ResourceFactory +{ + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class CutsceneFactoryV0 : public ResourceVersionFactory +{ + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/PathFactory.cpp b/soh/soh/resource/importer/PathFactory.cpp new file mode 100644 index 000000000..aac6d8b3f --- /dev/null +++ b/soh/soh/resource/importer/PathFactory.cpp @@ -0,0 +1,59 @@ +#include "soh/resource/importer/PathFactory.h" +#include "soh/resource/type/Path.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr PathFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load Path with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::PathFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr path = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, path); + + path->numPaths = reader->ReadUInt32(); + path->paths.reserve(path->numPaths); + for (uint32_t k = 0; k < path->numPaths; k++) { + std::vector points; + uint32_t pointCount = reader->ReadUInt32(); + points.reserve(pointCount); + for (uint32_t i = 0; i < pointCount; i++) { + Vec3s point; + point.x = reader->ReadInt16(); + point.y = reader->ReadInt16(); + point.z = reader->ReadInt16(); + + points.push_back(point); + } + + PathData pathDataEntry; + pathDataEntry.count = pointCount; + + path->paths.push_back(points); + pathDataEntry.points = path->paths.back().data(); + + path->pathData.push_back(pathDataEntry); + } +} +} // namespace Ship diff --git a/soh/soh/resource/importer/PathFactory.h b/soh/soh/resource/importer/PathFactory.h new file mode 100644 index 000000000..937b6fb13 --- /dev/null +++ b/soh/soh/resource/importer/PathFactory.h @@ -0,0 +1,18 @@ +#pragma once + +#include "Resource.h" +#include "ResourceFactory.h" + +namespace Ship { +class PathFactory : public ResourceFactory +{ + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class PathFactoryV0 : public ResourceVersionFactory +{ + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/PlayerAnimationFactory.cpp b/soh/soh/resource/importer/PlayerAnimationFactory.cpp new file mode 100644 index 000000000..51adfa2ce --- /dev/null +++ b/soh/soh/resource/importer/PlayerAnimationFactory.cpp @@ -0,0 +1,42 @@ +#include "soh/resource/importer/PlayerAnimationFactory.h" +#include "soh/resource/type/PlayerAnimation.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr PlayerAnimationFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load PlayerAnimation with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::PlayerAnimationFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr playerAnimation = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, playerAnimation); + + uint32_t numEntries = reader->ReadUInt32(); + playerAnimation->limbRotData.reserve(numEntries); + + for (uint32_t i = 0; i < numEntries; i++) { + playerAnimation->limbRotData.push_back(reader->ReadInt16()); + } +} +} // namespace Ship diff --git a/soh/soh/resource/importer/PlayerAnimationFactory.h b/soh/soh/resource/importer/PlayerAnimationFactory.h new file mode 100644 index 000000000..d55cd5cef --- /dev/null +++ b/soh/soh/resource/importer/PlayerAnimationFactory.h @@ -0,0 +1,16 @@ +#pragma once + +#include "Resource.h" +#include "ResourceFactory.h" + +namespace Ship { +class PlayerAnimationFactory : public ResourceFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class PlayerAnimationFactoryV0 : public ResourceVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/SceneFactory.cpp b/soh/soh/resource/importer/SceneFactory.cpp new file mode 100644 index 000000000..c4fdf8b82 --- /dev/null +++ b/soh/soh/resource/importer/SceneFactory.cpp @@ -0,0 +1,118 @@ +#include "spdlog/spdlog.h" +#include "soh/resource/importer/SceneFactory.h" +#include "soh/resource/type/Scene.h" +#include "soh/resource/type/scenecommand/SceneCommand.h" +#include "soh/resource/importer/scenecommand/SetLightingSettingsFactory.h" +#include "soh/resource/importer/scenecommand/SetWindSettingsFactory.h" +#include "soh/resource/importer/scenecommand/SetExitListFactory.h" +#include "soh/resource/importer/scenecommand/SetTimeSettingsFactory.h" +#include "soh/resource/importer/scenecommand/SetSkyboxModifierFactory.h" +#include "soh/resource/importer/scenecommand/SetEchoSettingsFactory.h" +#include "soh/resource/importer/scenecommand/SetSoundSettingsFactory.h" +#include "soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.h" +#include "soh/resource/importer/scenecommand/SetRoomBehaviorFactory.h" +#include "soh/resource/importer/scenecommand/SetCsCameraFactory.h" +#include "soh/resource/importer/scenecommand/SetCameraSettingsFactory.h" +#include "soh/resource/importer/scenecommand/SetRoomListFactory.h" +#include "soh/resource/importer/scenecommand/SetCollisionHeaderFactory.h" +#include "soh/resource/importer/scenecommand/SetEntranceListFactory.h" +#include "soh/resource/importer/scenecommand/SetSpecialObjectsFactory.h" +#include "soh/resource/importer/scenecommand/SetObjectListFactory.h" +#include "soh/resource/importer/scenecommand/SetStartPositionListFactory.h" +#include "soh/resource/importer/scenecommand/SetActorListFactory.h" +#include "soh/resource/importer/scenecommand/SetTransitionActorListFactory.h" +#include "soh/resource/importer/scenecommand/EndMarkerFactory.h" +#include "soh/resource/importer/scenecommand/SetAlternateHeadersFactory.h" +#include "soh/resource/importer/scenecommand/SetPathwaysFactory.h" +#include "soh/resource/importer/scenecommand/SetCutscenesFactory.h" +#include "soh/resource/importer/scenecommand/SetLightListFactory.h" +#include "soh/resource/importer/scenecommand/SetMeshFactory.h" + +namespace Ship { + +std::shared_ptr SceneFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + if (SceneFactory::sceneCommandFactories.empty()) { + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetLightingSettings] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetWind] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetExitList] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetTimeSettings] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetSkyboxModifier] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetEchoSettings] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetSoundSettings] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetSkyboxSettings] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetRoomBehavior] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetCsCamera] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetCameraSettings] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetRoomList] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetCollisionHeader] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetEntranceList] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetSpecialObjects] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetObjectList] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetStartPositionList] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetActorList] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetTransitionActorList] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::EndMarker] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetAlternateHeaders] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetPathways] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetCutscenes] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetLightList] = std::make_shared(); + SceneFactory::sceneCommandFactories[Ship::SceneCommandID::SetMesh] = std::make_shared(); + } + + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + resource->ResourceVersion = version; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load Scene with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void SceneFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr scene = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, scene); + + uint32_t commandCount = reader->ReadUInt32(); + scene->commands.reserve(commandCount); + + for (uint32_t i = 0; i < commandCount; i++) { + scene->commands.push_back(ParseSceneCommand(resource->ResourceVersion, reader)); + } +} + +std::shared_ptr SceneFactoryV0::ParseSceneCommand(uint32_t version, std::shared_ptr reader) { + SceneCommandID cmdID = (SceneCommandID)reader->ReadInt32(); + + reader->Seek(-sizeof(int32_t), SeekOffsetType::Current); + + std::shared_ptr result = nullptr; + std::shared_ptr commandFactory = SceneFactory::sceneCommandFactories[cmdID]; + + if (commandFactory != nullptr) { + result = std::static_pointer_cast(commandFactory->ReadResource(version, reader)); + } + + if (result == nullptr) { + SPDLOG_ERROR("Failed to load scene command of type {}", (uint32_t)cmdID); + } + + return result; +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/SceneFactory.h b/soh/soh/resource/importer/SceneFactory.h new file mode 100644 index 000000000..ec75a20bf --- /dev/null +++ b/soh/soh/resource/importer/SceneFactory.h @@ -0,0 +1,26 @@ +#pragma once + +#include "soh/resource/type/Scene.h" +#include "soh/resource/type/scenecommand/SceneCommand.h" +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" +#include "Resource.h" +#include "ResourceFactory.h" + +namespace Ship { +class SceneFactory : public ResourceFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); + + // Doing something very similar to what we do on the ResourceLoader. + // Eventually, scene commands should be moved up to the ResourceLoader as well. + // They can not right now because the exporter does not give them a proper resource type enum value, + // and the exporter does not export the commands with a proper OTR header. + static inline std::unordered_map> sceneCommandFactories; +}; + +class SceneFactoryV0 : public ResourceVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; + std::shared_ptr ParseSceneCommand(uint32_t version, std::shared_ptr reader); +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/SkeletonFactory.cpp b/soh/soh/resource/importer/SkeletonFactory.cpp new file mode 100644 index 000000000..315a5201d --- /dev/null +++ b/soh/soh/resource/importer/SkeletonFactory.cpp @@ -0,0 +1,81 @@ +#include "soh/resource/importer/SkeletonFactory.h" +#include "soh/resource/type/Skeleton.h" +#include +#include + +namespace Ship { +std::shared_ptr SkeletonFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load Skeleton with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void SkeletonFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr skeleton = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, skeleton); + + skeleton->type = (SkeletonType)reader->ReadInt8(); + skeleton->limbType = (LimbType)reader->ReadInt8(); + skeleton->limbCount = reader->ReadUInt32(); + skeleton->dListCount = reader->ReadUInt32(); + skeleton->limbTableType = (LimbType)reader->ReadInt8(); + skeleton->limbTableCount = reader->ReadUInt32(); + + skeleton->limbTable.reserve(skeleton->limbTableCount); + for (uint32_t i = 0; i < skeleton->limbTableCount; i++) { + std::string limbPath = reader->ReadString(); + + skeleton->limbTable.push_back(limbPath); + } + + if (skeleton->type == Ship::SkeletonType::Curve) { + skeleton->skeletonData.skelCurveLimbList.limbCount = skeleton->limbCount; + skeleton->curveLimbArray.reserve(skeleton->skeletonData.skelCurveLimbList.limbCount); + } else if (skeleton->type == Ship::SkeletonType::Flex) { + skeleton->skeletonData.flexSkeletonHeader.dListCount = skeleton->dListCount; + } + + if (skeleton->type == Ship::SkeletonType::Normal) { + skeleton->skeletonData.skeletonHeader.limbCount = skeleton->limbCount; + skeleton->standardLimbArray.reserve(skeleton->skeletonData.skeletonHeader.limbCount); + } else if (skeleton->type == Ship::SkeletonType::Flex) { + skeleton->skeletonData.flexSkeletonHeader.sh.limbCount = skeleton->limbCount; + skeleton->standardLimbArray.reserve(skeleton->skeletonData.flexSkeletonHeader.sh.limbCount); + } + + for (size_t i = 0; i < skeleton->limbTable.size(); i++) { + std::string limbStr = skeleton->limbTable[i]; + auto limb = GetResourceDataByName(limbStr.c_str(), true); + skeleton->skeletonHeaderSegments.push_back(limb); + } + + if (skeleton->type == Ship::SkeletonType::Normal) { + skeleton->skeletonData.skeletonHeader.segment = (void**)skeleton->skeletonHeaderSegments.data(); + } else if (skeleton->type == Ship::SkeletonType::Flex) { + skeleton->skeletonData.flexSkeletonHeader.sh.segment = (void**)skeleton->skeletonHeaderSegments.data(); + } else if (skeleton->type == Ship::SkeletonType::Curve) { + skeleton->skeletonData.skelCurveLimbList.limbs = (SkelCurveLimb**)skeleton->skeletonHeaderSegments.data(); + } else { + SPDLOG_ERROR("unknown skeleton type {}", (uint32_t)skeleton->type); + } +} +} // namespace Ship diff --git a/soh/soh/resource/importer/SkeletonFactory.h b/soh/soh/resource/importer/SkeletonFactory.h new file mode 100644 index 000000000..fc80011ed --- /dev/null +++ b/soh/soh/resource/importer/SkeletonFactory.h @@ -0,0 +1,18 @@ +#pragma once + +#include "Resource.h" +#include "ResourceFactory.h" + +namespace Ship { +class SkeletonFactory : public ResourceFactory +{ + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SkeletonFactoryV0 : public ResourceVersionFactory +{ + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/SkeletonLimbFactory.cpp b/soh/soh/resource/importer/SkeletonLimbFactory.cpp new file mode 100644 index 000000000..9975d9bc3 --- /dev/null +++ b/soh/soh/resource/importer/SkeletonLimbFactory.cpp @@ -0,0 +1,195 @@ +#include "soh/resource/importer/SkeletonLimbFactory.h" +#include "soh/resource/type/SkeletonLimb.h" +#include "spdlog/spdlog.h" +#include "libultraship/bridge.h" + +namespace Ship { +std::shared_ptr SkeletonLimbFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load Skeleton Limb with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SkeletonLimbFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr skeletonLimb = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, skeletonLimb); + + skeletonLimb->limbType = (LimbType)reader->ReadInt8(); + skeletonLimb->skinSegmentType = (ZLimbSkinType)reader->ReadInt8(); + skeletonLimb->skinDList = reader->ReadString(); + + skeletonLimb->skinVtxCnt = reader->ReadUInt16(); + + skeletonLimb->skinLimbModifCount = reader->ReadUInt32(); + skeletonLimb->skinLimbModifArray.reserve(skeletonLimb->skinLimbModifCount); + skeletonLimb->skinLimbModifVertexArrays.reserve(skeletonLimb->skinLimbModifCount); + skeletonLimb->skinLimbModifTransformationArrays.reserve(skeletonLimb->skinLimbModifCount); + for (size_t i = 0; i < skeletonLimb->skinLimbModifCount; i++) { + SkinLimbModif skinLimbModif; + skinLimbModif.unk_4 = reader->ReadUInt16(); + skeletonLimb->skinLimbModifArray.push_back(skinLimbModif); + + std::vector skinVertexArray; + int32_t skinVertexCount = reader->ReadInt32(); + skinVertexArray.reserve(skinVertexCount); + for (int32_t k = 0; k < skinVertexCount; k++) { + SkinVertex skinVertex; + + skinVertex.index = reader->ReadInt16(); + skinVertex.s = reader->ReadInt16(); + skinVertex.t = reader->ReadInt16(); + skinVertex.normX = reader->ReadInt8(); + skinVertex.normY = reader->ReadInt8(); + skinVertex.normZ = reader->ReadInt8(); + skinVertex.alpha = reader->ReadUByte(); + + skinVertexArray.push_back(skinVertex); + } + skeletonLimb->skinLimbModifVertexArrays.push_back(skinVertexArray); + + std::vector skinTransformationArray; + int32_t skinTransformationCount = reader->ReadInt32(); + skinTransformationArray.reserve(skinTransformationCount); + for (int32_t k = 0; k < skinTransformationCount; k++) { + SkinTransformation skinTransformation; + + skinTransformation.limbIndex = reader->ReadUByte(); + skinTransformation.x = reader->ReadInt16(); + skinTransformation.y = reader->ReadInt16(); + skinTransformation.z = reader->ReadInt16(); + skinTransformation.scale = reader->ReadUByte(); + + skinTransformationArray.push_back(skinTransformation); + } + skeletonLimb->skinLimbModifTransformationArrays.push_back(skinTransformationArray); + } + + skeletonLimb->skinDList2 = reader->ReadString(); + + skeletonLimb->legTransX = reader->ReadFloat(); + skeletonLimb->legTransY = reader->ReadFloat(); + skeletonLimb->legTransZ = reader->ReadFloat(); + + skeletonLimb->rotX = reader->ReadUInt16(); + skeletonLimb->rotY = reader->ReadUInt16(); + skeletonLimb->rotZ = reader->ReadUInt16(); + + skeletonLimb->childPtr = reader->ReadString(); + skeletonLimb->siblingPtr = reader->ReadString(); + skeletonLimb->dListPtr = reader->ReadString(); + skeletonLimb->dList2Ptr = reader->ReadString(); + + skeletonLimb->transX = reader->ReadInt16(); + skeletonLimb->transY = reader->ReadInt16(); + skeletonLimb->transZ = reader->ReadInt16(); + + skeletonLimb->childIndex = reader->ReadUByte(); + skeletonLimb->siblingIndex = reader->ReadUByte(); + + if (skeletonLimb->limbType == Ship::LimbType::LOD) { + skeletonLimb->limbData.lodLimb.jointPos.x = skeletonLimb->transX; + skeletonLimb->limbData.lodLimb.jointPos.y = skeletonLimb->transY; + skeletonLimb->limbData.lodLimb.jointPos.z = skeletonLimb->transZ; + skeletonLimb->limbData.lodLimb.child = skeletonLimb->childIndex; + skeletonLimb->limbData.lodLimb.sibling = skeletonLimb->siblingIndex; + + if (skeletonLimb->dListPtr != "") { + auto dList = GetResourceDataByName(skeletonLimb->dListPtr.c_str(), true); + skeletonLimb->limbData.lodLimb.dLists[0] = (Gfx*)dList; + } else { + skeletonLimb->limbData.lodLimb.dLists[0] = nullptr; + } + + if (skeletonLimb->dList2Ptr != "") { + auto dList = GetResourceDataByName(skeletonLimb->dList2Ptr.c_str(), true); + skeletonLimb->limbData.lodLimb.dLists[1] = (Gfx*)dList; + } else { + skeletonLimb->limbData.lodLimb.dLists[1] = nullptr; + } + } else if (skeletonLimb->limbType == Ship::LimbType::Standard) { + skeletonLimb->limbData.standardLimb.jointPos.x = skeletonLimb->transX; + skeletonLimb->limbData.standardLimb.jointPos.y = skeletonLimb->transY; + skeletonLimb->limbData.standardLimb.jointPos.z = skeletonLimb->transZ; + skeletonLimb->limbData.standardLimb.child = skeletonLimb->childIndex; + skeletonLimb->limbData.standardLimb.sibling = skeletonLimb->siblingIndex; + skeletonLimb->limbData.standardLimb.dList = nullptr; + + if (!skeletonLimb->dListPtr.empty()) { + const auto dList = GetResourceDataByName(skeletonLimb->dListPtr.c_str(), true); + skeletonLimb->limbData.standardLimb.dList = (Gfx*)dList; + } + } else if (skeletonLimb->limbType == Ship::LimbType::Curve) { + skeletonLimb->limbData.skelCurveLimb.firstChildIdx = skeletonLimb->childIndex; + skeletonLimb->limbData.skelCurveLimb.nextLimbIdx = skeletonLimb->siblingIndex; + skeletonLimb->limbData.skelCurveLimb.dList[0] = nullptr; + skeletonLimb->limbData.skelCurveLimb.dList[1] = nullptr; + + if (!skeletonLimb->dListPtr.empty()) { + const auto dList = GetResourceDataByName(skeletonLimb->dListPtr.c_str(), true); + skeletonLimb->limbData.skelCurveLimb.dList[0] = (Gfx*)dList; + } + + if (!skeletonLimb->dList2Ptr.empty()) { + const auto dList = GetResourceDataByName(skeletonLimb->dList2Ptr.c_str(), true); + skeletonLimb->limbData.skelCurveLimb.dList[1] = (Gfx*)dList; + } + } else if (skeletonLimb->limbType == Ship::LimbType::Skin) { + skeletonLimb->limbData.skinLimb.jointPos.x = skeletonLimb->transX; + skeletonLimb->limbData.skinLimb.jointPos.y = skeletonLimb->transY; + skeletonLimb->limbData.skinLimb.jointPos.z = skeletonLimb->transZ; + skeletonLimb->limbData.skinLimb.child = skeletonLimb->childIndex; + skeletonLimb->limbData.skinLimb.sibling = skeletonLimb->siblingIndex; + + if (skeletonLimb->skinSegmentType == Ship::ZLimbSkinType::SkinType_DList) { + skeletonLimb->limbData.skinLimb.segmentType = static_cast(skeletonLimb->skinSegmentType); + } else if (skeletonLimb->skinSegmentType == Ship::ZLimbSkinType::SkinType_4) { + skeletonLimb->limbData.skinLimb.segmentType = 4; + } else if (skeletonLimb->skinSegmentType == Ship::ZLimbSkinType::SkinType_5) { + skeletonLimb->limbData.skinLimb.segmentType = 5; + } else { + skeletonLimb->limbData.skinLimb.segmentType = 0; + } + + if (skeletonLimb->skinSegmentType == Ship::ZLimbSkinType::SkinType_DList) { + skeletonLimb->limbData.skinLimb.segment = GetResourceDataByName(skeletonLimb->skinDList.c_str(), true); + } else if (skeletonLimb->skinSegmentType == Ship::ZLimbSkinType::SkinType_4) { + skeletonLimb->skinAnimLimbData.totalVtxCount = skeletonLimb->skinVtxCnt; + skeletonLimb->skinAnimLimbData.limbModifCount = skeletonLimb->skinLimbModifCount; + skeletonLimb->skinAnimLimbData.limbModifications = skeletonLimb->skinLimbModifArray.data(); + skeletonLimb->skinAnimLimbData.dlist = (Gfx*)GetResourceDataByName(skeletonLimb->skinDList2.c_str(), true); + + for (size_t i = 0; i < skeletonLimb->skinLimbModifArray.size(); i++) + { + skeletonLimb->skinAnimLimbData.limbModifications[i].vtxCount = skeletonLimb->skinLimbModifVertexArrays[i].size(); + skeletonLimb->skinAnimLimbData.limbModifications[i].skinVertices = skeletonLimb->skinLimbModifVertexArrays[i].data(); + + skeletonLimb->skinAnimLimbData.limbModifications[i].transformCount = skeletonLimb->skinLimbModifTransformationArrays[i].size(); + skeletonLimb->skinAnimLimbData.limbModifications[i].limbTransformations = skeletonLimb->skinLimbModifTransformationArrays[i].data(); + + skeletonLimb->skinAnimLimbData.limbModifications[i].unk_4 = skeletonLimb->skinLimbModifArray[i].unk_4; + } + + skeletonLimb->limbData.skinLimb.segment = &skeletonLimb->skinAnimLimbData; + } + } +} +} // namespace Ship diff --git a/soh/soh/resource/importer/SkeletonLimbFactory.h b/soh/soh/resource/importer/SkeletonLimbFactory.h new file mode 100644 index 000000000..c10a45bbe --- /dev/null +++ b/soh/soh/resource/importer/SkeletonLimbFactory.h @@ -0,0 +1,18 @@ +#pragma once + +#include "Resource.h" +#include "ResourceFactory.h" + +namespace Ship { +class SkeletonLimbFactory : public ResourceFactory +{ + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SkeletonLimbFactoryV0 : public ResourceVersionFactory +{ + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/TextFactory.cpp b/soh/soh/resource/importer/TextFactory.cpp new file mode 100644 index 000000000..b6a465350 --- /dev/null +++ b/soh/soh/resource/importer/TextFactory.cpp @@ -0,0 +1,52 @@ +#include "soh/resource/importer/TextFactory.h" +#include "soh/resource/type/Text.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr TextFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + default: + // VERSION NOT SUPPORTED + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load Text with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::TextFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr text = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, text); + + uint32_t msgCount = reader->ReadUInt32(); + text->messages.reserve(msgCount); + + for (uint32_t i = 0; i < msgCount; i++) + { + MessageEntry entry; + entry.id = reader->ReadUInt16(); + entry.textboxType = reader->ReadUByte(); + entry.textboxYPos = reader->ReadUByte(); + entry.msg = reader->ReadString(); + + text->messages.push_back(entry); + } +} +} // namespace Ship diff --git a/soh/soh/resource/importer/TextFactory.h b/soh/soh/resource/importer/TextFactory.h new file mode 100644 index 000000000..7ba79dbeb --- /dev/null +++ b/soh/soh/resource/importer/TextFactory.h @@ -0,0 +1,18 @@ +#pragma once + +#include "Resource.h" +#include "ResourceFactory.h" + +namespace Ship { +class TextFactory : public ResourceFactory +{ + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class TextFactoryV0 : public ResourceVersionFactory +{ + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/EndMarkerFactory.cpp b/soh/soh/resource/importer/scenecommand/EndMarkerFactory.cpp new file mode 100644 index 000000000..a9b99b101 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/EndMarkerFactory.cpp @@ -0,0 +1,40 @@ +#include "soh/resource/importer/scenecommand/EndMarkerFactory.h" +#include "soh/resource/type/scenecommand/EndMarker.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr EndMarkerFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load EndMarker with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::EndMarkerFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr endMarker = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, endMarker); + + ReadCommandId(endMarker, reader); + + // This has no data. +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/EndMarkerFactory.h b/soh/soh/resource/importer/scenecommand/EndMarkerFactory.h new file mode 100644 index 000000000..0340e34ed --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/EndMarkerFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class EndMarkerFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class EndMarkerFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SceneCommandFactory.cpp b/soh/soh/resource/importer/scenecommand/SceneCommandFactory.cpp new file mode 100644 index 000000000..6da03e131 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SceneCommandFactory.cpp @@ -0,0 +1,10 @@ +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" +#include "soh/resource/type/scenecommand/SceneCommand.h" +#include "spdlog/spdlog.h" + +namespace Ship { +void SceneCommandVersionFactory::ReadCommandId(std::shared_ptr command, std::shared_ptr reader) { + command->cmdId = (SceneCommandID)reader->ReadInt32(); +} +} + \ No newline at end of file diff --git a/soh/soh/resource/importer/scenecommand/SceneCommandFactory.h b/soh/soh/resource/importer/scenecommand/SceneCommandFactory.h new file mode 100644 index 000000000..fd3a07dce --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SceneCommandFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include +#include "Resource.h" +#include "ResourceFactory.h" +#include "soh/resource/type/scenecommand/SceneCommand.h" + +namespace Ship { +class SceneCommandFactory : public ResourceFactory {}; + +class SceneCommandVersionFactory : public ResourceVersionFactory { +protected: + void ReadCommandId(std::shared_ptr command, std::shared_ptr reader); +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetActorListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetActorListFactory.cpp new file mode 100644 index 000000000..b26efcc66 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetActorListFactory.cpp @@ -0,0 +1,55 @@ +#include "soh/resource/importer/scenecommand/SetActorListFactory.h" +#include "soh/resource/type/scenecommand/SetActorList.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetActorListFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetActorList with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetActorListFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setActorList = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setActorList); + + ReadCommandId(setActorList, reader); + + setActorList->numActors = reader->ReadUInt32(); + setActorList->actorList.reserve(setActorList->numActors); + for (uint32_t i = 0; i < setActorList->numActors; i++) { + ActorEntry entry; + + entry.id = reader->ReadUInt16(); + entry.pos.x = reader->ReadInt16(); + entry.pos.y = reader->ReadInt16(); + entry.pos.z = reader->ReadInt16(); + entry.rot.x = reader->ReadInt16(); + entry.rot.y = reader->ReadInt16(); + entry.rot.z = reader->ReadInt16(); + entry.params = reader->ReadUInt16(); + + setActorList->actorList.push_back(entry); + } +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetActorListFactory.h b/soh/soh/resource/importer/scenecommand/SetActorListFactory.h new file mode 100644 index 000000000..4842e929f --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetActorListFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetActorListFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetActorListFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.cpp b/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.cpp new file mode 100644 index 000000000..7f28e71e0 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.cpp @@ -0,0 +1,50 @@ +#include "soh/resource/importer/scenecommand/SetAlternateHeadersFactory.h" +#include "soh/resource/type/scenecommand/SetAlternateHeaders.h" +#include "spdlog/spdlog.h" +#include "libultraship/bridge.h" + +namespace Ship { +std::shared_ptr SetAlternateHeadersFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetAlternateHeaders with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetAlternateHeadersFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setAlternateHeaders = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setAlternateHeaders); + + ReadCommandId(setAlternateHeaders, reader); + + setAlternateHeaders->numHeaders = reader->ReadUInt32(); + setAlternateHeaders->headers.reserve(setAlternateHeaders->numHeaders); + for (uint32_t i = 0; i < setAlternateHeaders->numHeaders; i++) { + auto headerName = reader->ReadString(); + if (!headerName.empty()) { + setAlternateHeaders->headers.push_back(std::static_pointer_cast(LoadResource(headerName.c_str(), true))); + } else { + setAlternateHeaders->headers.push_back(nullptr); + } + } +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.h b/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.h new file mode 100644 index 000000000..96e93fe6b --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetAlternateHeadersFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetAlternateHeadersFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetAlternateHeadersFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.cpp new file mode 100644 index 000000000..e51aed6ee --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.cpp @@ -0,0 +1,41 @@ +#include "soh/resource/importer/scenecommand/SetCameraSettingsFactory.h" +#include "soh/resource/type/scenecommand/SetCameraSettings.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetCameraSettingsFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetCameraSettings with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetCameraSettingsFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setCameraSettings = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setCameraSettings); + + ReadCommandId(setCameraSettings, reader); + + setCameraSettings->settings.cameraMovement = reader->ReadInt8(); + setCameraSettings->settings.worldMapArea = reader->ReadInt32(); +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.h new file mode 100644 index 000000000..e6251f3b8 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetCameraSettingsFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetCameraSettingsFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetCameraSettingsFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.cpp b/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.cpp new file mode 100644 index 000000000..ff240cf88 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.cpp @@ -0,0 +1,42 @@ +#include "soh/resource/importer/scenecommand/SetCollisionHeaderFactory.h" +#include "soh/resource/type/scenecommand/SetCollisionHeader.h" +#include "libultraship/bridge.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetCollisionHeaderFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetCollisionHeader with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetCollisionHeaderFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setCollisionHeader = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setCollisionHeader); + + ReadCommandId(setCollisionHeader, reader); + + setCollisionHeader->fileName = reader->ReadString(); + setCollisionHeader->collisionHeader = std::static_pointer_cast(LoadResource(setCollisionHeader->fileName.c_str(), true)); +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.h b/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.h new file mode 100644 index 000000000..3a3995f4f --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetCollisionHeaderFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetCollisionHeaderFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetCollisionHeaderFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.cpp b/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.cpp new file mode 100644 index 000000000..eccf6bab6 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.cpp @@ -0,0 +1,43 @@ +#include "soh/resource/importer/scenecommand/SetCsCameraFactory.h" +#include "soh/resource/type/scenecommand/SetCsCamera.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetCsCameraFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetCsCamera with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetCsCameraFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setCsCamera = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setCsCamera); + + ReadCommandId(setCsCamera, reader); + + reader->ReadInt8(); // camSize + reader->ReadInt32(); // segOffset + + // OTRTODO: FINISH! +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.h b/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.h new file mode 100644 index 000000000..66a9b6ade --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetCsCameraFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetCsCameraFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetCsCameraFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.cpp b/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.cpp new file mode 100644 index 000000000..b02b7c43d --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.cpp @@ -0,0 +1,42 @@ +#include "soh/resource/importer/scenecommand/SetCutscenesFactory.h" +#include "soh/resource/type/scenecommand/SetCutscenes.h" +#include +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetCutscenesFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetCutscenes with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetCutscenesFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setCutscenes = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setCutscenes); + + ReadCommandId(setCutscenes, reader); + + setCutscenes->fileName = reader->ReadString(); + setCutscenes->cutscene = std::static_pointer_cast(LoadResource(setCutscenes->fileName.c_str(), true)); +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.h b/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.h new file mode 100644 index 000000000..61725e118 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetCutscenesFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetCutscenesFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetCutscenesFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.cpp new file mode 100644 index 000000000..2a7802cbf --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.cpp @@ -0,0 +1,40 @@ +#include "soh/resource/importer/scenecommand/SetEchoSettingsFactory.h" +#include "soh/resource/type/scenecommand/SetEchoSettings.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetEchoSettingsFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetEchoSettings with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetEchoSettingsFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setEchoSettings = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setEchoSettings); + + ReadCommandId(setEchoSettings, reader); + + setEchoSettings->settings.echo = reader->ReadInt8(); +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.h new file mode 100644 index 000000000..081e07178 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetEchoSettingsFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetEchoSettingsFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetEchoSettingsFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.cpp new file mode 100644 index 000000000..fced25a03 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.cpp @@ -0,0 +1,49 @@ +#include "soh/resource/importer/scenecommand/SetEntranceListFactory.h" +#include "soh/resource/type/scenecommand/SetEntranceList.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetEntranceListFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetEntranceListList with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetEntranceListFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setEntranceList = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setEntranceList); + + ReadCommandId(setEntranceList, reader); + + setEntranceList->numEntrances = reader->ReadUInt32(); + setEntranceList->entrances.reserve(setEntranceList->numEntrances); + for (uint32_t i = 0; i < setEntranceList->numEntrances; i++) { + EntranceEntry entranceEntry; + + entranceEntry.spawn = reader->ReadInt8(); + entranceEntry.room = reader->ReadInt8(); + + setEntranceList->entrances.push_back(entranceEntry); + } +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.h b/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.h new file mode 100644 index 000000000..5dc902f3b --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetEntranceListFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetEntranceListFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetEntranceListFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetExitListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetExitListFactory.cpp new file mode 100644 index 000000000..a8cda9b74 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetExitListFactory.cpp @@ -0,0 +1,44 @@ +#include "soh/resource/importer/scenecommand/SetExitListFactory.h" +#include "soh/resource/type/scenecommand/SetExitList.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetExitListFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetExitList with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetExitListFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setExitList = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setExitList); + + ReadCommandId(setExitList, reader); + + setExitList->numExits = reader->ReadUInt32(); + setExitList->exits.reserve(setExitList->numExits); + for (uint32_t i = 0; i < setExitList->numExits; i++) { + setExitList->exits.push_back(reader->ReadUInt16()); + } +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetExitListFactory.h b/soh/soh/resource/importer/scenecommand/SetExitListFactory.h new file mode 100644 index 000000000..9f50f996a --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetExitListFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetExitListFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetExitListFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetLightListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetLightListFactory.cpp new file mode 100644 index 000000000..ffe5e7dcb --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetLightListFactory.cpp @@ -0,0 +1,59 @@ +#include "soh/resource/importer/scenecommand/SetLightListFactory.h" +#include "soh/resource/type/scenecommand/SetLightList.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetLightListFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetLightList with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetLightListFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setLightList = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setLightList); + + ReadCommandId(setLightList, reader); + + setLightList->numLights = reader->ReadUInt32(); + setLightList->lightList.reserve(setLightList->numLights); + for (uint32_t i = 0; i < setLightList->numLights; i++) { + LightInfo light; + + light.type = reader->ReadUByte(); + + light.params.point.x = reader->ReadInt16(); + light.params.point.y = reader->ReadInt16(); + light.params.point.z = reader->ReadInt16(); + + light.params.point.color[0] = reader->ReadUByte(); // r + light.params.point.color[1] = reader->ReadUByte(); // g + light.params.point.color[2] = reader->ReadUByte(); // b + + light.params.point.drawGlow = reader->ReadUByte(); + light.params.point.radius = reader->ReadInt16(); + + setLightList->lightList.push_back(light); + } +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetLightListFactory.h b/soh/soh/resource/importer/scenecommand/SetLightListFactory.h new file mode 100644 index 000000000..5c05a22fa --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetLightListFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetLightListFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetLightListFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.cpp new file mode 100644 index 000000000..9a5fbb6ca --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.cpp @@ -0,0 +1,72 @@ +#include "soh/resource/importer/scenecommand/SetLightingSettingsFactory.h" +#include "soh/resource/type/scenecommand/SetLightingSettings.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetLightingSettingsFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetLightingSettings with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetLightingSettingsFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setLightingSettings = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setLightingSettings); + + ReadCommandId(setLightingSettings, reader); + + uint32_t count = reader->ReadInt32(); + setLightingSettings->settings.reserve(count); + + for (uint32_t i = 0; i < count; i++) { + EnvLightSettings lightSettings; + lightSettings.ambientColor[0] = reader->ReadInt8(); + lightSettings.ambientColor[1] = reader->ReadInt8(); + lightSettings.ambientColor[2] = reader->ReadInt8(); + + lightSettings.light1Dir[0] = reader->ReadInt8(); + lightSettings.light1Dir[1] = reader->ReadInt8(); + lightSettings.light1Dir[2] = reader->ReadInt8(); + + lightSettings.light1Color[0] = reader->ReadInt8(); + lightSettings.light1Color[1] = reader->ReadInt8(); + lightSettings.light1Color[2] = reader->ReadInt8(); + + lightSettings.light2Dir[0] = reader->ReadInt8(); + lightSettings.light2Dir[1] = reader->ReadInt8(); + lightSettings.light2Dir[2] = reader->ReadInt8(); + + lightSettings.light2Color[0] = reader->ReadInt8(); + lightSettings.light2Color[1] = reader->ReadInt8(); + lightSettings.light2Color[2] = reader->ReadInt8(); + + lightSettings.fogColor[0] = reader->ReadInt8(); + lightSettings.fogColor[1] = reader->ReadInt8(); + lightSettings.fogColor[2] = reader->ReadInt8(); + + lightSettings.fogNear = reader->ReadInt16(); + lightSettings.fogFar = reader->ReadUInt16(); + setLightingSettings->settings.push_back(lightSettings); + } +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.h new file mode 100644 index 000000000..2b4600c7d --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetLightingSettingsFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetLightingSettingsFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetLightingSettingsFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetMeshFactory.cpp b/soh/soh/resource/importer/scenecommand/SetMeshFactory.cpp new file mode 100644 index 000000000..7de2b0436 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetMeshFactory.cpp @@ -0,0 +1,162 @@ +#include "soh/resource/importer/scenecommand/SetMeshFactory.h" +#include "soh/resource/type/scenecommand/SetMesh.h" +#include "spdlog/spdlog.h" +#include "libultraship/bridge.h" + +namespace Ship { +std::shared_ptr SetMeshFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetMesh with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetMeshFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setMesh = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setMesh); + + ReadCommandId(setMesh, reader); + + setMesh->data = reader->ReadInt8(); + + setMesh->meshHeader.base.type = reader->ReadInt8(); + int32_t polyNum = 1; + + if (setMesh->meshHeader.base.type != 1) { + polyNum = reader->ReadInt8(); + if (setMesh->meshHeader.base.type == 0) { + setMesh->meshHeader.polygon0.num = polyNum; + } else if (setMesh->meshHeader.base.type == 2) { + setMesh->meshHeader.polygon2.num = polyNum; + } else { + SPDLOG_ERROR("Tried to load mesh in SetMesh scene header with type that doesn't exist: {}", setMesh->meshHeader.base.type); + } + } + + if (setMesh->meshHeader.base.type == 2) { + setMesh->dlists2.reserve(polyNum); + } else { + setMesh->dlists.reserve(setMesh->meshHeader.polygon0.num); + } + + for (int32_t i = 0; i < polyNum; i++) { + if (setMesh->meshHeader.base.type == 0) { + PolygonDlist dlist; + + int32_t polyType = reader->ReadInt8(); // Unused + std::string meshOpa = reader->ReadString(); + std::string meshXlu = reader->ReadString(); + + dlist.opa = meshOpa != "" ? (Gfx*)GetResourceDataByName(meshOpa.c_str(), true) : 0; + dlist.xlu = meshXlu != "" ? (Gfx*)GetResourceDataByName(meshXlu.c_str(), true) : 0; + + setMesh->dlists.push_back(dlist); + } else if (setMesh->meshHeader.base.type == 1) { + PolygonDlist pType; + + setMesh->meshHeader.polygon1.format = reader->ReadUByte(); + std::string imgOpa = reader->ReadString(); + std::string imgXlu = reader->ReadString(); + + pType.opa = imgOpa != "" ? (Gfx*)GetResourceDataByName(imgOpa.c_str(), true) : 0; + pType.xlu = imgXlu != "" ? (Gfx*)GetResourceDataByName(imgXlu.c_str(), true) : 0; + + int32_t bgImageCount = reader->ReadUInt32(); + setMesh->images.reserve(bgImageCount); + + for (int32_t i = 0; i < bgImageCount; i++) { + BgImage image; + image.unk_00 = reader->ReadUInt16(); + image.id = reader->ReadUByte(); + std::string sourceFile = reader->ReadString(); + void* sourceData = GetResourceDataByName(sourceFile.c_str(), true); + image.source = sourceData; + image.unk_0C = reader->ReadUInt32(); + image.tlut = reader->ReadUInt32(); + image.width = reader->ReadUInt16(); + image.height = reader->ReadUInt16(); + image.fmt = reader->ReadUByte(); + image.siz = reader->ReadUByte(); + image.mode0 = reader->ReadUInt16(); + image.tlutCount = reader->ReadUInt16(); + + if (setMesh->meshHeader.polygon1.format == 1) { + setMesh->meshHeader.polygon1.single.source = image.source; + setMesh->meshHeader.polygon1.single.unk_0C = image.unk_0C; + setMesh->meshHeader.polygon1.single.tlut = (void*)image.tlut; // OTRTODO: type of bgimage.tlut should be uintptr_t + setMesh->meshHeader.polygon1.single.width = image.width; + setMesh->meshHeader.polygon1.single.height = image.height; + setMesh->meshHeader.polygon1.single.fmt = image.fmt; + setMesh->meshHeader.polygon1.single.siz = image.siz; + setMesh->meshHeader.polygon1.single.mode0 = image.mode0; + setMesh->meshHeader.polygon1.single.tlutCount = image.tlutCount; + } else { + setMesh->images.push_back(image); + } + } + + if (setMesh->meshHeader.polygon1.format != 1) { + setMesh->meshHeader.polygon1.multi.count = bgImageCount; + } + + int32_t polyType = reader->ReadInt8(); // Unused?? + + std::string meshOpa = reader->ReadString(); + std::string meshXlu = reader->ReadString(); + + pType.opa = meshOpa != "" ? (Gfx*)GetResourceDataByName(meshOpa.c_str(), true) : 0; + pType.xlu = meshXlu != "" ? (Gfx*)GetResourceDataByName(meshXlu.c_str(), true) : 0; + + setMesh->dlists.push_back(pType); + } else if (setMesh->meshHeader.base.type == 2) { + PolygonDlist2 dlist; + + int32_t polyType = reader->ReadInt8(); // Unused + dlist.pos.x = reader->ReadInt16(); + dlist.pos.y = reader->ReadInt16(); + dlist.pos.z = reader->ReadInt16(); + dlist.unk_06 = reader->ReadInt16(); + + std::string meshOpa = reader->ReadString(); + std::string meshXlu = reader->ReadString(); + + dlist.opa = meshOpa != "" ? (Gfx*)GetResourceDataByName(meshOpa.c_str(), true) : 0; + dlist.xlu = meshXlu != "" ? (Gfx*)GetResourceDataByName(meshXlu.c_str(), true) : 0; + + setMesh->dlists2.push_back(dlist); + } else { + SPDLOG_ERROR("Tried to load mesh in SetMesh scene header with type that doesn't exist: {}", setMesh->meshHeader.base.type); + } + } + + if (setMesh->meshHeader.base.type == 2) { + setMesh->meshHeader.polygon2.start = setMesh->dlists2.data(); + } else if (setMesh->meshHeader.base.type == 0) { + setMesh->meshHeader.polygon0.start = setMesh->dlists.data(); + } else if (setMesh->meshHeader.base.type == 1) { + setMesh->meshHeader.polygon1.multi.list = setMesh->images.data(); + setMesh->meshHeader.polygon1.dlist = (Gfx*)setMesh->dlists.data(); + } else { + SPDLOG_ERROR("Tried to load mesh in SetMesh scene header with type that doesn't exist: {}", setMesh->meshHeader.base.type); + } +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetMeshFactory.h b/soh/soh/resource/importer/scenecommand/SetMeshFactory.h new file mode 100644 index 000000000..be11cc0db --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetMeshFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetMeshFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetMeshFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetObjectListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetObjectListFactory.cpp new file mode 100644 index 000000000..2eddd6c3d --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetObjectListFactory.cpp @@ -0,0 +1,44 @@ +#include "soh/resource/importer/scenecommand/SetObjectListFactory.h" +#include "soh/resource/type/scenecommand/SetObjectList.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetObjectListFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetObjectList with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetObjectListFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setObjectList = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setObjectList); + + ReadCommandId(setObjectList, reader); + + setObjectList->numObjects = reader->ReadUInt32(); + setObjectList->objects.reserve(setObjectList->numObjects); + for (uint32_t i = 0; i < setObjectList->numObjects; i++) { + setObjectList->objects.push_back(reader->ReadUInt16()); + } +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetObjectListFactory.h b/soh/soh/resource/importer/scenecommand/SetObjectListFactory.h new file mode 100644 index 000000000..b7bb27f95 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetObjectListFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetObjectListFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetObjectListFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.cpp b/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.cpp new file mode 100644 index 000000000..420b13204 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.cpp @@ -0,0 +1,46 @@ +#include "soh/resource/importer/scenecommand/SetPathwaysFactory.h" +#include "soh/resource/type/scenecommand/SetPathways.h" +#include "spdlog/spdlog.h" +#include + +namespace Ship { +std::shared_ptr SetPathwaysFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetPathways with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetPathwaysFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setPathways = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setPathways); + + ReadCommandId(setPathways, reader); + + setPathways->numPaths = reader->ReadUInt32(); + setPathways->paths.reserve(setPathways->numPaths); + for (uint32_t i = 0; i < setPathways->numPaths; i++) { + std::string pathFileName = reader->ReadString(); + setPathways->paths.push_back(std::static_pointer_cast(LoadResource(pathFileName.c_str(), true))); + } +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.h b/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.h new file mode 100644 index 000000000..d6df48ca7 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetPathwaysFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetPathwaysFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetPathwaysFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.cpp b/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.cpp new file mode 100644 index 000000000..effac3bd6 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.cpp @@ -0,0 +1,41 @@ +#include "soh/resource/importer/scenecommand/SetRoomBehaviorFactory.h" +#include "soh/resource/type/scenecommand/SetRoomBehavior.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetRoomBehaviorFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetRoomBehavior with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetRoomBehaviorFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setRoomBehavior = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setRoomBehavior); + + ReadCommandId(setRoomBehavior, reader); + + setRoomBehavior->roomBehavior.gameplayFlags = reader->ReadInt8(); + setRoomBehavior->roomBehavior.gameplayFlags2 = reader->ReadInt32(); +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.h b/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.h new file mode 100644 index 000000000..836d1bbe8 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetRoomBehaviorFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetRoomBehaviorFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetRoomBehaviorFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetRoomListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetRoomListFactory.cpp new file mode 100644 index 000000000..87d64109f --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetRoomListFactory.cpp @@ -0,0 +1,52 @@ +#include "soh/resource/importer/scenecommand/SetRoomListFactory.h" +#include "soh/resource/type/scenecommand/SetRoomList.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetRoomListFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetRoomList with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetRoomListFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setRoomList = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setRoomList); + + ReadCommandId(setRoomList, reader); + + setRoomList->numRooms = reader->ReadInt32(); + setRoomList->rooms.reserve(setRoomList->numRooms); + for (uint32_t i = 0; i < setRoomList->numRooms; i++) { + RomFile room; + + setRoomList->fileNames.push_back(reader->ReadString()); + + room.fileName = (char*)setRoomList->fileNames.back().c_str(); + room.vromStart = reader->ReadInt32(); + room.vromEnd = reader->ReadInt32(); + + setRoomList->rooms.push_back(room); + } +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetRoomListFactory.h b/soh/soh/resource/importer/scenecommand/SetRoomListFactory.h new file mode 100644 index 000000000..3b6e0976d --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetRoomListFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetRoomListFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetRoomListFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.cpp b/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.cpp new file mode 100644 index 000000000..565e156c0 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.cpp @@ -0,0 +1,41 @@ +#include "soh/resource/importer/scenecommand/SetSkyboxModifierFactory.h" +#include "soh/resource/type/scenecommand/SetSkyboxModifier.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetSkyboxModifierFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetSkyboxModifier with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetSkyboxModifierFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setSkyboxModifier = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setSkyboxModifier); + + ReadCommandId(setSkyboxModifier, reader); + + setSkyboxModifier->modifier.skyboxDisabled = reader->ReadInt8(); + setSkyboxModifier->modifier.sunMoonDisabled = reader->ReadInt8(); +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.h b/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.h new file mode 100644 index 000000000..1d4ab43c0 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetSkyboxModifierFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetSkyboxModifierFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetSkyboxModifierFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.cpp new file mode 100644 index 000000000..803479ea1 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.cpp @@ -0,0 +1,43 @@ +#include "soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.h" +#include "soh/resource/type/scenecommand/SetSkyboxSettings.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetSkyboxSettingsFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetSkyboxSettings with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void SetSkyboxSettingsFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setSkyboxSettings = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setSkyboxSettings); + + ReadCommandId(setSkyboxSettings, reader); + + setSkyboxSettings->settings.unk = reader->ReadInt8(); + setSkyboxSettings->settings.skyboxId = reader->ReadInt8(); + setSkyboxSettings->settings.weather = reader->ReadInt8(); + setSkyboxSettings->settings.indoors = reader->ReadInt8(); +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.h new file mode 100644 index 000000000..170689159 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetSkyboxSettingsFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetSkyboxSettingsFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetSkyboxSettingsFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.cpp new file mode 100644 index 000000000..e6d569969 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.cpp @@ -0,0 +1,42 @@ +#include "soh/resource/importer/scenecommand/SetSoundSettingsFactory.h" +#include "soh/resource/type/scenecommand/SetSoundSettings.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetSoundSettingsFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetSoundSettings with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetSoundSettingsFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setSoundSettings = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setSoundSettings); + + ReadCommandId(setSoundSettings, reader); + + setSoundSettings->settings.reverb = reader->ReadInt8(); + setSoundSettings->settings.natureAmbienceId = reader->ReadInt8(); + setSoundSettings->settings.seqId = reader->ReadInt8(); +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.h new file mode 100644 index 000000000..94b2702cf --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetSoundSettingsFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetSoundSettingsFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetSoundSettingsFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.cpp new file mode 100644 index 000000000..93807b640 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.cpp @@ -0,0 +1,41 @@ +#include "soh/resource/importer/scenecommand/SetSpecialObjectsFactory.h" +#include "soh/resource/type/scenecommand/SetSpecialObjects.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetSpecialObjectsFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetSpecialObjects with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetSpecialObjectsFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setSpecialObjects = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setSpecialObjects); + + ReadCommandId(setSpecialObjects, reader); + + setSpecialObjects->specialObjects.elfMessage = reader->ReadInt8(); + setSpecialObjects->specialObjects.globalObject = reader->ReadInt16(); +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.h b/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.h new file mode 100644 index 000000000..c0f41bd64 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetSpecialObjectsFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetSpecialObjectsFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetSpecialObjectsFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.cpp new file mode 100644 index 000000000..2d1c41186 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.cpp @@ -0,0 +1,55 @@ +#include "soh/resource/importer/scenecommand/SetStartPositionListFactory.h" +#include "soh/resource/type/scenecommand/SetStartPositionList.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetStartPositionListFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetStartPositionList with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetStartPositionListFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setStartPositionList = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setStartPositionList); + + ReadCommandId(setStartPositionList, reader); + + setStartPositionList->numStartPositions = reader->ReadUInt32(); + setStartPositionList->startPositions.reserve(setStartPositionList->numStartPositions); + for (uint32_t i = 0; i < setStartPositionList->numStartPositions; i++) { + ActorEntry entry; + + entry.id = reader->ReadUInt16(); + entry.pos.x = reader->ReadInt16(); + entry.pos.y = reader->ReadInt16(); + entry.pos.z = reader->ReadInt16(); + entry.rot.x = reader->ReadInt16(); + entry.rot.y = reader->ReadInt16(); + entry.rot.z = reader->ReadInt16(); + entry.params = reader->ReadUInt16(); + + setStartPositionList->startPositions.push_back(entry); + } +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.h b/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.h new file mode 100644 index 000000000..d6e6ffbe8 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetStartPositionListFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetStartPositionListFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetStartPositionListFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.cpp new file mode 100644 index 000000000..a0494cb22 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.cpp @@ -0,0 +1,42 @@ +#include "soh/resource/importer/scenecommand/SetTimeSettingsFactory.h" +#include "soh/resource/type/scenecommand/SetTimeSettings.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetTimeSettingsFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetTimeSettings with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetTimeSettingsFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setTimeSettings = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setTimeSettings); + + ReadCommandId(setTimeSettings, reader); + + setTimeSettings->settings.hour = reader->ReadInt8(); + setTimeSettings->settings.minute = reader->ReadInt8(); + setTimeSettings->settings.timeIncrement = reader->ReadInt8(); +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.h new file mode 100644 index 000000000..e2a9fbd66 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetTimeSettingsFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetTimeSettingsFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetTimeSettingsFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.cpp b/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.cpp new file mode 100644 index 000000000..a806a3f15 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.cpp @@ -0,0 +1,57 @@ +#include "soh/resource/importer/scenecommand/SetTransitionActorListFactory.h" +#include "soh/resource/type/scenecommand/SetTransitionActorList.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetTransitionActorListFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetTransitionActorList with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetTransitionActorListFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setTransitionActorList = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setTransitionActorList); + + ReadCommandId(setTransitionActorList, reader); + + setTransitionActorList->numTransitionActors = reader->ReadUInt32(); + setTransitionActorList->transitionActorList.reserve(setTransitionActorList->numTransitionActors); + for (uint32_t i = 0; i < setTransitionActorList->numTransitionActors; i++) { + TransitionActorEntry entry; + + entry.sides[0].room = reader->ReadUByte(); + entry.sides[0].effects = reader->ReadUByte(); + entry.sides[1].room = reader->ReadUByte(); + entry.sides[1].effects = reader->ReadUByte(); + entry.id = reader->ReadInt16(); + entry.pos.x = reader->ReadInt16(); + entry.pos.y = reader->ReadInt16(); + entry.pos.z = reader->ReadInt16(); + entry.rotY = reader->ReadInt16(); + entry.params = reader->ReadUInt16(); + + setTransitionActorList->transitionActorList.push_back(entry); + } +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.h b/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.h new file mode 100644 index 000000000..86408ed70 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetTransitionActorListFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetTransitionActorListFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetTransitionActorListFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.cpp b/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.cpp new file mode 100644 index 000000000..f22a9c2d8 --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.cpp @@ -0,0 +1,43 @@ +#include "soh/resource/importer/scenecommand/SetWindSettingsFactory.h" +#include "soh/resource/type/scenecommand/SetWindSettings.h" +#include "spdlog/spdlog.h" + +namespace Ship { +std::shared_ptr SetWindSettingsFactory::ReadResource(uint32_t version, std::shared_ptr reader) +{ + auto resource = std::make_shared(); + std::shared_ptr factory = nullptr; + + switch (version) + { + case 0: + factory = std::make_shared(); + break; + } + + if (factory == nullptr) + { + SPDLOG_ERROR("Failed to load SetWindSettings with version {}", version); + return nullptr; + } + + factory->ParseFileBinary(reader, resource); + + return resource; +} + +void Ship::SetWindSettingsFactoryV0::ParseFileBinary(std::shared_ptr reader, + std::shared_ptr resource) +{ + std::shared_ptr setWind = std::static_pointer_cast(resource); + ResourceVersionFactory::ParseFileBinary(reader, setWind); + + ReadCommandId(setWind, reader); + + setWind->settings.windWest = reader->ReadInt8(); + setWind->settings.windVertical = reader->ReadInt8(); + setWind->settings.windSouth = reader->ReadInt8(); + setWind->settings.windSpeed = reader->ReadInt8(); +} + +} // namespace Ship diff --git a/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.h b/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.h new file mode 100644 index 000000000..20b0b27ac --- /dev/null +++ b/soh/soh/resource/importer/scenecommand/SetWindSettingsFactory.h @@ -0,0 +1,15 @@ +#pragma once + +#include "soh/resource/importer/scenecommand/SceneCommandFactory.h" + +namespace Ship { +class SetWindSettingsFactory : public SceneCommandFactory { + public: + std::shared_ptr ReadResource(uint32_t version, std::shared_ptr reader); +}; + +class SetWindSettingsFactoryV0 : public SceneCommandVersionFactory { + public: + void ParseFileBinary(std::shared_ptr reader, std::shared_ptr resource) override; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/Animation.cpp b/soh/soh/resource/type/Animation.cpp new file mode 100644 index 000000000..6f79d09e3 --- /dev/null +++ b/soh/soh/resource/type/Animation.cpp @@ -0,0 +1,21 @@ +#include "Animation.h" + +namespace Ship { +void* Animation::GetPointer() { + return &animationData; +} + +size_t Animation::GetPointerSize() { + switch(type) { + case AnimationType::Normal: + return sizeof(animationData.animationHeader); + case AnimationType::Link: + return sizeof(animationData.linkAnimationHeader); + case AnimationType::Curve: + return sizeof(animationData.transformUpdateIndex); + case AnimationType::Legacy: + default: + return 0; + } +} +} // namespace Ship \ No newline at end of file diff --git a/soh/soh/resource/type/Animation.h b/soh/soh/resource/type/Animation.h new file mode 100644 index 000000000..6045e833b --- /dev/null +++ b/soh/soh/resource/type/Animation.h @@ -0,0 +1,83 @@ +#pragma once + +#include "Resource.h" +#include + +namespace Ship { + enum class AnimationType { + Normal = 0, + Link = 1, + Curve = 2, + Legacy = 3, + }; + + struct RotationIndex { + uint16_t x, y, z; + + RotationIndex(uint16_t nX, uint16_t nY, uint16_t nZ) : x(nX), y(nY), z(nZ) { + } + }; + + typedef struct { + /* 0x0000 */ u16 unk_00; // appears to be flags + /* 0x0002 */ s16 unk_02; + /* 0x0004 */ s16 unk_04; + /* 0x0006 */ s16 unk_06; + /* 0x0008 */ f32 unk_08; + } TransformData; // size = 0xC + + typedef struct { + /* 0x0000 */ u8* refIndex; + /* 0x0004 */ TransformData* transformData; + /* 0x0008 */ s16* copyValues; + /* 0x000C */ s16 unk_0C; + /* 0x000E */ s16 unk_0E; + } TransformUpdateIndex; // size = 0x10 + + typedef struct { + /* 0x00 */ s16 frameCount; + } AnimationHeaderCommon; + + // Index into the frame data table. + typedef struct { + /* 0x00 */ u16 x; + /* 0x02 */ u16 y; + /* 0x04 */ u16 z; + } JointIndex; // size = 0x06 + + typedef struct { + /* 0x00 */ AnimationHeaderCommon common; + /* 0x04 */ s16* frameData; // "tbl" + /* 0x08 */ JointIndex* jointIndices; // "ref_tbl" + /* 0x0C */ u16 staticIndexMax; + } AnimationHeader; // size = 0x10 + + typedef struct { + /* 0x00 */ AnimationHeaderCommon common; + /* 0x04 */ void* segment; + } LinkAnimationHeader; // size = 0x8 + + union AnimationData { + AnimationHeader animationHeader; + LinkAnimationHeader linkAnimationHeader; + TransformUpdateIndex transformUpdateIndex; + }; + + class Animation : public Resource { + public: + void* GetPointer(); + size_t GetPointerSize(); + + AnimationType type; + AnimationData animationData; + + // NORMAL + std::vector rotationValues; + std::vector rotationIndices; + + // CURVE + std::vector refIndexArr; + std::vector transformDataArr; + std::vector copyValuesArr; + }; +}; // namespace Ship \ No newline at end of file diff --git a/soh/soh/resource/type/AudioSample.cpp b/soh/soh/resource/type/AudioSample.cpp new file mode 100644 index 000000000..d276b7564 --- /dev/null +++ b/soh/soh/resource/type/AudioSample.cpp @@ -0,0 +1,11 @@ +#include "AudioSample.h" + +namespace Ship { +void* AudioSample::GetPointer() { + return &sample; +} + +size_t AudioSample::GetPointerSize() { + return sizeof(Sample); +} +} // namespace Ship \ No newline at end of file diff --git a/soh/soh/resource/type/AudioSample.h b/soh/soh/resource/type/AudioSample.h new file mode 100644 index 000000000..2407b55b5 --- /dev/null +++ b/soh/soh/resource/type/AudioSample.h @@ -0,0 +1,57 @@ +#pragma once + +#include +#include +#include "Resource.h" +#include + +namespace Ship { + typedef struct { + /* 0x00 */ uintptr_t start; + /* 0x04 */ uintptr_t end; + /* 0x08 */ u32 count; + /* 0x0C */ char unk_0C[0x4]; + /* 0x10 */ s16 state[16]; // only exists if count != 0. 8-byte aligned + } AdpcmLoop; // size = 0x30 (or 0x10) + + typedef struct { + /* 0x00 */ s32 order; + /* 0x04 */ s32 npredictors; + /* 0x08 */ s16* book; // size 8 * order * npredictors. 8-byte aligned + } AdpcmBook; // s + + typedef struct { + union { + struct { + /* 0x00 */ u32 codec : 4; + /* 0x00 */ u32 medium : 2; + /* 0x00 */ u32 unk_bit26 : 1; + /* 0x00 */ u32 unk_bit25 : 1; // this has been named isRelocated in zret + /* 0x01 */ u32 size : 24; + }; + u32 asU32; + }; + + /* 0x04 */ u8* sampleAddr; + /* 0x08 */ AdpcmLoop* loop; + /* 0x0C */ AdpcmBook* book; + u32 sampleRateMagicValue; // For wav samples only... + s32 sampleRate; // For wav samples only... + } Sample; // size = 0x10 + + class AudioSample : public Resource { + public: + void* GetPointer(); + size_t GetPointerSize(); + + Sample sample; + std::vector audioSampleData; + + AdpcmLoop loop; + uint32_t loopStateCount; + + AdpcmBook book; + uint32_t bookDataCount; + std::vector bookData; + }; +}; // namespace Ship diff --git a/soh/soh/resource/type/AudioSequence.cpp b/soh/soh/resource/type/AudioSequence.cpp new file mode 100644 index 000000000..1cfce803f --- /dev/null +++ b/soh/soh/resource/type/AudioSequence.cpp @@ -0,0 +1,12 @@ +#include "AudioSequence.h" + +namespace Ship { + +void* AudioSequence::GetPointer() { + return &sequence; +} + +size_t AudioSequence::GetPointerSize() { + return sizeof(Sequence); +} +} // namespace Ship diff --git a/soh/soh/resource/type/AudioSequence.h b/soh/soh/resource/type/AudioSequence.h new file mode 100644 index 000000000..ddfa7c004 --- /dev/null +++ b/soh/soh/resource/type/AudioSequence.h @@ -0,0 +1,28 @@ +#pragma once + +#include +#include +#include "Resource.h" +#include + +namespace Ship { + +typedef struct { + char* seqData; + int32_t seqDataSize; + uint16_t seqNumber; + uint8_t medium; + uint8_t cachePolicy; + int32_t numFonts; + uint8_t fonts[16]; +} Sequence; + +class AudioSequence : public Resource { +public: + void* GetPointer(); + size_t GetPointerSize(); + + Sequence sequence; + std::vector sequenceData; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/AudioSoundFont.cpp b/soh/soh/resource/type/AudioSoundFont.cpp new file mode 100644 index 000000000..018ff443d --- /dev/null +++ b/soh/soh/resource/type/AudioSoundFont.cpp @@ -0,0 +1,11 @@ +#include "AudioSoundFont.h" + +namespace Ship { +void* AudioSoundFont::GetPointer() { + return &soundFont; +} + +size_t AudioSoundFont::GetPointerSize() { + return sizeof(SoundFont); +} +} // namespace Ship diff --git a/soh/soh/resource/type/AudioSoundFont.h b/soh/soh/resource/type/AudioSoundFont.h new file mode 100644 index 000000000..2e66b845a --- /dev/null +++ b/soh/soh/resource/type/AudioSoundFont.h @@ -0,0 +1,80 @@ +#pragma once + +#include +#include +#include "Resource.h" +#include "soh/resource/type/AudioSample.h" +#include + +namespace Ship { + +typedef struct { + /* 0x0 */ s16 delay; + /* 0x2 */ s16 arg; +} AdsrEnvelope; // size = 0x4 + +typedef struct { + /* 0x00 */ Sample* sample; + /* 0x04 */ union { + u32 tuningAsU32; + f32 tuning;// frequency scale factor + }; +} SoundFontSound; // size = 0x8 + +typedef struct { + /* 0x00 */ u8 loaded; + /* 0x01 */ u8 normalRangeLo; + /* 0x02 */ u8 normalRangeHi; + /* 0x03 */ u8 releaseRate; + /* 0x04 */ AdsrEnvelope* envelope; + /* 0x08 */ SoundFontSound lowNotesSound; + /* 0x10 */ SoundFontSound normalNotesSound; + /* 0x18 */ SoundFontSound highNotesSound; +} Instrument; // size = 0x20 + +typedef struct { + /* 0x00 */ u8 releaseRate; + /* 0x01 */ u8 pan; + /* 0x02 */ u8 loaded; + /* 0x04 */ SoundFontSound sound; + /* 0x14 */ AdsrEnvelope* envelope; +} Drum; // size = 0x14 + +typedef struct { + /* 0x00 */ u8 numInstruments; + /* 0x01 */ u8 numDrums; + /* 0x02 */ u8 sampleBankId1; + /* 0x03 */ u8 sampleBankId2; + /* 0x04 */ u16 numSfx; + /* 0x08 */ Instrument** instruments; + /* 0x0C */ Drum** drums; + /* 0x10 */ SoundFontSound* soundEffects; + s32 fntIndex; +} SoundFont; // size = 0x14 + +class AudioSoundFont : public Resource { +public: + void* GetPointer(); + size_t GetPointerSize(); + + int8_t medium; + int8_t cachePolicy; + uint16_t data1; + uint16_t data2; + uint16_t data3; + + std::vector drums; + std::vector drumAddresses; + std::vector drumEnvelopeCounts; + std::vector> drumEnvelopeArrays; + + std::vector instruments; + std::vector instrumentAddresses; + std::vector instrumentEnvelopeCounts; + std::vector> instrumentEnvelopeArrays; + + std::vector soundEffects; + + SoundFont soundFont; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/Background.cpp b/soh/soh/resource/type/Background.cpp new file mode 100644 index 000000000..2d24c0be3 --- /dev/null +++ b/soh/soh/resource/type/Background.cpp @@ -0,0 +1,11 @@ +#include "Background.h" + +namespace Ship { +void* Background::GetPointer() { + return Data.data(); +} + +size_t Background::GetPointerSize() { + return Data.size() * sizeof(uint8_t); +} +} // namespace Ship diff --git a/soh/soh/resource/type/Background.h b/soh/soh/resource/type/Background.h new file mode 100644 index 000000000..5f4d4c044 --- /dev/null +++ b/soh/soh/resource/type/Background.h @@ -0,0 +1,13 @@ +#pragma once + +#include "resource/Resource.h" + +namespace Ship { +class Background : public Resource { + public: + void* GetPointer(); + size_t GetPointerSize(); + + std::vector Data; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/CollisionHeader.cpp b/soh/soh/resource/type/CollisionHeader.cpp new file mode 100644 index 000000000..dbba77011 --- /dev/null +++ b/soh/soh/resource/type/CollisionHeader.cpp @@ -0,0 +1,11 @@ +#include "CollisionHeader.h" + +namespace Ship { +void* CollisionHeader::GetPointer() { + return &collisionHeaderData; +} + +size_t CollisionHeader::GetPointerSize() { + return sizeof(collisionHeaderData); +} +} // namespace Ship \ No newline at end of file diff --git a/soh/soh/resource/type/CollisionHeader.h b/soh/soh/resource/type/CollisionHeader.h new file mode 100644 index 000000000..65c84cf72 --- /dev/null +++ b/soh/soh/resource/type/CollisionHeader.h @@ -0,0 +1,94 @@ +#pragma once + +#include +#include +#include "Resource.h" +#include +#include "z64math.h" + +namespace Ship { + +typedef struct { + /* 0x00 */ u16 type; + union { + u16 vtxData[3]; + struct { + /* 0x02 */ u16 flags_vIA; // 0xE000 is poly exclusion flags (xpFlags), 0x1FFF is vtxId + /* 0x04 */ u16 flags_vIB; // 0xE000 is flags, 0x1FFF is vtxId + // 0x2000 = poly IsConveyor surface + /* 0x06 */ u16 vIC; + }; + }; + /* 0x08 */ Vec3s normal; // Unit normal vector + // Value ranges from -0x7FFF to 0x7FFF, representing -1.0 to 1.0; 0x8000 is invalid + + /* 0x0E */ s16 dist; // Plane distance from origin along the normal +} CollisionPoly; // size = 0x10 + +typedef struct { + /* 0x00 */ s16 xMin; + /* 0x02 */ s16 ySurface; + /* 0x04 */ s16 zMin; + /* 0x06 */ s16 xLength; + /* 0x08 */ s16 zLength; + /* 0x0C */ u32 properties; + + // 0x0008_0000 = ? + // 0x0007_E000 = Room Index, 0x3F = all rooms + // 0x0000_1F00 = Lighting Settings Index + // 0x0000_00FF = CamData index +} WaterBox; // size = 0x10 + +typedef struct { + /* 0x00 */ u16 cameraSType; + /* 0x02 */ s16 numCameras; + /* 0x04 */ Vec3s* camPosData; +} CamData; + +typedef struct { + u32 data[2]; + + // Type 1 + // 0x0800_0000 = wall damage +} SurfaceType; + + +typedef struct { + /* 0x00 */ Vec3s minBounds; // minimum coordinates of poly bounding box + /* 0x06 */ Vec3s maxBounds; // maximum coordinates of poly bounding box + /* 0x0C */ u16 numVertices; + /* 0x10 */ Vec3s* vtxList; + /* 0x14 */ u16 numPolygons; + /* 0x18 */ CollisionPoly* polyList; + /* 0x1C */ SurfaceType* surfaceTypeList; + /* 0x20 */ CamData* cameraDataList; + /* 0x24 */ u16 numWaterBoxes; + /* 0x28 */ WaterBox* waterBoxes; + size_t cameraDataListLen; // OTRTODO: Added to allow for bounds checking the cameraDataList. +} CollisionHeaderData; // original name: BGDataInfo + +class CollisionHeader : public Resource { +public: + void* GetPointer(); + size_t GetPointerSize(); + + CollisionHeaderData collisionHeaderData; + + std::vector vertices; + + std::vector polygons; + + uint32_t surfaceTypesCount; + std::vector surfaceTypes; + + uint32_t camDataCount; + std::vector camData; + std::vector camPosDataIndices; + + int32_t camPosCount; + Vec3s camPosDataZero; + std::vector camPosData; + + std::vector waterBoxes; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/Cutscene.cpp b/soh/soh/resource/type/Cutscene.cpp new file mode 100644 index 000000000..e1283e4c9 --- /dev/null +++ b/soh/soh/resource/type/Cutscene.cpp @@ -0,0 +1,12 @@ +#include "Cutscene.h" +#include + +namespace Ship { +void* Cutscene::GetPointer() { + return commands.data(); +} + +size_t Cutscene::GetPointerSize() { + return commands.size() * sizeof(uint32_t); +} +} // namespace Ship \ No newline at end of file diff --git a/soh/soh/resource/type/Cutscene.h b/soh/soh/resource/type/Cutscene.h new file mode 100644 index 000000000..1c747a2cc --- /dev/null +++ b/soh/soh/resource/type/Cutscene.h @@ -0,0 +1,67 @@ +#pragma once + +#include +#include +#include "Resource.h" +#include "Vec2f.h" +#include "Vec3f.h" +#include "Color3b.h" + +namespace Ship { + +enum class CutsceneCommands { + Cmd00 = 0x0000, + SetCameraPos = 0x0001, + SetCameraFocus = 0x0002, + SpecialAction = 0x0003, + SetLighting = 0x0004, + SetCameraPosLink = 0x0005, + SetCameraFocusLink = 0x0006, + Cmd07 = 0x0007, + Cmd08 = 0x0008, + Cmd09 = 0x0009, + Unknown = 0x001A, + Textbox = 0x0013, + SetActorAction0 = 0x000A, + SetActorAction1 = 0x000F, + SetActorAction2 = 0x000E, + SetActorAction3 = 0x0019, + SetActorAction4 = 0x001D, + SetActorAction5 = 0x001E, + SetActorAction6 = 0x002C, + SetActorAction7 = 0x001F, + SetActorAction8 = 0x0031, + SetActorAction9 = 0x003E, + SetActorAction10 = 0x008F, + SetSceneTransFX = 0x002D, + Nop = 0x000B, + PlayBGM = 0x0056, + StopBGM = 0x0057, + FadeBGM = 0x007C, + SetTime = 0x008C, + Terminator = 0x03E8, + End = 0xFFFF, + Error = 0xFEAF, +}; + +class Cutscene : public Resource { + public: + void* GetPointer(); + size_t GetPointerSize(); + + uint32_t numCommands; + uint32_t endFrame; + std::vector commands; +}; +} // namespace Ship + + +///////////// + +// class CutsceneCommand { +// public: +// uint32_t commandID; +// uint32_t commandIndex; + +// CutsceneCommand(){}; +// }; diff --git a/soh/soh/resource/type/Path.cpp b/soh/soh/resource/type/Path.cpp new file mode 100644 index 000000000..0a9e70137 --- /dev/null +++ b/soh/soh/resource/type/Path.cpp @@ -0,0 +1,11 @@ +#include "Path.h" + +namespace Ship { +void* Path::GetPointer() { + return pathData.data(); +} + +size_t Path::GetPointerSize() { + return pathData.size() * sizeof(PathData); +} +} // namespace Ship diff --git a/soh/soh/resource/type/Path.h b/soh/soh/resource/type/Path.h new file mode 100644 index 000000000..f64ae53a6 --- /dev/null +++ b/soh/soh/resource/type/Path.h @@ -0,0 +1,25 @@ +#pragma once + +#include +#include +#include "Resource.h" +#include +#include "z64math.h" + +namespace Ship { + +typedef struct { + /* 0x00 */ u8 count; // number of points in the path + /* 0x04 */ Vec3s* points; // Segment Address to the array of points +} PathData; // size = 0x8 + +class Path : public Resource { +public: + void* GetPointer(); + size_t GetPointerSize(); + + uint32_t numPaths; + std::vector pathData; + std::vector> paths; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/PlayerAnimation.cpp b/soh/soh/resource/type/PlayerAnimation.cpp new file mode 100644 index 000000000..d22d2712f --- /dev/null +++ b/soh/soh/resource/type/PlayerAnimation.cpp @@ -0,0 +1,12 @@ +#include "PlayerAnimation.h" +#include + +namespace Ship { +void* PlayerAnimation::GetPointer() { + return limbRotData.data(); +} + +size_t PlayerAnimation::GetPointerSize() { + return limbRotData.size() * sizeof(int16_t); +} +} // namespace Ship \ No newline at end of file diff --git a/soh/soh/resource/type/PlayerAnimation.h b/soh/soh/resource/type/PlayerAnimation.h new file mode 100644 index 000000000..a4adb3464 --- /dev/null +++ b/soh/soh/resource/type/PlayerAnimation.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include +#include "Resource.h" +#include "Vec2f.h" +#include "Vec3f.h" +#include "Color3b.h" + +namespace Ship { + +class PlayerAnimation : public Resource { + public: + void* GetPointer(); + size_t GetPointerSize(); + + std::vector limbRotData; +}; +} // namespace Ship \ No newline at end of file diff --git a/soh/soh/resource/type/Scene.cpp b/soh/soh/resource/type/Scene.cpp new file mode 100644 index 000000000..947095480 --- /dev/null +++ b/soh/soh/resource/type/Scene.cpp @@ -0,0 +1,12 @@ +#include "Scene.h" + +namespace Ship { +void* Scene::GetPointer() { + // Scene is a special type that requries C++ processing. As such, we return nothing. + return nullptr; +} + +size_t Scene::GetPointerSize() { + return 0; +} +} // namespace Ship diff --git a/soh/soh/resource/type/Scene.h b/soh/soh/resource/type/Scene.h new file mode 100644 index 000000000..349f9add8 --- /dev/null +++ b/soh/soh/resource/type/Scene.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include "scenecommand/SceneCommand.h" +#include + +namespace Ship { + +class Scene : public Resource { +public: + void* GetPointer(); + size_t GetPointerSize(); + + std::vector> commands; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/Skeleton.cpp b/soh/soh/resource/type/Skeleton.cpp new file mode 100644 index 000000000..137041c67 --- /dev/null +++ b/soh/soh/resource/type/Skeleton.cpp @@ -0,0 +1,20 @@ +#include "Skeleton.h" + +namespace Ship { +void* Skeleton::GetPointer() { + return &skeletonData; +} + +size_t Skeleton::GetPointerSize() { + switch(type) { + case SkeletonType::Normal: + return sizeof(skeletonData.skeletonHeader); + case SkeletonType::Flex: + return sizeof(skeletonData.flexSkeletonHeader); + case SkeletonType::Curve: + return sizeof(skeletonData.skelCurveLimbList); + default: + return 0; + } +} +} // namespace Ship diff --git a/soh/soh/resource/type/Skeleton.h b/soh/soh/resource/type/Skeleton.h new file mode 100644 index 000000000..e34b0b071 --- /dev/null +++ b/soh/soh/resource/type/Skeleton.h @@ -0,0 +1,69 @@ +#pragma once + +#include +#include "Resource.h" +#include "SkeletonLimb.h" + +namespace Ship { + +enum class SkeletonType { + Normal, + Flex, + Curve, +}; + +// typedef struct { +// /* 0x00 */ Vec3s jointPos; // Root is position in model space, children are relative to parent +// /* 0x06 */ u8 child; +// /* 0x07 */ u8 sibling; +// /* 0x08 */ Gfx* dList; +// } StandardLimb; // size = 0xC + +// Model has limbs with only rigid meshes +typedef struct { + /* 0x00 */ void** segment; + /* 0x04 */ uint8_t limbCount; +} SkeletonHeader; // size = 0x8 + +// Model has limbs with flexible meshes +typedef struct { + /* 0x00 */ SkeletonHeader sh; + /* 0x08 */ uint8_t dListCount; +} FlexSkeletonHeader; // size = 0xC + +// typedef struct { +// /* 0x0000 */ u8 firstChildIdx; +// /* 0x0001 */ u8 nextLimbIdx; +// /* 0x0004 */ Gfx* dList[2]; +// } SkelCurveLimb; // size = 0xC + +typedef struct { + /* 0x0000 */ SkelCurveLimb** limbs; + /* 0x0004 */ uint8_t limbCount; +} SkelCurveLimbList; // size = 0x8 + +union SkeletonData { + SkeletonHeader skeletonHeader; + FlexSkeletonHeader flexSkeletonHeader; + SkelCurveLimbList skelCurveLimbList; +}; + +class Skeleton : public Resource { + public: + void* GetPointer(); + size_t GetPointerSize(); + + SkeletonType type; + SkeletonData skeletonData; + + LimbType limbType; + int limbCount; + int dListCount; + LimbType limbTableType; + int limbTableCount; + std::vector standardLimbArray; + std::vector curveLimbArray; + std::vector limbTable; + std::vector skeletonHeaderSegments; +}; +} // namespace Ship \ No newline at end of file diff --git a/soh/soh/resource/type/SkeletonLimb.cpp b/soh/soh/resource/type/SkeletonLimb.cpp new file mode 100644 index 000000000..dc3244b11 --- /dev/null +++ b/soh/soh/resource/type/SkeletonLimb.cpp @@ -0,0 +1,24 @@ +#include "SkeletonLimb.h" + +namespace Ship { +void* SkeletonLimb::GetPointer() { + return &limbData; +} + +size_t SkeletonLimb::GetPointerSize() { + switch(limbType) { + case LimbType::Standard: + return sizeof(limbData.standardLimb); + case LimbType::LOD: + return sizeof(limbData.lodLimb); + case LimbType::Skin: + return sizeof(limbData.skinLimb); + case LimbType::Curve: + return sizeof(limbData.skelCurveLimb); + case LimbType::Invalid: + case LimbType::Legacy: + default: + return 0; + } +} +} // namespace Ship diff --git a/soh/soh/resource/type/SkeletonLimb.h b/soh/soh/resource/type/SkeletonLimb.h new file mode 100644 index 000000000..a039d40da --- /dev/null +++ b/soh/soh/resource/type/SkeletonLimb.h @@ -0,0 +1,130 @@ +#pragma once + +#include "Resource.h" +#include "libultraship/libultra.h" +#include "z64math.h" + +namespace Ship { +enum class LimbType { + Invalid, + Standard, + LOD, + Skin, + Curve, + Legacy, +}; + +enum class ZLimbSkinType +{ + SkinType_0, // Segment = 0 + SkinType_4 = 4, // Segment = segmented address // Struct_800A5E28 + SkinType_5 = 5, // Segment = 0 + SkinType_DList = 11, // Segment = DList address +}; + +/** + * Holds a compact version of a vertex used in the Skin system + * It is used to initialise the Vtx used by an animated limb + */ +typedef struct { + /* 0x00 */ u16 index; + /* 0x02 */ s16 s; // s and t are texture coordinates (also known as u and v) + /* 0x04 */ s16 t; + /* 0x06 */ s8 normX; + /* 0x07 */ s8 normY; + /* 0x08 */ s8 normZ; + /* 0x09 */ u8 alpha; +} SkinVertex; // size = 0xA + +/** + * Describes a position displacement and a scale to be applied to a limb at index `limbIndex` + */ +typedef struct { + /* 0x00 */ u8 limbIndex; + /* 0x02 */ s16 x; + /* 0x04 */ s16 y; + /* 0x06 */ s16 z; + /* 0x08 */ u8 scale; +} SkinTransformation; // size = 0xA + +typedef struct { + /* 0x00 */ u16 vtxCount; // number of vertices in this modif entry + /* 0x02 */ u16 transformCount; + /* 0x04 */ u16 unk_4; // index of limbTransformations? + /* 0x08 */ SkinVertex* skinVertices; + /* 0x0C */ SkinTransformation* limbTransformations; +} SkinLimbModif; // size = 0x10 + +typedef struct { + /* 0x00 */ Vec3s jointPos; // Root is position in model space, children are relative to parent + /* 0x06 */ u8 child; + /* 0x07 */ u8 sibling; + /* 0x08 */ Gfx* dLists[2]; // Near and far +} LodLimb; // size = 0x10 + +typedef struct { + /* 0x00 */ Vec3s jointPos; // Root is position in model space, children are relative to parent + /* 0x06 */ u8 child; + /* 0x07 */ u8 sibling; + /* 0x08 */ Gfx* dList; +} StandardLimb; // size = 0xC + +typedef struct { + /* 0x0000 */ u8 firstChildIdx; + /* 0x0001 */ u8 nextLimbIdx; + /* 0x0004 */ Gfx* dList[2]; +} SkelCurveLimb; // size = 0xC + +typedef struct { + /* 0x00 */ Vec3s jointPos; // Root is position in model space, children are relative to parent + /* 0x06 */ u8 child; + /* 0x07 */ u8 sibling; + /* 0x08 */ s32 segmentType; // Type of data contained in segment + /* 0x0C */ void* segment; // Gfx* if segmentType is SKIN_LIMB_TYPE_NORMAL, SkinAnimatedLimbData* if segmentType is SKIN_LIMB_TYPE_ANIMATED, NULL otherwise +} SkinLimb; // size = 0x10 + +typedef struct { + /* 0x00 */ u16 totalVtxCount; // total vertex count for all modif entries + /* 0x02 */ u16 limbModifCount; + /* 0x04 */ SkinLimbModif* limbModifications; + /* 0x08 */ Gfx* dlist; +} SkinAnimatedLimbData; // size = 0xC + +union SkeletonLimbData { + LodLimb lodLimb; + StandardLimb standardLimb; + SkelCurveLimb skelCurveLimb; + SkinLimb skinLimb; +}; + +class SkeletonLimb : public Resource { +public: + void* GetPointer(); + size_t GetPointerSize(); + + LimbType limbType; + SkeletonLimbData limbData; + + ZLimbSkinType skinSegmentType; + uint16_t skinVtxCnt; + SkinAnimatedLimbData skinAnimLimbData; + + std::string skinDataDList; + std::string skinDList; + std::string skinDList2; + + float legTransX, legTransY, legTransZ; // Vec3f + uint16_t rotX, rotY, rotZ; // Vec3s + + std::string childPtr, siblingPtr, dListPtr, dList2Ptr; + + int16_t transX, transY, transZ; + uint8_t childIndex, siblingIndex; + + uint32_t skinLimbModifCount; + std::vector skinLimbModifArray; + + std::vector> skinLimbModifVertexArrays; + std::vector> skinLimbModifTransformationArrays; +}; +} // namespace Ship \ No newline at end of file diff --git a/soh/soh/resource/type/Text.cpp b/soh/soh/resource/type/Text.cpp new file mode 100644 index 000000000..8fb34ecab --- /dev/null +++ b/soh/soh/resource/type/Text.cpp @@ -0,0 +1,11 @@ +#include "Text.h" + +namespace Ship { +void* Text::GetPointer() { + return messages.data(); +} + +size_t Text::GetPointerSize() { + return messages.size() * sizeof(MessageEntry); +} +} // namespace Ship diff --git a/soh/soh/resource/type/Text.h b/soh/soh/resource/type/Text.h new file mode 100644 index 000000000..0454af756 --- /dev/null +++ b/soh/soh/resource/type/Text.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include +#include "Resource.h" +#include + +namespace Ship { +// TODO: we've moved away from using classes for this stuff +class MessageEntry +{ +public: + uint16_t id; + uint8_t textboxType; + uint8_t textboxYPos; + std::string msg; +}; + +class Text : public Resource { +public: + void* GetPointer(); + size_t GetPointerSize(); + + std::vector messages; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/EndMarker.cpp b/soh/soh/resource/type/scenecommand/EndMarker.cpp new file mode 100644 index 000000000..fcea5c301 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/EndMarker.cpp @@ -0,0 +1,11 @@ +#include "EndMarker.h" + +namespace Ship { +void* EndMarker::GetPointer() { + return &endMarker; +} + +size_t EndMarker::GetPointerSize() { + return sizeof(Marker); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/EndMarker.h b/soh/soh/resource/type/scenecommand/EndMarker.h new file mode 100644 index 000000000..b836f5c05 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/EndMarker.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include + +namespace Ship { +typedef struct { + +} Marker; + +class EndMarker : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + Marker endMarker; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/RomFile.h b/soh/soh/resource/type/scenecommand/RomFile.h new file mode 100644 index 000000000..9decec5f1 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/RomFile.h @@ -0,0 +1,11 @@ +#pragma once + +#include + +namespace Ship { + typedef struct { + /* 0x00 */ uintptr_t vromStart; + /* 0x04 */ uintptr_t vromEnd; + char* fileName; + } RomFile; // size = 0x8 +} \ No newline at end of file diff --git a/soh/soh/resource/type/scenecommand/SceneCommand.h b/soh/soh/resource/type/scenecommand/SceneCommand.h new file mode 100644 index 000000000..6b9674b0e --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SceneCommand.h @@ -0,0 +1,55 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include + +namespace Ship { + +enum class SceneCommandID : uint8_t { + SetStartPositionList = 0x00, + SetActorList = 0x01, + SetCsCamera = 0x02, + SetCollisionHeader = 0x03, + SetRoomList = 0x04, + SetWind = 0x05, + SetEntranceList = 0x06, + SetSpecialObjects = 0x07, + SetRoomBehavior = 0x08, + Unused09 = 0x09, + SetMesh = 0x0A, + SetObjectList = 0x0B, + SetLightList = 0x0C, + SetPathways = 0x0D, + SetTransitionActorList = 0x0E, + SetLightingSettings = 0x0F, + SetTimeSettings = 0x10, + SetSkyboxSettings = 0x11, + SetSkyboxModifier = 0x12, + SetExitList = 0x13, + EndMarker = 0x14, + SetSoundSettings = 0x15, + SetEchoSettings = 0x16, + SetCutscenes = 0x17, + SetAlternateHeaders = 0x18, + SetCameraSettings = 0x19, + + // MM Commands + SetWorldMapVisited = 0x19, + SetAnimatedMaterialList = 0x1A, + SetActorCutsceneList = 0x1B, + SetMinimapList = 0x1C, + Unused1D = 0x1D, + SetMinimapChests = 0x1E, + + Error = 0xFF +}; + +class SceneCommand : public Resource { +public: + SceneCommandID cmdId; +}; + +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetActorList.cpp b/soh/soh/resource/type/scenecommand/SetActorList.cpp new file mode 100644 index 000000000..3ab415eb6 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetActorList.cpp @@ -0,0 +1,11 @@ +#include "SetActorList.h" + +namespace Ship { +void* SetActorList::GetPointer() { + return actorList.data(); +} + +size_t SetActorList::GetPointerSize() { + return actorList.size() * sizeof(ActorEntry); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetActorList.h b/soh/soh/resource/type/scenecommand/SetActorList.h new file mode 100644 index 000000000..a878c260e --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetActorList.h @@ -0,0 +1,28 @@ +#pragma once + +#include +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +// #include +#include "z64math.h" + +namespace Ship { +typedef struct { + /* 0x00 */ s16 id; + /* 0x02 */ Vec3s pos; + /* 0x08 */ Vec3s rot; + /* 0x0E */ s16 params; +} ActorEntry; // size = 0x10 + +class SetActorList : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + uint32_t numActors; + std::vector actorList; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetAlternateHeaders.cpp b/soh/soh/resource/type/scenecommand/SetAlternateHeaders.cpp new file mode 100644 index 000000000..04538d4b7 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetAlternateHeaders.cpp @@ -0,0 +1,12 @@ +#include "SetAlternateHeaders.h" + +namespace Ship { +void* SetAlternateHeaders::GetPointer() { + // Like Scene, SetAlternateHeader is a special type that is only acted upon in C++. + return nullptr; +} + +size_t SetAlternateHeaders::GetPointerSize() { + return 0; +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetAlternateHeaders.h b/soh/soh/resource/type/scenecommand/SetAlternateHeaders.h new file mode 100644 index 000000000..bddf6486d --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetAlternateHeaders.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include "soh/resource/type/Scene.h" +#include "RomFile.h" +#include + + +namespace Ship { + +class SetAlternateHeaders : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + uint32_t numHeaders; + std::vector> headers; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetCameraSettings.cpp b/soh/soh/resource/type/scenecommand/SetCameraSettings.cpp new file mode 100644 index 000000000..05162bbef --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetCameraSettings.cpp @@ -0,0 +1,11 @@ +#include "SetCameraSettings.h" + +namespace Ship { +void* SetCameraSettings::GetPointer() { + return &settings; +} + +size_t SetCameraSettings::GetPointerSize() { + return sizeof(CameraSettings); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetCameraSettings.h b/soh/soh/resource/type/scenecommand/SetCameraSettings.h new file mode 100644 index 000000000..efd6edd56 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetCameraSettings.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include + +namespace Ship { +typedef struct { + int8_t cameraMovement; + int32_t worldMapArea; +} CameraSettings; + +class SetCameraSettings : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + CameraSettings settings; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetCollisionHeader.cpp b/soh/soh/resource/type/scenecommand/SetCollisionHeader.cpp new file mode 100644 index 000000000..c8eef0d5c --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetCollisionHeader.cpp @@ -0,0 +1,17 @@ +#include "SetCollisionHeader.h" + +namespace Ship { +void* SetCollisionHeader::GetPointer() { + if (collisionHeader == nullptr) { + return nullptr; + } + return collisionHeader->GetPointer(); +} + +size_t SetCollisionHeader::GetPointerSize() { + if (collisionHeader == nullptr) { + return 0; + } + return collisionHeader->GetPointerSize(); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetCollisionHeader.h b/soh/soh/resource/type/scenecommand/SetCollisionHeader.h new file mode 100644 index 000000000..88cbdf7d6 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetCollisionHeader.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include +#include +#include +#include "Resource.h" +#include "soh/resource/type/scenecommand/SceneCommand.h" +#include "soh/resource/type/CollisionHeader.h" +// #include + +namespace Ship { +class SetCollisionHeader : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + std::string fileName; + + std::shared_ptr collisionHeader; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetCsCamera.cpp b/soh/soh/resource/type/scenecommand/SetCsCamera.cpp new file mode 100644 index 000000000..53b509a3e --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetCsCamera.cpp @@ -0,0 +1,11 @@ +#include "SetCsCamera.h" + +namespace Ship { +void* SetCsCamera::GetPointer() { + return &csCamera; +} + +size_t SetCsCamera::GetPointerSize() { + return sizeof(CsCamera); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetCsCamera.h b/soh/soh/resource/type/scenecommand/SetCsCamera.h new file mode 100644 index 000000000..132b76413 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetCsCamera.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include + +namespace Ship { +typedef struct { + +} CsCamera; + +class SetCsCamera : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + CsCamera csCamera; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetCutscenes.cpp b/soh/soh/resource/type/scenecommand/SetCutscenes.cpp new file mode 100644 index 000000000..4b571af7b --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetCutscenes.cpp @@ -0,0 +1,17 @@ +#include "SetCutscenes.h" + +namespace Ship { +void* SetCutscenes::GetPointer() { + if (cutscene == nullptr) { + return nullptr; + } + return cutscene->GetPointer(); +} + +size_t SetCutscenes::GetPointerSize() { + if (cutscene == nullptr) { + return 0; + } + return cutscene->GetPointerSize(); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetCutscenes.h b/soh/soh/resource/type/scenecommand/SetCutscenes.h new file mode 100644 index 000000000..0fc91180c --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetCutscenes.h @@ -0,0 +1,21 @@ +#pragma once + +#include +#include +#include +#include +#include "Resource.h" +#include "soh/resource/type/scenecommand/SceneCommand.h" +#include "soh/resource/type/Cutscene.h" +// #include + +namespace Ship { +class SetCutscenes : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + std::string fileName; + std::shared_ptr cutscene; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetEchoSettings.cpp b/soh/soh/resource/type/scenecommand/SetEchoSettings.cpp new file mode 100644 index 000000000..f13ef97b7 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetEchoSettings.cpp @@ -0,0 +1,11 @@ +#include "SetEchoSettings.h" + +namespace Ship { +void* SetEchoSettings::GetPointer() { + return &settings; +} + +size_t SetEchoSettings::GetPointerSize() { + return sizeof(EchoSettings); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetEchoSettings.h b/soh/soh/resource/type/scenecommand/SetEchoSettings.h new file mode 100644 index 000000000..36244b5ae --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetEchoSettings.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include + +namespace Ship { +typedef struct { + int8_t echo; +} EchoSettings; + +class SetEchoSettings : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + EchoSettings settings; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetEntranceList.cpp b/soh/soh/resource/type/scenecommand/SetEntranceList.cpp new file mode 100644 index 000000000..34b4ae5e1 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetEntranceList.cpp @@ -0,0 +1,11 @@ +#include "SetEntranceList.h" + +namespace Ship { +void* SetEntranceList::GetPointer() { + return entrances.data(); +} + +size_t SetEntranceList::GetPointerSize() { + return entrances.size() * sizeof(EntranceEntry); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetEntranceList.h b/soh/soh/resource/type/scenecommand/SetEntranceList.h new file mode 100644 index 000000000..4c1c4c93a --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetEntranceList.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include + +namespace Ship { +typedef struct { + /* 0x00 */ u8 spawn; + /* 0x01 */ u8 room; +} EntranceEntry; + +class SetEntranceList : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + uint32_t numEntrances; + + std::vector entrances; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetExitList.cpp b/soh/soh/resource/type/scenecommand/SetExitList.cpp new file mode 100644 index 000000000..eea06b6c5 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetExitList.cpp @@ -0,0 +1,11 @@ +#include "SetExitList.h" + +namespace Ship { +void* SetExitList::GetPointer() { + return exits.data(); +} + +size_t SetExitList::GetPointerSize() { + return exits.size() * sizeof(int16_t); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetExitList.h b/soh/soh/resource/type/scenecommand/SetExitList.h new file mode 100644 index 000000000..652e3c8c8 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetExitList.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include + +namespace Ship { +class SetExitList : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + uint32_t numExits; + + std::vector exits; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetLightList.cpp b/soh/soh/resource/type/scenecommand/SetLightList.cpp new file mode 100644 index 000000000..3ae6c6d0c --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetLightList.cpp @@ -0,0 +1,11 @@ +#include "SetLightList.h" + +namespace Ship { +void* SetLightList::GetPointer() { + return lightList.data(); +} + +size_t SetLightList::GetPointerSize() { + return lightList.size() * sizeof(LightInfo); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetLightList.h b/soh/soh/resource/type/scenecommand/SetLightList.h new file mode 100644 index 000000000..38448cc0e --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetLightList.h @@ -0,0 +1,46 @@ +#pragma once + +#include +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include + +namespace Ship { +typedef struct { + /* 0x0 */ s16 x; + /* 0x2 */ s16 y; + /* 0x4 */ s16 z; + /* 0x6 */ u8 color[3]; + /* 0x9 */ u8 drawGlow; + /* 0xA */ s16 radius; +} LightPoint; // size = 0xC + +typedef struct { + /* 0x0 */ s8 x; + /* 0x1 */ s8 y; + /* 0x2 */ s8 z; + /* 0x3 */ u8 color[3]; +} LightDirectional; // size = 0x6 + +typedef union { + LightPoint point; + LightDirectional dir; +} LightParams; // size = 0xC + +typedef struct { + /* 0x0 */ u8 type; + /* 0x2 */ LightParams params; +} LightInfo; // size = 0xE + +class SetLightList : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + uint32_t numLights; + std::vector lightList; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetLightingSettings.cpp b/soh/soh/resource/type/scenecommand/SetLightingSettings.cpp new file mode 100644 index 000000000..0bf3b852c --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetLightingSettings.cpp @@ -0,0 +1,11 @@ +#include "SetLightingSettings.h" + +namespace Ship { +void* SetLightingSettings::GetPointer() { + return settings.data(); +} + +size_t SetLightingSettings::GetPointerSize() { + return settings.size() * sizeof(EnvLightSettings); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetLightingSettings.h b/soh/soh/resource/type/scenecommand/SetLightingSettings.h new file mode 100644 index 000000000..58ee02298 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetLightingSettings.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include + +namespace Ship { +typedef struct { + /* 0x00 */ u8 ambientColor[3]; + /* 0x03 */ s8 light1Dir[3]; + /* 0x06 */ u8 light1Color[3]; + /* 0x09 */ s8 light2Dir[3]; + /* 0x0C */ u8 light2Color[3]; + /* 0x0F */ u8 fogColor[3]; + /* 0x12 */ s16 fogNear; + /* 0x14 */ s16 fogFar; +} EnvLightSettings; // size = 0x16 + +class SetLightingSettings : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + std::vector settings; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetMesh.cpp b/soh/soh/resource/type/scenecommand/SetMesh.cpp new file mode 100644 index 000000000..3c7c131b2 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetMesh.cpp @@ -0,0 +1,11 @@ +#include "SetMesh.h" + +namespace Ship { +void* SetMesh::GetPointer() { + return &meshHeader; +} + +size_t SetMesh::GetPointerSize() { + return sizeof(MeshHeader); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetMesh.h b/soh/soh/resource/type/scenecommand/SetMesh.h new file mode 100644 index 000000000..60b62de29 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetMesh.h @@ -0,0 +1,100 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include "libultraship/libultra.h" +#include "z64math.h" + +namespace Ship { +typedef struct { + /* 0x00 */ u8 type; +} PolygonBase; + +typedef struct { + /* 0x00 */ PolygonBase base; + /* 0x01 */ u8 num; // number of dlist entries + /* 0x04 */ void* start; + /* 0x08 */ void* end; +} PolygonType0; // size = 0xC + +typedef struct { + /* 0x00 */ u16 unk_00; + /* 0x02 */ u8 id; + /* 0x04 */ void* source; + /* 0x08 */ u32 unk_0C; + /* 0x0C */ u32 tlut; + /* 0x10 */ u16 width; + /* 0x12 */ u16 height; + /* 0x14 */ u8 fmt; + /* 0x15 */ u8 siz; + /* 0x16 */ u16 mode0; + /* 0x18 */ u16 tlutCount; +} BgImage; // size = 0x1C + +typedef struct { + /* 0x00 */ PolygonBase base; + /* 0x01 */ u8 format; // 1 = single, 2 = multi + /* 0x04 */ Gfx* dlist; + union { + struct { + /* 0x08 */ void* source; + /* 0x0C */ u32 unk_0C; + /* 0x10 */ void* tlut; + /* 0x14 */ u16 width; + /* 0x16 */ u16 height; + /* 0x18 */ u8 fmt; + /* 0x19 */ u8 siz; + /* 0x1A */ u16 mode0; + /* 0x1C */ u16 tlutCount; + } single; + struct { + /* 0x08 */ u8 count; + /* 0x0C */ BgImage* list; + } multi; + }; +} PolygonType1; + +typedef struct { + /* 0x00 */ PolygonBase base; + /* 0x01 */ u8 num; // number of dlist entries + /* 0x04 */ void* start; + /* 0x08 */ void* end; +} PolygonType2; // size = 0xC + +typedef union { + PolygonBase base; + PolygonType0 polygon0; + PolygonType1 polygon1; + PolygonType2 polygon2; +} MeshHeader; // "Ground Shape" + +typedef struct { + /* 0x00 */ Vec3s pos; + /* 0x06 */ s16 unk_06; + /* 0x08 */ Gfx* opa; + /* 0x0C */ Gfx* xlu; +} PolygonDlist2; // size = 0x8 + +typedef struct { + /* 0x00 */ Gfx* opa; + /* 0x04 */ Gfx* xlu; +} PolygonDlist; // size = 0x8 + +class SetMesh : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + uint32_t numPoly; + uint8_t data; + uint8_t meshHeaderType; + + std::vector dlists; + std::vector dlists2; + std::vector images; + MeshHeader meshHeader; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetObjectList.cpp b/soh/soh/resource/type/scenecommand/SetObjectList.cpp new file mode 100644 index 000000000..df5746668 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetObjectList.cpp @@ -0,0 +1,11 @@ +#include "SetObjectList.h" + +namespace Ship { +void* SetObjectList::GetPointer() { + return objects.data(); +} + +size_t SetObjectList::GetPointerSize() { + return objects.size() * sizeof(int16_t); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetObjectList.h b/soh/soh/resource/type/scenecommand/SetObjectList.h new file mode 100644 index 000000000..de2a13007 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetObjectList.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include + +namespace Ship { +class SetObjectList : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + uint32_t numObjects; + std::vector objects; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetPathways.cpp b/soh/soh/resource/type/scenecommand/SetPathways.cpp new file mode 100644 index 000000000..649391c4d --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetPathways.cpp @@ -0,0 +1,11 @@ +#include "SetPathways.h" + +namespace Ship { +void* SetPathways::GetPointer() { + return paths.data(); +} + +size_t SetPathways::GetPointerSize() { + return paths.size() * sizeof(std::shared_ptr); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetPathways.h b/soh/soh/resource/type/scenecommand/SetPathways.h new file mode 100644 index 000000000..1c96d8bb6 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetPathways.h @@ -0,0 +1,21 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +// #include +#include "soh/resource/type/Path.h" + +namespace Ship { + +class SetPathways : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + uint32_t numPaths; + std::vector> paths; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetRoomBehavior.cpp b/soh/soh/resource/type/scenecommand/SetRoomBehavior.cpp new file mode 100644 index 000000000..4e9c63db6 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetRoomBehavior.cpp @@ -0,0 +1,11 @@ +#include "SetRoomBehavior.h" + +namespace Ship { +void* SetRoomBehavior::GetPointer() { + return &roomBehavior; +} + +size_t SetRoomBehavior::GetPointerSize() { + return sizeof(RoomBehavior); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetRoomBehavior.h b/soh/soh/resource/type/scenecommand/SetRoomBehavior.h new file mode 100644 index 000000000..f2f95b620 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetRoomBehavior.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include + +namespace Ship { +typedef struct { + int8_t gameplayFlags; + int32_t gameplayFlags2; +} RoomBehavior; + +class SetRoomBehavior : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + RoomBehavior roomBehavior; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetRoomList.cpp b/soh/soh/resource/type/scenecommand/SetRoomList.cpp new file mode 100644 index 000000000..1bc692461 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetRoomList.cpp @@ -0,0 +1,11 @@ +#include "SetRoomList.h" + +namespace Ship { +void* SetRoomList::GetPointer() { + return rooms.data(); +} + +size_t SetRoomList::GetPointerSize() { + return rooms.size() * sizeof(RomFile); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetRoomList.h b/soh/soh/resource/type/scenecommand/SetRoomList.h new file mode 100644 index 000000000..5c998abb7 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetRoomList.h @@ -0,0 +1,30 @@ +#pragma once + +#include +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include "RomFile.h" +#include + + +namespace Ship { +// typedef struct { +// /* 0x00 */ uintptr_t vromStart; +// /* 0x04 */ uintptr_t vromEnd; +// char* fileName; +// } RomFile; // size = 0x8 + +class SetRoomList : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + uint32_t numRooms; + + std::vector fileNames; + std::vector rooms; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetSkyboxModifier.cpp b/soh/soh/resource/type/scenecommand/SetSkyboxModifier.cpp new file mode 100644 index 000000000..302ac2667 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetSkyboxModifier.cpp @@ -0,0 +1,11 @@ +#include "SetSkyboxModifier.h" + +namespace Ship { +void* SetSkyboxModifier::GetPointer() { + return &modifier; +} + +size_t SetSkyboxModifier::GetPointerSize() { + return sizeof(SkyboxModifier); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetSkyboxModifier.h b/soh/soh/resource/type/scenecommand/SetSkyboxModifier.h new file mode 100644 index 000000000..7aa2ecfee --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetSkyboxModifier.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include + +namespace Ship { +typedef struct { + uint8_t skyboxDisabled; + uint8_t sunMoonDisabled; +} SkyboxModifier; + +class SetSkyboxModifier : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + SkyboxModifier modifier; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetSkyboxSettings.cpp b/soh/soh/resource/type/scenecommand/SetSkyboxSettings.cpp new file mode 100644 index 000000000..77f7bad88 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetSkyboxSettings.cpp @@ -0,0 +1,11 @@ +#include "SetSkyboxSettings.h" + +namespace Ship { +void* SetSkyboxSettings::GetPointer() { + return &settings; +} + +size_t SetSkyboxSettings::GetPointerSize() { + return sizeof(SetSkyboxSettings); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetSkyboxSettings.h b/soh/soh/resource/type/scenecommand/SetSkyboxSettings.h new file mode 100644 index 000000000..82bfc6e9e --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetSkyboxSettings.h @@ -0,0 +1,25 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include + +namespace Ship { +typedef struct { + uint8_t unk; + uint8_t skyboxId; + uint8_t weather; + uint8_t indoors; +} SkyboxSettings; + +class SetSkyboxSettings : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + SkyboxSettings settings; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetSoundSettings.cpp b/soh/soh/resource/type/scenecommand/SetSoundSettings.cpp new file mode 100644 index 000000000..2787442e4 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetSoundSettings.cpp @@ -0,0 +1,11 @@ +#include "SetSoundSettings.h" + +namespace Ship { +void* SetSoundSettings::GetPointer() { + return &settings; +} + +size_t SetSoundSettings::GetPointerSize() { + return sizeof(SoundSettings); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetSoundSettings.h b/soh/soh/resource/type/scenecommand/SetSoundSettings.h new file mode 100644 index 000000000..27824e2ab --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetSoundSettings.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include + +namespace Ship { +typedef struct { + uint8_t seqId; + uint8_t natureAmbienceId; + uint8_t reverb; +} SoundSettings; + +class SetSoundSettings : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + SoundSettings settings; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetSpecialObjects.cpp b/soh/soh/resource/type/scenecommand/SetSpecialObjects.cpp new file mode 100644 index 000000000..8b7ed90e9 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetSpecialObjects.cpp @@ -0,0 +1,11 @@ +#include "SetSpecialObjects.h" + +namespace Ship { +void* SetSpecialObjects::GetPointer() { + return &specialObjects; +} + +size_t SetSpecialObjects::GetPointerSize() { + return sizeof(SpecialObjects); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetSpecialObjects.h b/soh/soh/resource/type/scenecommand/SetSpecialObjects.h new file mode 100644 index 000000000..723b7256c --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetSpecialObjects.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include + +namespace Ship { +typedef struct { + int8_t elfMessage; + int16_t globalObject; +} SpecialObjects; + +class SetSpecialObjects : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + SpecialObjects specialObjects; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetStartPositionList.cpp b/soh/soh/resource/type/scenecommand/SetStartPositionList.cpp new file mode 100644 index 000000000..d162d7e7e --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetStartPositionList.cpp @@ -0,0 +1,11 @@ +#include "SetStartPositionList.h" + +namespace Ship { +void* SetStartPositionList::GetPointer() { + return startPositions.data(); +} + +size_t SetStartPositionList::GetPointerSize() { + return startPositions.size() * sizeof(ActorEntry); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetStartPositionList.h b/soh/soh/resource/type/scenecommand/SetStartPositionList.h new file mode 100644 index 000000000..d649800c9 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetStartPositionList.h @@ -0,0 +1,28 @@ +#pragma once + +#include +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include "soh/resource/type/scenecommand/SetActorList.h" +// #include + +namespace Ship { +// typedef struct { +// /* 0x00 */ s16 id; +// /* 0x02 */ Vec3s pos; +// /* 0x08 */ Vec3s rot; +// /* 0x0E */ s16 params; +// } ActorEntry; // size = 0x10 + +class SetStartPositionList : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + uint32_t numStartPositions; + std::vector startPositions; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetTimeSettings.cpp b/soh/soh/resource/type/scenecommand/SetTimeSettings.cpp new file mode 100644 index 000000000..d5b56c39f --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetTimeSettings.cpp @@ -0,0 +1,11 @@ +#include "SetTimeSettings.h" + +namespace Ship { +void* SetTimeSettings::GetPointer() { + return &settings; +} + +size_t SetTimeSettings::GetPointerSize() { + return sizeof(TimeSettings); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetTimeSettings.h b/soh/soh/resource/type/scenecommand/SetTimeSettings.h new file mode 100644 index 000000000..0e4b25673 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetTimeSettings.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include + +namespace Ship { +typedef struct { + uint8_t hour; + uint8_t minute; + uint8_t timeIncrement; +} TimeSettings; + +class SetTimeSettings : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + TimeSettings settings; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetTransitionActorList.cpp b/soh/soh/resource/type/scenecommand/SetTransitionActorList.cpp new file mode 100644 index 000000000..7b40b35cc --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetTransitionActorList.cpp @@ -0,0 +1,11 @@ +#include "SetTransitionActorList.h" + +namespace Ship { +void* SetTransitionActorList::GetPointer() { + return transitionActorList.data(); +} + +size_t SetTransitionActorList::GetPointerSize() { + return transitionActorList.size() * sizeof(TransitionActorEntry); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetTransitionActorList.h b/soh/soh/resource/type/scenecommand/SetTransitionActorList.h new file mode 100644 index 000000000..0c08e0dcb --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetTransitionActorList.h @@ -0,0 +1,32 @@ +#pragma once + +#include +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +// #include +#include "z64math.h" + +namespace Ship { +typedef struct { + struct { + s8 room; // Room to switch to + s8 effects; // How the camera reacts during the transition + } /* 0x00 */ sides[2]; // 0 = front, 1 = back + /* 0x04 */ s16 id; + /* 0x06 */ Vec3s pos; + /* 0x0C */ s16 rotY; + /* 0x0E */ s16 params; +} TransitionActorEntry; // size = 0x10 + +class SetTransitionActorList : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + uint32_t numTransitionActors; + std::vector transitionActorList; +}; +}; // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetWindSettings.cpp b/soh/soh/resource/type/scenecommand/SetWindSettings.cpp new file mode 100644 index 000000000..817ef301d --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetWindSettings.cpp @@ -0,0 +1,11 @@ +#include "SetWindSettings.h" + +namespace Ship { +void* SetWindSettings::GetPointer() { + return &settings; +} + +size_t SetWindSettings::GetPointerSize() { + return sizeof(WindSettings); +} +} // namespace Ship diff --git a/soh/soh/resource/type/scenecommand/SetWindSettings.h b/soh/soh/resource/type/scenecommand/SetWindSettings.h new file mode 100644 index 000000000..b51bdf839 --- /dev/null +++ b/soh/soh/resource/type/scenecommand/SetWindSettings.h @@ -0,0 +1,25 @@ +#pragma once + +#include +#include +#include +#include "Resource.h" +#include "SceneCommand.h" +#include + +namespace Ship { +typedef struct { + int8_t windWest; + int8_t windVertical; + int8_t windSouth; + int8_t windSpeed; +} WindSettings; + +class SetWindSettings : public SceneCommand { + public: + void* GetPointer(); + size_t GetPointerSize(); + + WindSettings settings; +}; +}; // namespace Ship diff --git a/soh/soh/stubs.c b/soh/soh/stubs.c index 10a865d1e..9afd93468 100644 --- a/soh/soh/stubs.c +++ b/soh/soh/stubs.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include #include #include "z64.h" @@ -31,36 +31,6 @@ f32 qNaN0x10000 = 0x7F810000; // __gSPTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy); //} -void osCreateMesgQueue(OSMesgQueue* mq, OSMesg* msgBuf, s32 count) { - mq->validCount = 0; - mq->first = 0; - mq->msgCount = count; - mq->msg = msgBuf; - return; -} - -s32 osSendMesg(OSMesgQueue* mq, OSMesg msg, s32 flag) { - s32 index; - if (mq->validCount >= mq->msgCount) { - return -1; - } - index = (mq->first + mq->validCount) % mq->msgCount; - mq->msg[index] = msg; - mq->validCount++; - return 0; -} -s32 osRecvMesg(OSMesgQueue* mq, OSMesg* msg, s32 flag) { - if (mq->validCount == 0) { - return -1; - } - if (msg != NULL) { - *msg = *(mq->first + mq->msg); - } - mq->first = (mq->first + 1) % mq->msgCount; - mq->validCount--; - return 0; -} - s32 osJamMesg(OSMesgQueue* mq, OSMesg msg, s32 flag) { } @@ -442,4 +412,4 @@ OSYieldResult osSpTaskYielded(OSTask* task) void osViExtendVStart(u32 arg0) { -} \ No newline at end of file +} diff --git a/soh/soh/z_message_OTR.cpp b/soh/soh/z_message_OTR.cpp index 894bcab85..8b04b73b3 100644 --- a/soh/soh/z_message_OTR.cpp +++ b/soh/soh/z_message_OTR.cpp @@ -1,10 +1,10 @@ #include "OTRGlobals.h" #include -#include +#include "soh/resource/type/Scene.h" #include #include "global.h" #include "vt.h" -#include +#include "soh/resource/type/Text.h" #include #include "Enhancements/custom-message/CustomMessageManager.h" #include "Enhancements/custom-message/CustomMessageTypes.h" @@ -24,7 +24,7 @@ MessageTableEntry* OTRMessage_LoadTable(const char* filePath, bool isNES) { // Allocate room for an additional message MessageTableEntry* table = (MessageTableEntry*)malloc(sizeof(MessageTableEntry) * (file->messages.size() + 1)); - for (int i = 0; i < file->messages.size(); i++) { + for (size_t i = 0; i < file->messages.size(); i++) { // Look for Owl Text if (file->messages[i].id == 0x2066) { // Create a new message based on the Owl Text @@ -77,17 +77,17 @@ extern "C" void OTRMessage_Init() sGerMessageEntryTablePtr = OTRMessage_LoadTable("text/ger_message_data_static/ger_message_data_static", false); sFraMessageEntryTablePtr = OTRMessage_LoadTable("text/fra_message_data_static/fra_message_data_static", false); - auto file2 = std::static_pointer_cast(OTRGlobals::Instance->context->GetResourceManager()->LoadResource("text/staff_message_data_static/staff_message_data_static")); + auto file2 = std::static_pointer_cast(OTRGlobals::Instance->context->GetResourceManager()->LoadResource("text/staff_message_data_static/staff_message_data_static")); - sStaffMessageEntryTablePtr = (MessageTableEntry*)malloc(sizeof(MessageTableEntry) * file2->messages.size()); + sStaffMessageEntryTablePtr = (MessageTableEntry*)malloc(sizeof(MessageTableEntry) * file2->messages.size()); - for (int i = 0; i < file2->messages.size(); i++) - { - sStaffMessageEntryTablePtr[i].textId = file2->messages[i].id; - sStaffMessageEntryTablePtr[i].typePos = (file2->messages[i].textboxType << 4) | file2->messages[i].textboxYPos; - sStaffMessageEntryTablePtr[i].segment = file2->messages[i].msg.c_str(); - sStaffMessageEntryTablePtr[i].msgSize = file2->messages[i].msg.size(); - } + for (size_t i = 0; i < file2->messages.size(); i++) + { + sStaffMessageEntryTablePtr[i].textId = file2->messages[i].id; + sStaffMessageEntryTablePtr[i].typePos = (file2->messages[i].textboxType << 4) | file2->messages[i].textboxYPos; + sStaffMessageEntryTablePtr[i].segment = file2->messages[i].msg.c_str(); + sStaffMessageEntryTablePtr[i].msgSize = file2->messages[i].msg.size(); + } CustomMessageManager::Instance->AddCustomMessageTable(customMessageTableID); CustomMessageManager::Instance->CreateGetItemMessage( diff --git a/soh/soh/z_play_otr.cpp b/soh/soh/z_play_otr.cpp index e8c478ee6..d79111777 100644 --- a/soh/soh/z_play_otr.cpp +++ b/soh/soh/z_play_otr.cpp @@ -1,6 +1,6 @@ #include "OTRGlobals.h" #include -#include +#include "soh/resource/type/Scene.h" #include #include "global.h" #include "vt.h" @@ -9,7 +9,7 @@ extern "C" void Play_InitScene(PlayState * play, s32 spawn); extern "C" void Play_InitEnvironment(PlayState * play, s16 skyboxId); void OTRPlay_InitScene(PlayState* play, s32 spawn); -s32 OTRScene_ExecuteCommands(PlayState* play, Ship::Scene* sceneCmd); +s32 OTRScene_ExecuteCommands(PlayState* play, Ship::Scene* scene); //Ship::OTRResource* OTRPlay_LoadFile(PlayState* play, RomFile* file) { Ship::Resource* OTRPlay_LoadFile(PlayState* play, const char* fileName) @@ -36,7 +36,7 @@ extern "C" void OTRPlay_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn) { } std::string scenePath = StringHelper::Sprintf("scenes/%s/%s/%s", sceneVersion.c_str(), scene->sceneFile.fileName, scene->sceneFile.fileName); - play->sceneSegment = (Ship::Scene*)OTRPlay_LoadFile(play, scenePath.c_str()); + play->sceneSegment = OTRPlay_LoadFile(play, scenePath.c_str()); // Failed to load scene... default to doodongs cavern if (play->sceneSegment == nullptr) @@ -53,8 +53,9 @@ extern "C" void OTRPlay_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn) { //gSegments[2] = VIRTUAL_TO_PHYSICAL(play->sceneSegment); OTRPlay_InitScene(play, spawn); + auto roomSize = func_80096FE8(play, &play->roomCtx); - osSyncPrintf("ROOM SIZE=%fK\n", func_80096FE8(play, &play->roomCtx) / 1024.0f); + osSyncPrintf("ROOM SIZE=%fK\n", roomSize / 1024.0f); } void OTRPlay_InitScene(PlayState* play, s32 spawn) { @@ -72,7 +73,7 @@ void OTRPlay_InitScene(PlayState* play, s32 spawn) { func_80096FD4(play, &play->roomCtx.curRoom); YREG(15) = 0; gSaveContext.worldMapArea = 0; - OTRScene_ExecuteCommands(play, play->sceneSegment); + OTRScene_ExecuteCommands(play, (Ship::Scene*)play->sceneSegment); Play_InitEnvironment(play, play->skyboxId); /* auto data = static_cast(Ship::Window::GetInstance() ->GetResourceManager() diff --git a/soh/soh/z_scene_otr.cpp b/soh/soh/z_scene_otr.cpp index 51f245681..97de7ff61 100644 --- a/soh/soh/z_scene_otr.cpp +++ b/soh/soh/z_scene_otr.cpp @@ -1,15 +1,37 @@ #include "OTRGlobals.h" #include -#include +#include "soh/resource/type/Scene.h" #include #include "global.h" #include "vt.h" -#include +#include "soh/resource/type/CollisionHeader.h" #include -#include -#include -#include +#include "soh/resource/type/Cutscene.h" +#include "soh/resource/type/Path.h" +#include "soh/resource/type/Text.h" #include +#include +#include "soh/resource/type/scenecommand/SetCameraSettings.h" +#include "soh/resource/type/scenecommand/SetCutscenes.h" +#include "soh/resource/type/scenecommand/SetStartPositionList.h" +#include "soh/resource/type/scenecommand/SetActorList.h" +#include "soh/resource/type/scenecommand/SetCollisionHeader.h" +#include "soh/resource/type/scenecommand/SetRoomList.h" +#include "soh/resource/type/scenecommand/SetEntranceList.h" +#include "soh/resource/type/scenecommand/SetSpecialObjects.h" +#include "soh/resource/type/scenecommand/SetRoomBehavior.h" +#include "soh/resource/type/scenecommand/SetMesh.h" +#include "soh/resource/type/scenecommand/SetObjectList.h" +#include "soh/resource/type/scenecommand/SetLightList.h" +#include "soh/resource/type/scenecommand/SetPathways.h" +#include "soh/resource/type/scenecommand/SetTransitionActorList.h" +#include "soh/resource/type/scenecommand/SetSkyboxSettings.h" +#include "soh/resource/type/scenecommand/SetSkyboxModifier.h" +#include "soh/resource/type/scenecommand/SetTimeSettings.h" +#include "soh/resource/type/scenecommand/SetWindSettings.h" +#include "soh/resource/type/scenecommand/SetSoundSettings.h" +#include "soh/resource/type/scenecommand/SetEchoSettings.h" +#include "soh/resource/type/scenecommand/SetAlternateHeaders.h" extern Ship::Resource* OTRPlay_LoadFile(PlayState* play, const char* fileName); extern "C" s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId); @@ -32,82 +54,32 @@ std::shared_ptr ResourceMgr_LoadResource(const char* path); bool Scene_CommandSpawnList(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetStartPositionList* cmdStartPos = std::static_pointer_cast(cmd); Ship::SetStartPositionList* cmdStartPos = (Ship::SetStartPositionList*)cmd; + ActorEntry* entries = (ActorEntry*)cmdStartPos->GetPointer(); - ActorEntry* linkSpawnEntry = nullptr; - - if (cmdStartPos->cachedGameData != nullptr) - { - ActorEntry* entries = (ActorEntry*)cmdStartPos->cachedGameData; - linkSpawnEntry = &entries[play->setupEntranceList[play->curSpawn].spawn]; - } - else - { - ActorEntry* entries = (ActorEntry*)malloc(sizeof(ActorEntry) * cmdStartPos->entries.size()); - - for (int i = 0; i < cmdStartPos->entries.size(); i++) - { - entries[i].id = cmdStartPos->entries[i].actorNum; - entries[i].params = cmdStartPos->entries[i].initVar; - entries[i].pos.x = cmdStartPos->entries[i].posX; - entries[i].pos.y = cmdStartPos->entries[i].posY; - entries[i].pos.z = cmdStartPos->entries[i].posZ; - entries[i].rot.x = cmdStartPos->entries[i].rotX; - entries[i].rot.y = cmdStartPos->entries[i].rotY; - entries[i].rot.z = cmdStartPos->entries[i].rotZ; - } - - linkSpawnEntry = &entries[play->setupEntranceList[play->curSpawn].spawn]; - cmdStartPos->cachedGameData = entries; - } - - ActorEntry* linkEntry = play->linkActorEntry = linkSpawnEntry; - - s16 linkObjectId; - + play->linkActorEntry = &entries[play->setupEntranceList[play->curSpawn].spawn];; play->linkAgeOnLoad = ((void)0, gSaveContext.linkAge); + s16 linkObjectId = gLinkObjectIds[((void)0, gSaveContext.linkAge)]; - linkObjectId = gLinkObjectIds[((void)0, gSaveContext.linkAge)]; - - //gActorOverlayTable[linkEntry->id].initInfo->objectId = linkObjectId; Object_Spawn(&play->objectCtx, linkObjectId); return false; } bool Scene_CommandActorList(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetActorList* cmdActor = std::static_pointer_cast(cmd); Ship::SetActorList* cmdActor = (Ship::SetActorList*)cmd; - play->numSetupActors = cmdActor->entries.size(); - - if (cmdActor->cachedGameData != nullptr) - play->setupActorList = (ActorEntry*)cmdActor->cachedGameData; - else - { - ActorEntry* entries = (ActorEntry*)malloc(cmdActor->entries.size() * sizeof(ActorEntry)); - - for (int i = 0; i < cmdActor->entries.size(); i++) - { - entries[i].id = cmdActor->entries[i].actorNum; - entries[i].pos.x = cmdActor->entries[i].posX; - entries[i].pos.y = cmdActor->entries[i].posY; - entries[i].pos.z = cmdActor->entries[i].posZ; - entries[i].rot.x = cmdActor->entries[i].rotX; - entries[i].rot.y = cmdActor->entries[i].rotY; - entries[i].rot.z = cmdActor->entries[i].rotZ; - entries[i].params = cmdActor->entries[i].initVar; - } - - cmdActor->cachedGameData = entries; - play->setupActorList = entries; - } + play->numSetupActors = cmdActor->numActors; + play->setupActorList = (ActorEntry*)cmdActor->GetPointer(); return false; } bool Scene_CommandUnused2(PlayState* play, Ship::SceneCommand* cmd) { - // Do we need to implement this? + // OTRTODO: Do we need to implement this? //play->unk_11DFC = SEGMENTED_TO_VIRTUAL(cmd->unused02.segment); return false; @@ -115,160 +87,45 @@ bool Scene_CommandUnused2(PlayState* play, Ship::SceneCommand* cmd) bool Scene_CommandCollisionHeader(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetCollisionHeader* cmdCol = std::static_pointer_cast(cmd); Ship::SetCollisionHeader* cmdCol = (Ship::SetCollisionHeader*)cmd; - - auto colRes = std::static_pointer_cast(ResourceMgr_LoadResource(cmdCol->filePath.c_str())); - - CollisionHeader* colHeader = nullptr; - - if (colRes->CachedGameAsset != nullptr) - colHeader = (CollisionHeader*)colRes->CachedGameAsset; - else - { - colHeader = (CollisionHeader*)malloc(sizeof(CollisionHeader)); - - colHeader->minBounds.x = colRes->absMinX; - colHeader->minBounds.y = colRes->absMinY; - colHeader->minBounds.z = colRes->absMinZ; - - colHeader->maxBounds.x = colRes->absMaxX; - colHeader->maxBounds.y = colRes->absMaxY; - colHeader->maxBounds.z = colRes->absMaxZ; - - colHeader->vtxList = (Vec3s*)malloc(sizeof(Vec3s) * colRes->vertices.size()); - colHeader->numVertices = colRes->vertices.size(); - - for (int i = 0; i < colRes->vertices.size(); i++) - { - colHeader->vtxList[i].x = colRes->vertices[i].x; - colHeader->vtxList[i].y = colRes->vertices[i].y; - colHeader->vtxList[i].z = colRes->vertices[i].z; - } - - colHeader->polyList = (CollisionPoly*)malloc(sizeof(CollisionPoly) * colRes->polygons.size()); - colHeader->numPolygons = colRes->polygons.size(); - - for (int i = 0; i < colRes->polygons.size(); i++) - { - colHeader->polyList[i].type = colRes->polygons[i].type; - colHeader->polyList[i].flags_vIA = colRes->polygons[i].vtxA; - colHeader->polyList[i].flags_vIB = colRes->polygons[i].vtxB; - colHeader->polyList[i].vIC = colRes->polygons[i].vtxC; - colHeader->polyList[i].normal.x = colRes->polygons[i].a; - colHeader->polyList[i].normal.y = colRes->polygons[i].b; - colHeader->polyList[i].normal.z = colRes->polygons[i].c; - colHeader->polyList[i].dist = colRes->polygons[i].d; - } - - colHeader->surfaceTypeList = (SurfaceType*)malloc(colRes->polygonTypes.size() * sizeof(SurfaceType)); - - for (int i = 0; i < colRes->polygonTypes.size(); i++) - { - colHeader->surfaceTypeList[i].data[0] = colRes->polygonTypes[i] >> 32; - colHeader->surfaceTypeList[i].data[1] = colRes->polygonTypes[i] & 0xFFFFFFFF; - } - - colHeader->cameraDataList = (CamData*)malloc(sizeof(CamData) * colRes->camData->entries.size()); - colHeader->cameraDataListLen = colRes->camData->entries.size(); - - for (int i = 0; i < colRes->camData->entries.size(); i++) - { - colHeader->cameraDataList[i].cameraSType = colRes->camData->entries[i]->cameraSType; - colHeader->cameraDataList[i].numCameras = colRes->camData->entries[i]->numData; - - int idx = colRes->camData->entries[i]->cameraPosDataIdx; - - colHeader->cameraDataList[i].camPosData = (Vec3s*)malloc(sizeof(Vec3s) * colRes->camData->entries[i]->numData); - - for (int j = 0; j < colRes->camData->entries[i]->numData; j++) - { - if (colRes->camData->cameraPositionData.size() > 0) - { - colHeader->cameraDataList[i].camPosData[j].x = colRes->camData->cameraPositionData[idx + j]->x; - colHeader->cameraDataList[i].camPosData[j].y = colRes->camData->cameraPositionData[idx + j]->y; - colHeader->cameraDataList[i].camPosData[j].z = colRes->camData->cameraPositionData[idx + j]->z; - } - else - { - colHeader->cameraDataList[i].camPosData->x = 0; - colHeader->cameraDataList[i].camPosData->y = 0; - colHeader->cameraDataList[i].camPosData->z = 0; - } - } - } - - colHeader->numWaterBoxes = colRes->waterBoxes.size(); - colHeader->waterBoxes = (WaterBox*)malloc(sizeof(WaterBox) * colHeader->numWaterBoxes); - - for (int i = 0; i < colHeader->numWaterBoxes; i++) - { - colHeader->waterBoxes[i].xLength = colRes->waterBoxes[i].xLength; - colHeader->waterBoxes[i].ySurface = colRes->waterBoxes[i].ySurface; - colHeader->waterBoxes[i].xMin = colRes->waterBoxes[i].xMin; - colHeader->waterBoxes[i].zMin = colRes->waterBoxes[i].zMin; - colHeader->waterBoxes[i].xLength = colRes->waterBoxes[i].xLength; - colHeader->waterBoxes[i].zLength = colRes->waterBoxes[i].zLength; - colHeader->waterBoxes[i].properties = colRes->waterBoxes[i].properties; - } - - colRes->CachedGameAsset = colHeader; - } - - BgCheck_Allocate(&play->colCtx, play, colHeader); + BgCheck_Allocate(&play->colCtx, play, (CollisionHeader*)cmdCol->GetPointer()); return false; } bool Scene_CommandRoomList(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetRoomList* cmdRoomList = std::static_pointer_cast(cmd); Ship::SetRoomList* cmdRoomList = (Ship::SetRoomList*)cmd; - play->numRooms = cmdRoomList->rooms.size(); - play->roomList = (RomFile*)malloc(play->numRooms * sizeof(RomFile)); - - for (int i = 0; i < cmdRoomList->rooms.size(); i++) - { - play->roomList[i].fileName = (char*)cmdRoomList->rooms[i].name.c_str(); - play->roomList[i].vromStart = cmdRoomList->rooms[i].vromStart; - play->roomList[i].vromEnd = cmdRoomList->rooms[i].vromEnd; - } + play->numRooms = cmdRoomList->numRooms; + play->roomList = (RomFile*)cmdRoomList->GetPointer(); return false; } bool Scene_CommandEntranceList(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetEntranceList* otrEntrance = std::static_pointer_cast(cmd); Ship::SetEntranceList* otrEntrance = (Ship::SetEntranceList*)cmd; - - if (otrEntrance->cachedGameData != nullptr) - play->setupEntranceList = (EntranceEntry*)otrEntrance->cachedGameData; - else - { - play->setupEntranceList = (EntranceEntry*)malloc(otrEntrance->entrances.size() * sizeof(EntranceEntry)); - - for (int i = 0; i < otrEntrance->entrances.size(); i++) - { - play->setupEntranceList[i].room = otrEntrance->entrances[i].roomToLoad; - play->setupEntranceList[i].spawn = otrEntrance->entrances[i].startPositionIndex; - } - - otrEntrance->cachedGameData = play->setupEntranceList; - } + play->setupEntranceList = (EntranceEntry*)otrEntrance->GetPointer(); return false; } bool Scene_CommandSpecialFiles(PlayState* play, Ship::SceneCommand* cmd) { - Ship::SetSpecialObjects* otrSpecial = (Ship::SetSpecialObjects*)cmd; + // Ship::SetSpecialObjects* specialCmd = std::static_pointer_cast(cmd); + Ship::SetSpecialObjects* specialCmd = (Ship::SetSpecialObjects*)cmd; - if (otrSpecial->globalObject != 0) - play->objectCtx.subKeepIndex = Object_Spawn(&play->objectCtx, otrSpecial->globalObject); + if (specialCmd->specialObjects.globalObject != 0) { + play->objectCtx.subKeepIndex = Object_Spawn(&play->objectCtx, specialCmd->specialObjects.globalObject); + } - if (otrSpecial->elfMessage != 0) - { - auto res = (Ship::Blob*)OTRPlay_LoadFile(play, sNaviMsgFiles[otrSpecial->elfMessage - 1].fileName); - play->cUpElfMsgs = (ElfMessage*)res->data.data(); + if (specialCmd->specialObjects.elfMessage != 0) { + auto res = (Ship::Blob*)OTRPlay_LoadFile(play, sNaviMsgFiles[specialCmd->specialObjects.elfMessage - 1].fileName); + play->cUpElfMsgs = (ElfMessage*)res->Data.data(); } return false; @@ -276,163 +133,22 @@ bool Scene_CommandSpecialFiles(PlayState* play, Ship::SceneCommand* cmd) bool Scene_CommandRoomBehavior(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetRoomBehavior* cmdRoom = std::static_pointer_cast(cmd); Ship::SetRoomBehavior* cmdRoom = (Ship::SetRoomBehavior*)cmd; - play->roomCtx.curRoom.behaviorType1 = cmdRoom->gameplayFlags; - play->roomCtx.curRoom.behaviorType2 = cmdRoom->gameplayFlags2 & 0xFF; - play->roomCtx.curRoom.lensMode = (cmdRoom->gameplayFlags2 >> 8) & 1; - play->msgCtx.disableWarpSongs = (cmdRoom->gameplayFlags2 >> 0xA) & 1; + play->roomCtx.curRoom.behaviorType1 = cmdRoom->roomBehavior.gameplayFlags; + play->roomCtx.curRoom.behaviorType2 = cmdRoom->roomBehavior.gameplayFlags2 & 0xFF; + play->roomCtx.curRoom.lensMode = (cmdRoom->roomBehavior.gameplayFlags2 >> 8) & 1; + play->msgCtx.disableWarpSongs = (cmdRoom->roomBehavior.gameplayFlags2 >> 0xA) & 1; return false; } bool Scene_CommandMeshHeader(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetMesh* otrMesh = static_pointer_cast(cmd); Ship::SetMesh* otrMesh = (Ship::SetMesh*)cmd; - - if (otrMesh->cachedGameData != nullptr) - play->roomCtx.curRoom.meshHeader = (MeshHeader*)otrMesh->cachedGameData; - else - { - play->roomCtx.curRoom.meshHeader = (MeshHeader*)malloc(sizeof(MeshHeader)); - play->roomCtx.curRoom.meshHeader->base.type = otrMesh->meshHeaderType; - play->roomCtx.curRoom.meshHeader->polygon0.num = otrMesh->meshes.size(); - - if (otrMesh->meshHeaderType == 2) - play->roomCtx.curRoom.meshHeader->polygon0.start = malloc(sizeof(PolygonDlist2) * play->roomCtx.curRoom.meshHeader->polygon0.num); - else - play->roomCtx.curRoom.meshHeader->polygon0.start = malloc(sizeof(PolygonDlist) * play->roomCtx.curRoom.meshHeader->polygon0.num); - - for (int i = 0; i < play->roomCtx.curRoom.meshHeader->polygon0.num; i++) - { - if (otrMesh->meshHeaderType == 2) - { - PolygonDlist2* arr = (PolygonDlist2*)play->roomCtx.curRoom.meshHeader->polygon0.start; - PolygonDlist2* dlist = &arr[i]; - - if (otrMesh->meshes[i].opa != "") - { - auto opaFile = - std::static_pointer_cast(ResourceMgr_LoadResource(otrMesh->meshes[i].opa.c_str())); - - dlist->opaDL = opaFile.get(); - dlist->opa = (Gfx*)&dlist->opaDL->instructions[0]; - } - else - { - dlist->opa = 0; - } - - if (otrMesh->meshes[i].xlu != "") - { - auto xluFile = - std::static_pointer_cast(ResourceMgr_LoadResource(otrMesh->meshes[i].xlu.c_str())); - - dlist->xluDL = xluFile.get(); - dlist->xlu = (Gfx*)&dlist->xluDL->instructions[0]; - } - else - dlist->xlu = 0; - - dlist->pos.x = otrMesh->meshes[i].x; - dlist->pos.y = otrMesh->meshes[i].y; - dlist->pos.z = otrMesh->meshes[i].z; - dlist->unk_06 = otrMesh->meshes[i].unk_06; - - //play->roomCtx.curRoom.meshHeader->base.start = dlist; - } - else if (otrMesh->meshHeaderType == 1) - { - PolygonDlist* pType = (PolygonDlist*)malloc(sizeof(PolygonDlist)); - - if (otrMesh->meshes[0].imgOpa != "") - pType->opa = (Gfx*)&std::static_pointer_cast(ResourceMgr_LoadResource(otrMesh->meshes[0].imgOpa.c_str()))->instructions[0]; - else - pType->opa = 0; - - if (otrMesh->meshes[0].imgXlu != "") - pType->xlu = (Gfx*)&std::static_pointer_cast(ResourceMgr_LoadResource(otrMesh->meshes[0].imgXlu.c_str()))->instructions[0]; - else - pType->xlu = 0; - - play->roomCtx.curRoom.meshHeader->polygon1.dlist = (Gfx*)pType; - - play->roomCtx.curRoom.meshHeader->polygon1.format = otrMesh->meshes[0].imgFmt; - - if (otrMesh->meshes[0].imgFmt == 1) - { - play->roomCtx.curRoom.meshHeader->polygon1.single.fmt = otrMesh->meshes[0].images[0].fmt; - play->roomCtx.curRoom.meshHeader->polygon1.single.source = - (void*)(ResourceMgr_LoadFile(otrMesh->meshes[0].images[0].sourceBackground.c_str())) - .get() - ->Buffer.get(); - play->roomCtx.curRoom.meshHeader->polygon1.single.siz = otrMesh->meshes[0].images[0].siz; - play->roomCtx.curRoom.meshHeader->polygon1.single.width = otrMesh->meshes[0].images[0].width; - play->roomCtx.curRoom.meshHeader->polygon1.single.height = otrMesh->meshes[0].images[0].height; - play->roomCtx.curRoom.meshHeader->polygon1.single.fmt = otrMesh->meshes[0].images[0].fmt; - play->roomCtx.curRoom.meshHeader->polygon1.single.mode0 = otrMesh->meshes[0].images[0].mode0; - play->roomCtx.curRoom.meshHeader->polygon1.single.tlutCount = otrMesh->meshes[0].images[0].tlutCount; - } - else - { - play->roomCtx.curRoom.meshHeader->polygon1.multi.count = otrMesh->meshes[0].images.size(); - play->roomCtx.curRoom.meshHeader->polygon1.multi.list = - (BgImage*)calloc(sizeof(BgImage), play->roomCtx.curRoom.meshHeader->polygon1.multi.count); - - for (size_t i = 0; i < otrMesh->meshes[0].images.size(); i++) - { - play->roomCtx.curRoom.meshHeader->polygon1.multi.list[i].fmt = otrMesh->meshes[0].images[i].fmt; - play->roomCtx.curRoom.meshHeader->polygon1.multi.list[i].source = - (void*)(ResourceMgr_LoadFile(otrMesh->meshes[0].images[i].sourceBackground.c_str())) - .get() - ->Buffer.get(); - play->roomCtx.curRoom.meshHeader->polygon1.multi.list[i].siz = otrMesh->meshes[0].images[i].siz; - play->roomCtx.curRoom.meshHeader->polygon1.multi.list[i].width = otrMesh->meshes[0].images[i].width; - play->roomCtx.curRoom.meshHeader->polygon1.multi.list[i].height = - otrMesh->meshes[0].images[i].height; - play->roomCtx.curRoom.meshHeader->polygon1.multi.list[i].fmt = otrMesh->meshes[0].images[i].fmt; - play->roomCtx.curRoom.meshHeader->polygon1.multi.list[i].mode0 = otrMesh->meshes[0].images[i].mode0; - play->roomCtx.curRoom.meshHeader->polygon1.multi.list[i].tlutCount = - otrMesh->meshes[0].images[i].tlutCount; - play->roomCtx.curRoom.meshHeader->polygon1.multi.list[i].unk_00 = - otrMesh->meshes[0].images[i].unk_00; - play->roomCtx.curRoom.meshHeader->polygon1.multi.list[i].unk_0C = - otrMesh->meshes[0].images[i].unk_0C; - play->roomCtx.curRoom.meshHeader->polygon1.multi.list[i].id = otrMesh->meshes[0].images[i].id; - } - } - } - else - { - PolygonDlist* arr = (PolygonDlist*)play->roomCtx.curRoom.meshHeader->polygon0.start; - PolygonDlist* dlist = &arr[i]; - - if (otrMesh->meshes[i].opa != "") - { - auto opaFile = std::static_pointer_cast(ResourceMgr_LoadResource(otrMesh->meshes[i].opa.c_str())); - - dlist->opaDL = opaFile.get(); - dlist->opa = (Gfx*)&dlist->opaDL->instructions[0]; - } - else - dlist->opa = 0; - - if (otrMesh->meshes[i].xlu != "") - { - auto xluFile = std::static_pointer_cast(ResourceMgr_LoadResource(otrMesh->meshes[i].xlu.c_str())); - - dlist->xluDL = xluFile.get(); - dlist->xlu = (Gfx*)&dlist->xluDL->instructions[0]; - } - else - dlist->xlu = 0; - - //play->roomCtx.curRoom.meshHeader->base.start = dlist; - } - } - - otrMesh->cachedGameData = play->roomCtx.curRoom.meshHeader; - } + play->roomCtx.curRoom.meshHeader = (MeshHeader*)otrMesh->GetPointer(); return false; } @@ -441,6 +157,7 @@ extern "C" void* func_800982FC(ObjectContext * objectCtx, s32 bankIndex, s16 obj bool Scene_CommandObjectList(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetObjectList* cmdObj = static_pointer_cast(cmd); Ship::SetObjectList* cmdObj = (Ship::SetObjectList*)cmd; s32 i; @@ -450,7 +167,7 @@ bool Scene_CommandObjectList(PlayState* play, Ship::SceneCommand* cmd) ObjectStatus* status2; ObjectStatus* firstStatus; //s16* objectEntry = SEGMENTED_TO_VIRTUAL(cmd->objectList.segment); - s16* objectEntry = (s16*)cmdObj->objects.data(); + s16* objectEntry = (s16*)cmdObj->GetPointer(); void* nextPtr; k = 0; @@ -503,23 +220,12 @@ bool Scene_CommandObjectList(PlayState* play, Ship::SceneCommand* cmd) bool Scene_CommandLightList(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetLightList* cmdLight = static_pointer_cast(cmd); Ship::SetLightList* cmdLight = (Ship::SetLightList*)cmd; - LightInfo* lightInfo = (LightInfo*)malloc(cmdLight->lights.size() * sizeof(LightInfo)); - - for (int i = 0; i < cmdLight->lights.size(); i++) + for (size_t i = 0; i < cmdLight->lightList.size(); i++) { - lightInfo[i].type = cmdLight->lights[i].type; - lightInfo[i].params.point.x = cmdLight->lights[i].x; - lightInfo[i].params.point.y = cmdLight->lights[i].y; - lightInfo[i].params.point.z = cmdLight->lights[i].z; - lightInfo[i].params.point.radius = cmdLight->lights[i].radius; - lightInfo[i].params.point.drawGlow = cmdLight->lights[i].drawGlow; - lightInfo[i].params.point.color[0] = cmdLight->lights[i].r; - lightInfo[i].params.point.color[1] = cmdLight->lights[i].g; - lightInfo[i].params.point.color[2] = cmdLight->lights[i].b; - - LightContext_InsertLight(play, &play->lightCtx, &lightInfo[i]); + LightContext_InsertLight(play, &play->lightCtx, (LightInfo*)&cmdLight->lightList[i]); } return false; @@ -527,49 +233,19 @@ bool Scene_CommandLightList(PlayState* play, Ship::SceneCommand* cmd) bool Scene_CommandPathList(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetPathways* cmdPath = static_pointer_cast(cmd); Ship::SetPathways* cmdPath = (Ship::SetPathways*)cmd; - - Ship::Path* path = (Ship::Path*)ResourceMgr_LoadResource(cmdPath->paths[0].c_str()).get(); - play->setupPathList = (Path*)malloc(path->paths.size() * sizeof(Path)); - - //for (int i = 0; i < cmdPath->paths.size(); i++) - { - for (int j = 0; j < path->paths.size(); j++) - { - play->setupPathList[j].count = path->paths[j].size(); - play->setupPathList[j].points = (Vec3s*)malloc(sizeof(Vec3s) * path->paths[j].size()); - - for (int k = 0; k < path->paths[j].size(); k++) - { - play->setupPathList[j].points[k].x = path->paths[j][k].x; - play->setupPathList[j].points[k].y = path->paths[j][k].y; - play->setupPathList[j].points[k].z = path->paths[j][k].z; - } - } - } + play->setupPathList = (Path*)cmdPath->paths[0]->GetPointer(); return false; } bool Scene_CommandTransitionActorList(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetTransitionActorList* cmdActor = static_pointer_cast(cmd); Ship::SetTransitionActorList* cmdActor = (Ship::SetTransitionActorList*)cmd; - play->transiActorCtx.numActors = cmdActor->entries.size(); - play->transiActorCtx.list = (TransitionActorEntry*)malloc(cmdActor->entries.size() * sizeof(TransitionActorEntry)); - - for (int i = 0; i < cmdActor->entries.size(); i++) - { - play->transiActorCtx.list[i].sides[0].room = cmdActor->entries[i].frontObjectRoom; - play->transiActorCtx.list[i].sides[0].effects = cmdActor->entries[i].frontTransitionReaction; - play->transiActorCtx.list[i].sides[1].room = cmdActor->entries[i].backObjectRoom; - play->transiActorCtx.list[i].sides[1].effects = cmdActor->entries[i].backTransitionReaction; - play->transiActorCtx.list[i].id = cmdActor->entries[i].actorNum; - play->transiActorCtx.list[i].pos.x = cmdActor->entries[i].posX; - play->transiActorCtx.list[i].pos.y = cmdActor->entries[i].posY; - play->transiActorCtx.list[i].pos.z = cmdActor->entries[i].posZ; - play->transiActorCtx.list[i].rotY = cmdActor->entries[i].rotY; - play->transiActorCtx.list[i].params = cmdActor->entries[i].initVar; - } + play->transiActorCtx.numActors = cmdActor->numTransitionActors; + play->transiActorCtx.list = (TransitionActorEntry*)cmdActor->GetPointer(); return false; } @@ -580,40 +256,7 @@ bool Scene_CommandTransitionActorList(PlayState* play, Ship::SceneCommand* cmd) bool Scene_CommandLightSettingsList(PlayState* play, Ship::SceneCommand* cmd) { - Ship::SetLightingSettings* otrLight = (Ship::SetLightingSettings*)cmd; - - play->envCtx.numLightSettings = otrLight->settings.size(); - play->envCtx.lightSettingsList = (EnvLightSettings*)malloc(play->envCtx.numLightSettings * sizeof(EnvLightSettings)); - - for (int i = 0; i < otrLight->settings.size(); i++) - { - play->envCtx.lightSettingsList[i].ambientColor[0] = otrLight->settings[i].ambientClrR; - play->envCtx.lightSettingsList[i].ambientColor[1] = otrLight->settings[i].ambientClrG; - play->envCtx.lightSettingsList[i].ambientColor[2] = otrLight->settings[i].ambientClrB; - - play->envCtx.lightSettingsList[i].light1Color[0] = otrLight->settings[i].diffuseClrA_R; - play->envCtx.lightSettingsList[i].light1Color[1] = otrLight->settings[i].diffuseClrA_G; - play->envCtx.lightSettingsList[i].light1Color[2] = otrLight->settings[i].diffuseClrA_B; - - play->envCtx.lightSettingsList[i].light1Dir[0] = otrLight->settings[i].diffuseDirA_X; - play->envCtx.lightSettingsList[i].light1Dir[1] = otrLight->settings[i].diffuseDirA_Y; - play->envCtx.lightSettingsList[i].light1Dir[2] = otrLight->settings[i].diffuseDirA_Z; - - play->envCtx.lightSettingsList[i].light2Color[0] = otrLight->settings[i].diffuseClrB_R; - play->envCtx.lightSettingsList[i].light2Color[1] = otrLight->settings[i].diffuseClrB_G; - play->envCtx.lightSettingsList[i].light2Color[2] = otrLight->settings[i].diffuseClrB_B; - - play->envCtx.lightSettingsList[i].light2Dir[0] = otrLight->settings[i].diffuseDirB_X; - play->envCtx.lightSettingsList[i].light2Dir[1] = otrLight->settings[i].diffuseDirB_Y; - play->envCtx.lightSettingsList[i].light2Dir[2] = otrLight->settings[i].diffuseDirB_Z; - - play->envCtx.lightSettingsList[i].fogColor[0] = otrLight->settings[i].fogClrR; - play->envCtx.lightSettingsList[i].fogColor[1] = otrLight->settings[i].fogClrG; - play->envCtx.lightSettingsList[i].fogColor[2] = otrLight->settings[i].fogClrB; - - play->envCtx.lightSettingsList[i].fogNear = otrLight->settings[i].fogNear; - play->envCtx.lightSettingsList[i].fogFar = otrLight->settings[i].fogFar; - } + play->envCtx.lightSettingsList = (EnvLightSettings*)cmd->GetPointer(); return false; } @@ -621,36 +264,39 @@ bool Scene_CommandLightSettingsList(PlayState* play, Ship::SceneCommand* cmd) // Scene Command 0x11: Skybox Settings bool Scene_CommandSkyboxSettings(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetSkyboxSettings* cmdSky = static_pointer_cast(cmd); Ship::SetSkyboxSettings* cmdSky = (Ship::SetSkyboxSettings*)cmd; - play->skyboxId = cmdSky->skyboxNumber; - play->envCtx.unk_17 = play->envCtx.unk_18 = cmdSky->cloudsType; - play->envCtx.indoors = cmdSky->isIndoors; + play->skyboxId = cmdSky->settings.skyboxId; + play->envCtx.unk_17 = play->envCtx.unk_18 = cmdSky->settings.weather; + play->envCtx.indoors = cmdSky->settings.indoors; return false; } bool Scene_CommandSkyboxDisables(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetSkyboxModifier* cmdSky = static_pointer_cast(cmd); Ship::SetSkyboxModifier* cmdSky = (Ship::SetSkyboxModifier*)cmd; - play->envCtx.sunMoonDisabled = cmdSky->disableSunMoon; - play->envCtx.skyboxDisabled = cmdSky->disableSky; + play->envCtx.sunMoonDisabled = cmdSky->modifier.sunMoonDisabled; + play->envCtx.skyboxDisabled = cmdSky->modifier.skyboxDisabled; return false; } bool Scene_CommandTimeSettings(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetTimeSettings* cmdTime = static_pointer_cast(cmd); Ship::SetTimeSettings* cmdTime = (Ship::SetTimeSettings*)cmd; - if ((cmdTime->hour != 0xFF) && (cmdTime->min != 0xFF)) { + if ((cmdTime->settings.hour != 0xFF) && (cmdTime->settings.minute != 0xFF)) { gSaveContext.skyboxTime = gSaveContext.dayTime = - ((cmdTime->hour + (cmdTime->min / 60.0f)) * 60.0f) / ((f32)(24 * 60) / 0x10000); + ((cmdTime->settings.hour + (cmdTime->settings.minute / 60.0f)) * 60.0f) / ((f32)(24 * 60) / 0x10000); } - if (cmdTime->unk != 0xFF) { - play->envCtx.timeIncrement = cmdTime->unk; + if (cmdTime->settings.timeIncrement != 0xFF) { + play->envCtx.timeIncrement = cmdTime->settings.timeIncrement; } else { play->envCtx.timeIncrement = 0; @@ -685,29 +331,21 @@ bool Scene_CommandTimeSettings(PlayState* play, Ship::SceneCommand* cmd) } bool Scene_CommandWindSettings(PlayState* play, Ship::SceneCommand* cmd) { - Ship::SetWind* cmdWind = (Ship::SetWind*)cmd; + // Ship::SetWind* cmdWind = std::static_pointer_cast(cmd); + Ship::SetWindSettings* cmdWind = (Ship::SetWindSettings*)cmd; - s8 x = cmdWind->windWest; - s8 y = cmdWind->windVertical; - s8 z = cmdWind->windSouth; + play->envCtx.windDirection.x = cmdWind->settings.windWest; + play->envCtx.windDirection.y = cmdWind->settings.windVertical; + play->envCtx.windDirection.z = cmdWind->settings.windSouth; - play->envCtx.windDirection.x = x; - play->envCtx.windDirection.y = y; - play->envCtx.windDirection.z = z; - - play->envCtx.windSpeed = cmdWind->clothFlappingStrength; + play->envCtx.windSpeed = cmdWind->settings.windSpeed; return false; } bool Scene_CommandExitList(PlayState* play, Ship::SceneCommand* cmd) { - Ship::ExitList* cmdExit = (Ship::ExitList*)cmd; - - play->setupExitList = (int16_t*)malloc(cmdExit->exits.size() * sizeof(int16_t)); - - for (int i = 0; i < cmdExit->exits.size(); i++) - play->setupExitList[i] = cmdExit->exits[i]; + play->setupExitList = (s16*)cmd->GetPointer(); return false; } @@ -717,13 +355,14 @@ bool Scene_CommandUndefined9(PlayState* play, Ship::SceneCommand* cmd) { } bool Scene_CommandSoundSettings(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetSoundSettings* cmdSnd = static_pointer_cast(cmd); Ship::SetSoundSettings* cmdSnd = (Ship::SetSoundSettings*)cmd; - play->sequenceCtx.seqId = cmdSnd->musicSequence; - play->sequenceCtx.natureAmbienceId = cmdSnd->nightTimeSFX; + play->sequenceCtx.seqId = cmdSnd->settings.seqId; + play->sequenceCtx.natureAmbienceId = cmdSnd->settings.natureAmbienceId; if (gSaveContext.seqId == 0xFF) { - Audio_QueueSeqCmd(cmdSnd->reverb | 0xF0000000); + Audio_QueueSeqCmd(cmdSnd->settings.reverb | 0xF0000000); } return false; @@ -731,15 +370,17 @@ bool Scene_CommandSoundSettings(PlayState* play, Ship::SceneCommand* cmd) { bool Scene_CommandEchoSettings(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetEchoSettings* cmdEcho = static_pointer_cast(cmd); Ship::SetEchoSettings* cmdEcho = (Ship::SetEchoSettings*)cmd; - play->roomCtx.curRoom.echo = cmdEcho->echo; + play->roomCtx.curRoom.echo = cmdEcho->settings.echo; return false; } bool Scene_CommandAlternateHeaderList(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetAlternateHeaders* cmdHeaders = static_pointer_cast(cmd); Ship::SetAlternateHeaders* cmdHeaders = (Ship::SetAlternateHeaders*)cmd; //s32 pad; @@ -751,15 +392,11 @@ bool Scene_CommandAlternateHeaderList(PlayState* play, Ship::SceneCommand* cmd) if (gSaveContext.sceneSetupIndex != 0) { - std::string desiredHeader = cmdHeaders->headers[gSaveContext.sceneSetupIndex - 1]; - Ship::Scene* headerData = nullptr; - if (desiredHeader != "") { - headerData = (Ship::Scene*)ResourceMgr_LoadResource(desiredHeader.c_str()).get(); - } + Ship::Scene* desiredHeader = std::static_pointer_cast(cmdHeaders->headers[gSaveContext.sceneSetupIndex - 1]).get(); - if (headerData != nullptr) + if (desiredHeader != nullptr) { - OTRScene_ExecuteCommands(play, headerData); + OTRScene_ExecuteCommands(play, desiredHeader); return true; } else @@ -769,18 +406,14 @@ bool Scene_CommandAlternateHeaderList(PlayState* play, Ship::SceneCommand* cmd) if (gSaveContext.sceneSetupIndex == 3) { - std::string desiredHeader = cmdHeaders->headers[gSaveContext.sceneSetupIndex - 2]; - Ship::Scene* headerData = nullptr; - if (desiredHeader != "") { - headerData = (Ship::Scene*)ResourceMgr_LoadResource(desiredHeader.c_str()).get(); - } + Ship::Scene* desiredHeader = std::static_pointer_cast(cmdHeaders->headers[gSaveContext.sceneSetupIndex - 2]).get(); // "Using adult day data there!" osSyncPrintf("\nそこで、大人の昼データを使用するでええっす!!"); - if (headerData != nullptr) + if (desiredHeader != nullptr) { - OTRScene_ExecuteCommands(play, headerData); + OTRScene_ExecuteCommands(play, desiredHeader); return true; } } @@ -791,10 +424,10 @@ bool Scene_CommandAlternateHeaderList(PlayState* play, Ship::SceneCommand* cmd) bool Scene_CommandCutsceneData(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetCutscenes* cmdCS = std::static_pointer_cast(cmd); Ship::SetCutscenes* cmdCS = (Ship::SetCutscenes*)cmd; - Ship::Cutscene* csData = (Ship::Cutscene*)ResourceMgr_LoadResource(cmdCS->cutscenePath.c_str()).get(); - play->csCtx.segment = csData->commands.data(); + play->csCtx.segment = cmdCS->cutscene->commands.data(); //osSyncPrintf("\ngame_play->demo_play.data=[%x]", play->csCtx.segment); return false; @@ -803,10 +436,11 @@ bool Scene_CommandCutsceneData(PlayState* play, Ship::SceneCommand* cmd) // Camera & World Map Area bool Scene_CommandMiscSettings(PlayState* play, Ship::SceneCommand* cmd) { + // Ship::SetCameraSettings* cmdCam = std::static_pointer_cast(cmd); Ship::SetCameraSettings* cmdCam = (Ship::SetCameraSettings*)cmd; - YREG(15) = cmdCam->cameraMovement; - gSaveContext.worldMapArea = cmdCam->mapHighlights; + YREG(15) = cmdCam->settings.cameraMovement; + gSaveContext.worldMapArea = cmdCam->settings.worldMapArea; if ((play->sceneNum == SCENE_SHOP1) || (play->sceneNum == SCENE_SYATEKIJYOU)) { if (LINK_AGE_IN_YEARS == YEARS_ADULT) { @@ -867,7 +501,7 @@ s32 OTRScene_ExecuteCommands(PlayState* play, Ship::Scene* scene) continue; - cmdCode = sceneCmd->cmdID; + cmdCode = sceneCmd->cmdId; //osSyncPrintf("*** Scene_Word = { code=%d, data1=%02x, data2=%04x } ***\n", cmdCode, sceneCmd->base.data1, sceneCmd->base.data2); if ((int)cmdCode == 0x14) { @@ -875,7 +509,7 @@ s32 OTRScene_ExecuteCommands(PlayState* play, Ship::Scene* scene) } if ((int)cmdCode <= 0x19) { - if (sceneCommands[(int)cmdCode](play, sceneCmd)) + if (sceneCommands[(int)cmdCode](play, sceneCmd.get())) break; } else { @@ -898,7 +532,7 @@ extern "C" s32 OTRfunc_800973FC(PlayState* play, RoomContext* roomCtx) { roomCtx->curRoom.segment = roomCtx->unk_34; gSegments[3] = VIRTUAL_TO_PHYSICAL(roomCtx->unk_34); - OTRScene_ExecuteCommands(play, roomCtx->roomToLoad); + OTRScene_ExecuteCommands(play, (Ship::Scene*)roomCtx->roomToLoad); Player_SetBootData(play, GET_PLAYER(play)); Actor_SpawnTransitionActors(play, &play->actorCtx); @@ -932,9 +566,9 @@ extern "C" s32 OTRfunc_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomN //DmaMgr_SendRequest2(&roomCtx->dmaRequest, roomCtx->unk_34, play->roomList[roomNum].vromStart, size, 0, //&roomCtx->loadQueue, NULL, __FILE__, __LINE__); - auto roomData = ResourceMgr_LoadResource(play->roomList[roomNum].fileName); + auto roomData = std::static_pointer_cast(ResourceMgr_LoadResource(play->roomList[roomNum].fileName)); roomCtx->status = 1; - roomCtx->roomToLoad = (Ship::Scene*)roomData.get(); + roomCtx->roomToLoad = roomData.get(); roomCtx->unk_30 ^= 1; diff --git a/soh/src/code/audio_effects.c b/soh/src/code/audio_effects.c index f77462f98..be0215554 100644 --- a/soh/src/code/audio_effects.c +++ b/soh/src/code/audio_effects.c @@ -1,5 +1,5 @@ #include -#include "ultra64.h" +#include #include "global.h" #define ROUND(num) floorf((num) * 100) / 100; diff --git a/soh/src/code/audio_heap.c b/soh/src/code/audio_heap.c index 0e7027510..72c1c8870 100644 --- a/soh/src/code/audio_heap.c +++ b/soh/src/code/audio_heap.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" void AudioHeap_InitSampleCaches(u32 persistentSize, u32 temporarySize); diff --git a/soh/src/code/audio_load.c b/soh/src/code/audio_load.c index ad6310157..7883aa405 100644 --- a/soh/src/code/audio_load.c +++ b/soh/src/code/audio_load.c @@ -2,7 +2,7 @@ #include #include -#include "ultra64.h" +#include #include "global.h" #include "soh/OTRGlobals.h" #include "soh/Enhancements/sfx-editor/SfxEditor.h" diff --git a/soh/src/code/audio_playback.c b/soh/src/code/audio_playback.c index d33692ed1..66f236c43 100644 --- a/soh/src/code/audio_playback.c +++ b/soh/src/code/audio_playback.c @@ -1,5 +1,5 @@ #include "global.h" -#include +#include extern bool gUseLegacySD; @@ -94,7 +94,7 @@ void Audio_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs) { vel = 0.0f > vel ? 0.0f : vel; vel = 1.0f < vel ? 1.0f : vel; - float master_vol = CVar_GetFloat("gGameMasterVolume", 1.0f); + float master_vol = CVarGetFloat("gGameMasterVolume", 1.0f); sub->targetVolLeft = (s32)((vel * volLeft) * (0x1000 - 0.001f)) * master_vol; sub->targetVolRight = (s32)((vel * volRight) * (0x1000 - 0.001f)) * master_vol; @@ -120,7 +120,7 @@ void Audio_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput) } else { noteSubEu->bitField1.hasTwoParts = true; if (3.99996f < resamplingRateInput) { - if (CVar_GetS32("gExperimentalOctaveDrop", 0)) { + if (CVarGetInteger("gExperimentalOctaveDrop", 0)) { resamplingRate = resamplingRateInput * 0.25; } else { resamplingRate = 1.99998f; diff --git a/soh/src/code/audio_seqplayer.c b/soh/src/code/audio_seqplayer.c index 80a97b97e..4c38524c6 100644 --- a/soh/src/code/audio_seqplayer.c +++ b/soh/src/code/audio_seqplayer.c @@ -1,6 +1,6 @@ #include -#include "ultra64.h" +#include #include "global.h" extern char* sequenceMap[MAX_SEQUENCES]; diff --git a/soh/src/code/audio_sound_params.c b/soh/src/code/audio_sound_params.c index 2b90e5b98..65e15abf8 100644 --- a/soh/src/code/audio_sound_params.c +++ b/soh/src/code/audio_sound_params.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" SoundParams sEnemyBankParams[] = { diff --git a/soh/src/code/audio_synthesis.c b/soh/src/code/audio_synthesis.c index 5b7878630..6393c0b87 100644 --- a/soh/src/code/audio_synthesis.c +++ b/soh/src/code/audio_synthesis.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" #include diff --git a/soh/src/code/code_800EC960.c b/soh/src/code/code_800EC960.c index b65fc6492..ed5bd6fee 100644 --- a/soh/src/code/code_800EC960.c +++ b/soh/src/code/code_800EC960.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" // TODO: can these macros be shared between files? code_800F9280 seems to use @@ -1258,11 +1258,11 @@ void Audio_PlayFanfare_Rando(GetItemEntry getItem); // Function originally not called, so repurposing for control mapping void Audio_OcaUpdateBtnMap(bool customControls, bool dpad, bool rStick) { if (customControls) { - sOcarinaD5BtnMap = CVar_GetS32("gOcarinaD5BtnMap", BTN_CUP); - sOcarinaB4BtnMap = CVar_GetS32("gOcarinaB4BtnMap", BTN_CLEFT); - sOcarinaA4BtnMap = CVar_GetS32("gOcarinaA4BtnMap", BTN_CRIGHT); - sOcarinaF4BtnMap = CVar_GetS32("gOcarinaF4BtnMap", BTN_CDOWN); - sOcarinaD4BtnMap = CVar_GetS32("gOcarinaD4BtnMap", BTN_A); + sOcarinaD5BtnMap = CVarGetInteger("gOcarinaD5BtnMap", BTN_CUP); + sOcarinaB4BtnMap = CVarGetInteger("gOcarinaB4BtnMap", BTN_CLEFT); + sOcarinaA4BtnMap = CVarGetInteger("gOcarinaA4BtnMap", BTN_CRIGHT); + sOcarinaF4BtnMap = CVarGetInteger("gOcarinaF4BtnMap", BTN_CDOWN); + sOcarinaD4BtnMap = CVarGetInteger("gOcarinaD4BtnMap", BTN_A); } else { sOcarinaD5BtnMap = BTN_CUP; sOcarinaB4BtnMap = BTN_CLEFT; @@ -1539,8 +1539,8 @@ void func_800ED200(void) { u8 k; u32 disableSongBtnMap; - if (CVar_GetS32("gCustomOcarinaControls", 0)) { - disableSongBtnMap = CVar_GetS32("gOcarinaDisableBtnMap", BTN_L); + if (CVarGetInteger("gCustomOcarinaControls", 0)) { + disableSongBtnMap = CVarGetInteger("gOcarinaDisableBtnMap", BTN_L); } else { disableSongBtnMap = BTN_L; } @@ -1601,13 +1601,13 @@ void func_800ED200(void) { void func_800ED458(s32 arg0) { u32 phi_v1_2; - bool customControls = CVar_GetS32("gCustomOcarinaControls", 0); - bool dpad = CVar_GetS32("gDpadOcarina", 0); - bool rStick = CVar_GetS32("gRStickOcarina", 0); + bool customControls = CVarGetInteger("gCustomOcarinaControls", 0); + bool dpad = CVarGetInteger("gDpadOcarina", 0); + bool rStick = CVarGetInteger("gRStickOcarina", 0); if (D_80130F3C != 0 && sOcarinaDropInputTimer != 0) { sOcarinaDropInputTimer--; - if (!CVar_GetS32("gDpadNoDropOcarinaInput", 0)) { + if (!CVarGetInteger("gDpadNoDropOcarinaInput", 0)) { return; } } @@ -1649,7 +1649,7 @@ void func_800ED458(s32 arg0) { u32 noteSharpBtnMap; if (customControls) { - noteSharpBtnMap = CVar_GetS32("gOcarinaSharpBtnMap", BTN_R); + noteSharpBtnMap = CVarGetInteger("gOcarinaSharpBtnMap", BTN_R); } else { noteSharpBtnMap = BTN_R; } @@ -1660,7 +1660,7 @@ void func_800ED458(s32 arg0) { u32 noteFlatBtnMap; if (customControls) { - noteFlatBtnMap = CVar_GetS32("gOcarinaFlatBtnMap", BTN_Z); + noteFlatBtnMap = CVarGetInteger("gOcarinaFlatBtnMap", BTN_Z); } else { noteFlatBtnMap = BTN_Z; } @@ -3987,7 +3987,7 @@ void Audio_PlayFanfare_Rando(GetItemEntry getItem) { temp1 = NA_BGM_SMALL_ITEM_GET | 0x900; } // If the setting is toggled on and we get special quest items (longer fanfares): - if (CVar_GetS32("gRandoQuestItemFanfares", 0) != 0) { + if (CVarGetInteger("gRandoQuestItemFanfares", 0) != 0) { // If we get a medallion, play the "get a medallion" fanfare if ((itemId >= ITEM_MEDALLION_FOREST) && (itemId <= ITEM_MEDALLION_LIGHT)) { temp1 = NA_BGM_MEDALLION_GET | 0x900; diff --git a/soh/src/code/code_800F7260.c b/soh/src/code/code_800F7260.c index 1aaa8f360..109a7079a 100644 --- a/soh/src/code/code_800F7260.c +++ b/soh/src/code/code_800F7260.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" #include "vt.h" diff --git a/soh/src/code/code_800F9280.c b/soh/src/code/code_800F9280.c index 2a051beca..bb1f31081 100644 --- a/soh/src/code/code_800F9280.c +++ b/soh/src/code/code_800F9280.c @@ -1,6 +1,5 @@ -#include "ultra64.h" +#include #include "global.h" -#include #include typedef struct { diff --git a/soh/src/code/db_camera.c b/soh/src/code/db_camera.c index 0f6d110b8..4bdbf86f8 100644 --- a/soh/src/code/db_camera.c +++ b/soh/src/code/db_camera.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" static PlayState* sPlayState; diff --git a/soh/src/code/game.c b/soh/src/code/game.c index df8e8d98a..1e75779a8 100644 --- a/soh/src/code/game.c +++ b/soh/src/code/game.c @@ -161,7 +161,7 @@ void GameState_Draw(GameState* gameState, GraphicsContext* gfxCtx) { } sLastButtonPressed = gameState->input[0].press.button | gameState->input[0].cur.button; - if (R_DISABLE_INPUT_DISPLAY == 0 && CVar_GetS32("gDebugEnabled", 0)) { + if (R_DISABLE_INPUT_DISPLAY == 0 && CVarGetInteger("gDebugEnabled", 0)) { GameState_DrawInputDisplay(sLastButtonPressed, &newDList); } @@ -333,21 +333,21 @@ void GameState_Update(GameState* gameState) { // ----------------------- // Inf Money - if (CVar_GetS32("gInfiniteMoney", 0) != 0) { + if (CVarGetInteger("gInfiniteMoney", 0) != 0) { if (gSaveContext.rupees < CUR_CAPACITY(UPG_WALLET)) { gSaveContext.rupees = CUR_CAPACITY(UPG_WALLET); } } // Inf Health - if (CVar_GetS32("gInfiniteHealth", 0) != 0) { + if (CVarGetInteger("gInfiniteHealth", 0) != 0) { if (gSaveContext.health < gSaveContext.healthCapacity) { gSaveContext.health = gSaveContext.healthCapacity; } } // Inf Ammo - if (CVar_GetS32("gInfiniteAmmo", 0) != 0) { + if (CVarGetInteger("gInfiniteAmmo", 0) != 0) { // Deku Sticks if (AMMO(ITEM_STICK) < CUR_CAPACITY(UPG_STICKS)) { AMMO(ITEM_STICK) = CUR_CAPACITY(UPG_STICKS); @@ -380,19 +380,19 @@ void GameState_Update(GameState* gameState) { } // Inf Magic - if (CVar_GetS32("gInfiniteMagic", 0) != 0) { + if (CVarGetInteger("gInfiniteMagic", 0) != 0) { if (gSaveContext.isMagicAcquired && gSaveContext.magic != (gSaveContext.isDoubleMagicAcquired + 1) * 0x30) { gSaveContext.magic = (gSaveContext.isDoubleMagicAcquired + 1) * 0x30; } } // Inf Nayru's Love Timer - if (CVar_GetS32("gInfiniteNayru", 0) != 0) { + if (CVarGetInteger("gInfiniteNayru", 0) != 0) { gSaveContext.nayrusLoveTimer = 0x44B; } // Moon Jump On L - if (CVar_GetS32("gMoonJumpOnL", 0) != 0) { + if (CVarGetInteger("gMoonJumpOnL", 0) != 0) { if (gPlayState) { Player* player = GET_PLAYER(gPlayState); @@ -403,7 +403,7 @@ void GameState_Update(GameState* gameState) { } // Permanent infinite sword glitch (ISG) - if (CVar_GetS32("gEzISG", 0) != 0) { + if (CVarGetInteger("gEzISG", 0) != 0) { if (gPlayState) { Player* player = GET_PLAYER(gPlayState); player->swordState = 1; @@ -411,7 +411,7 @@ void GameState_Update(GameState* gameState) { } // Unrestricted Items - if (CVar_GetS32("gNoRestrictItems", 0) != 0) { + if (CVarGetInteger("gNoRestrictItems", 0) != 0) { if (gPlayState) { u8 sunsBackup = gPlayState->interfaceCtx.restrictions.sunsSong; memset(&gPlayState->interfaceCtx.restrictions, 0, sizeof(gPlayState->interfaceCtx.restrictions)); @@ -420,20 +420,20 @@ void GameState_Update(GameState* gameState) { } // Freeze Time - if (CVar_GetS32("gFreezeTime", 0) != 0) { - if (CVar_GetS32("gPrevTime", -1) == -1) { - CVar_SetS32("gPrevTime", gSaveContext.dayTime); + if (CVarGetInteger("gFreezeTime", 0) != 0) { + if (CVarGetInteger("gPrevTime", -1) == -1) { + CVarSetInteger("gPrevTime", gSaveContext.dayTime); } - int32_t prevTime = CVar_GetS32("gPrevTime", gSaveContext.dayTime); + int32_t prevTime = CVarGetInteger("gPrevTime", gSaveContext.dayTime); gSaveContext.dayTime = prevTime; } else { - CVar_SetS32("gPrevTime", -1); + CVarSetInteger("gPrevTime", -1); } //Switches Link's age and respawns him at the last entrance he entered. - if (CVar_GetS32("gSwitchAge", 0) != 0) { - CVar_SetS32("gSwitchAge", 0); + if (CVarGetInteger("gSwitchAge", 0) != 0) { + CVarSetInteger("gSwitchAge", 0); if (gPlayState) { playerPos = GET_PLAYER(gPlayState)->actor.world.pos; playerYaw = GET_PLAYER(gPlayState)->actor.shape.rot.y; @@ -458,7 +458,7 @@ void GameState_Update(GameState* gameState) { } } - gSaveContext.language = CVar_GetS32("gLanguages", LANGUAGE_ENG); + gSaveContext.language = CVarGetInteger("gLanguages", LANGUAGE_ENG); gameState->frames++; } diff --git a/soh/src/code/graph.c b/soh/src/code/graph.c index c6354ae93..b8cd4bba0 100644 --- a/soh/src/code/graph.c +++ b/soh/src/code/graph.c @@ -395,7 +395,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { sGraphUpdateTime = time; } - if (CVar_GetS32("gDebugEnabled", 0)) + if (CVarGetInteger("gDebugEnabled", 0)) { if (CHECK_BTN_ALL(gameState->input[0].press.button, BTN_Z) && CHECK_BTN_ALL(gameState->input[0].cur.button, BTN_L | BTN_R)) { diff --git a/soh/src/code/main.c b/soh/src/code/main.c index d933f6923..08e9ecdc1 100644 --- a/soh/src/code/main.c +++ b/soh/src/code/main.c @@ -1,9 +1,13 @@ +#ifdef _WIN32 +#include +#endif + #include "global.h" #include "vt.h" #include #include "soh/OTRGlobals.h" -#include +#include #include "soh/CrashHandlerExp.h" @@ -45,10 +49,10 @@ int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hInstPrev, PSTR cmdline, int cmd int main(int argc, char** argv) #endif { - CrashHandler_Init(CrashHandler_PrintSohData); - GameConsole_Init(); InitOTR(); + // TODO: Was moved to below InitOTR because it requires window to be setup. But will be late to catch crashes. + CrashHandlerRegisterCallback(CrashHandler_PrintSohData); BootCommands_Init(); Main(0); diff --git a/soh/src/code/padmgr.c b/soh/src/code/padmgr.c index 48752fed1..c79bbfe16 100644 --- a/soh/src/code/padmgr.c +++ b/soh/src/code/padmgr.c @@ -309,7 +309,7 @@ void PadMgr_ProcessInputs(PadMgr* padMgr) { } OTRControllerCallback(&controllerCallback); - if (CVar_GetS32("gPauseBufferBlockInputFrame", 0)) { + if (CVarGetInteger("gPauseBufferBlockInputFrame", 0)) { Controller_BlockGameInput(); } else { Controller_UnblockGameInput(); diff --git a/soh/src/code/shrink_window.c b/soh/src/code/shrink_window.c index ee7822df0..015820421 100644 --- a/soh/src/code/shrink_window.c +++ b/soh/src/code/shrink_window.c @@ -6,7 +6,7 @@ s32 sShrinkWindowVal = 0; s32 sShrinkWindowCurrentVal = 0; void ShrinkWindow_SetVal(s32 value) { - if (CVar_GetS32("gDisableBlackBars", 0)) { + if (CVarGetInteger("gDisableBlackBars", 0)) { sShrinkWindowVal = 0; return; } @@ -21,7 +21,7 @@ u32 ShrinkWindow_GetVal(void) { } void ShrinkWindow_SetCurrentVal(s32 currentVal) { - if (CVar_GetS32("gDisableBlackBars", 0)) { + if (CVarGetInteger("gDisableBlackBars", 0)) { sShrinkWindowCurrentVal = 0; return; } diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 48ca8d414..97494de44 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -347,50 +347,50 @@ void func_8002BE98(TargetContext* targetCtx, s32 actorCategory, PlayState* play) } void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorCategory, PlayState* play) { - if (CVar_GetS32("gCosmetics.Navi_IdlePrimary.Changed", 0)) { - sNaviColorList[ACTORCAT_PLAYER].inner = CVar_GetRGBA("gCosmetics.Navi_IdlePrimary.Value", defaultIdlePrimaryColor); + if (CVarGetInteger("gCosmetics.Navi_IdlePrimary.Changed", 0)) { + sNaviColorList[ACTORCAT_PLAYER].inner = CVarGetColor("gCosmetics.Navi_IdlePrimary.Value", defaultIdlePrimaryColor); } else { sNaviColorList[ACTORCAT_PLAYER].inner = defaultIdlePrimaryColor; } - if (CVar_GetS32("gCosmetics.Navi_IdleSecondary.Changed", 0)) { - sNaviColorList[ACTORCAT_PLAYER].outer = CVar_GetRGBA("gCosmetics.Navi_IdleSecondary.Value", defaultIdleSecondaryColor); + if (CVarGetInteger("gCosmetics.Navi_IdleSecondary.Changed", 0)) { + sNaviColorList[ACTORCAT_PLAYER].outer = CVarGetColor("gCosmetics.Navi_IdleSecondary.Value", defaultIdleSecondaryColor); } else { sNaviColorList[ACTORCAT_PLAYER].outer = defaultIdleSecondaryColor; } - if (CVar_GetS32("gCosmetics.Navi_NPCPrimary.Changed", 0)) { - sNaviColorList[ACTORCAT_NPC].inner = CVar_GetRGBA("gCosmetics.Navi_NPCPrimary.Value", defaultNPCPrimaryColor); + if (CVarGetInteger("gCosmetics.Navi_NPCPrimary.Changed", 0)) { + sNaviColorList[ACTORCAT_NPC].inner = CVarGetColor("gCosmetics.Navi_NPCPrimary.Value", defaultNPCPrimaryColor); } else { sNaviColorList[ACTORCAT_NPC].inner = defaultNPCPrimaryColor; } - if (CVar_GetS32("gCosmetics.Navi_NPCSecondary.Changed", 0)) { - sNaviColorList[ACTORCAT_NPC].outer = CVar_GetRGBA("gCosmetics.Navi_NPCSecondary.Value", defaultNPCSecondaryColor); + if (CVarGetInteger("gCosmetics.Navi_NPCSecondary.Changed", 0)) { + sNaviColorList[ACTORCAT_NPC].outer = CVarGetColor("gCosmetics.Navi_NPCSecondary.Value", defaultNPCSecondaryColor); } else { sNaviColorList[ACTORCAT_NPC].outer = defaultNPCSecondaryColor; } - if (CVar_GetS32("gCosmetics.Navi_EnemyPrimary.Changed", 0)) { - sNaviColorList[ACTORCAT_ENEMY].inner = CVar_GetRGBA("gCosmetics.Navi_EnemyPrimary.Value", defaultEnemyPrimaryColor); - sNaviColorList[ACTORCAT_BOSS].inner = CVar_GetRGBA("gCosmetics.Navi_EnemyPrimary.Value", defaultEnemyPrimaryColor); + if (CVarGetInteger("gCosmetics.Navi_EnemyPrimary.Changed", 0)) { + sNaviColorList[ACTORCAT_ENEMY].inner = CVarGetColor("gCosmetics.Navi_EnemyPrimary.Value", defaultEnemyPrimaryColor); + sNaviColorList[ACTORCAT_BOSS].inner = CVarGetColor("gCosmetics.Navi_EnemyPrimary.Value", defaultEnemyPrimaryColor); } else { sNaviColorList[ACTORCAT_ENEMY].inner = defaultEnemyPrimaryColor; sNaviColorList[ACTORCAT_BOSS].inner = defaultEnemyPrimaryColor; } - if (CVar_GetS32("gCosmetics.Navi_EnemySecondary.Changed", 0)) { - sNaviColorList[ACTORCAT_ENEMY].outer = CVar_GetRGBA("gCosmetics.Navi_EnemySecondary.Value", defaultEnemySecondaryColor); - sNaviColorList[ACTORCAT_BOSS].outer = CVar_GetRGBA("gCosmetics.Navi_EnemySecondary.Value", defaultEnemySecondaryColor); + if (CVarGetInteger("gCosmetics.Navi_EnemySecondary.Changed", 0)) { + sNaviColorList[ACTORCAT_ENEMY].outer = CVarGetColor("gCosmetics.Navi_EnemySecondary.Value", defaultEnemySecondaryColor); + sNaviColorList[ACTORCAT_BOSS].outer = CVarGetColor("gCosmetics.Navi_EnemySecondary.Value", defaultEnemySecondaryColor); } else { sNaviColorList[ACTORCAT_ENEMY].outer = defaultEnemySecondaryColor; sNaviColorList[ACTORCAT_BOSS].outer = defaultEnemySecondaryColor; } - if (CVar_GetS32("gCosmetics.Navi_PropsPrimary.Changed", 0)) { - sNaviColorList[ACTORCAT_PROP].inner = CVar_GetRGBA("gCosmetics.Navi_PropsPrimary.Value", defaultPropsPrimaryColor); + if (CVarGetInteger("gCosmetics.Navi_PropsPrimary.Changed", 0)) { + sNaviColorList[ACTORCAT_PROP].inner = CVarGetColor("gCosmetics.Navi_PropsPrimary.Value", defaultPropsPrimaryColor); } else { sNaviColorList[ACTORCAT_PROP].inner = defaultPropsPrimaryColor; } - if (CVar_GetS32("gCosmetics.Navi_PropsSecondary.Changed", 0)) { - sNaviColorList[ACTORCAT_PROP].outer = CVar_GetRGBA("gCosmetics.Navi_PropsSecondary.Value", defaultPropsSecondaryColor); + if (CVarGetInteger("gCosmetics.Navi_PropsSecondary.Changed", 0)) { + sNaviColorList[ACTORCAT_PROP].outer = CVarGetColor("gCosmetics.Navi_PropsSecondary.Value", defaultPropsSecondaryColor); } else { sNaviColorList[ACTORCAT_PROP].outer = defaultPropsSecondaryColor; } @@ -797,7 +797,7 @@ void TitleCard_InitBossName(PlayState* play, TitleCardContext* titleCtx, void* t u8 height, s16 hasTranslation) { if (ResourceMgr_OTRSigCheck(texture)) - texture = ResourceMgr_LoadTexByName(texture); + texture = GetResourceDataByName(texture, false); titleCtx->texture = texture; titleCtx->isBossCard = true; @@ -1019,7 +1019,7 @@ void TitleCard_InitPlaceName(PlayState* play, TitleCardContext* titleCtx, void* texture = newName; } - titleCtx->texture = ResourceMgr_LoadTexByName(texture); + titleCtx->texture = GetResourceDataByName(texture, false); //titleCtx->texture = texture; titleCtx->isBossCard = false; @@ -1035,10 +1035,10 @@ void TitleCard_InitPlaceName(PlayState* play, TitleCardContext* titleCtx, void* void TitleCard_Update(PlayState* play, TitleCardContext* titleCtx) { const Color_RGB8 TitleCard_Colors_ori = {255,255,255}; Color_RGB8 TitleCard_Colors = {255,255,255}; - if (titleCtx->isBossCard && CVar_GetS32("gHudColors", 1) == 2) {//Bosses cards. - TitleCard_Colors = CVar_GetRGB("gCCTC_B_U_Prim", TitleCard_Colors_ori); - } else if (!titleCtx->isBossCard && CVar_GetS32("gHudColors", 1) == 2) { - TitleCard_Colors = CVar_GetRGB("gCCTC_OW_U_Prim", TitleCard_Colors_ori); + if (titleCtx->isBossCard && CVarGetInteger("gHudColors", 1) == 2) {//Bosses cards. + TitleCard_Colors = CVarGetColor24("gCCTC_B_U_Prim", TitleCard_Colors_ori); + } else if (!titleCtx->isBossCard && CVarGetInteger("gHudColors", 1) == 2) { + TitleCard_Colors = CVarGetColor24("gCCTC_OW_U_Prim", TitleCard_Colors_ori); } else { TitleCard_Colors = TitleCard_Colors_ori; } @@ -1073,20 +1073,20 @@ void TitleCard_Draw(PlayState* play, TitleCardContext* titleCtx) { if (titleCtx->alpha != 0) { width = titleCtx->width; height = titleCtx->height; - s16 TitleCard_PosX_Modifier = (titleCtx->isBossCard ? CVar_GetS32("gTCBPosX", 0) : CVar_GetS32("gTCMPosX", 0)); - s16 TitleCard_PosY_Modifier = (titleCtx->isBossCard ? CVar_GetS32("gTCBPosY", 0) : CVar_GetS32("gTCMPosY", 0)); - s16 TitleCard_PosType_Checker = (titleCtx->isBossCard ? CVar_GetS32("gTCBPosType", 0) : CVar_GetS32("gTCMPosType", 0)); - s16 TitleCard_Margin_Checker = (titleCtx->isBossCard ? CVar_GetS32("gTCBUseMargins", 0) : CVar_GetS32("gTCMUseMargins", 0)); + s16 TitleCard_PosX_Modifier = (titleCtx->isBossCard ? CVarGetInteger("gTCBPosX", 0) : CVarGetInteger("gTCMPosX", 0)); + s16 TitleCard_PosY_Modifier = (titleCtx->isBossCard ? CVarGetInteger("gTCBPosY", 0) : CVarGetInteger("gTCMPosY", 0)); + s16 TitleCard_PosType_Checker = (titleCtx->isBossCard ? CVarGetInteger("gTCBPosType", 0) : CVarGetInteger("gTCMPosType", 0)); + s16 TitleCard_Margin_Checker = (titleCtx->isBossCard ? CVarGetInteger("gTCBUseMargins", 0) : CVarGetInteger("gTCMUseMargins", 0)); s16 TitleCard_MarginX = 0; s16 TitleCard_PosX = titleCtx->x; s16 TitleCard_PosY = titleCtx->y; if (TitleCard_PosType_Checker != 0) { TitleCard_PosY = TitleCard_PosY_Modifier; if (TitleCard_PosType_Checker == 1) {//Anchor Left - if (TitleCard_Margin_Checker != 0) {TitleCard_MarginX = CVar_GetS32("gHUDMargin_L", 0)*-1;}; + if (TitleCard_Margin_Checker != 0) {TitleCard_MarginX = CVarGetInteger("gHUDMargin_L", 0)*-1;}; TitleCard_PosX = OTRGetDimensionFromLeftEdge(TitleCard_PosX_Modifier+TitleCard_MarginX)-11; } else if (TitleCard_PosType_Checker == 2) {//Anchor Right - if (TitleCard_Margin_Checker != 0) {TitleCard_MarginX = CVar_GetS32("gHUDMargin_R", 0);}; + if (TitleCard_Margin_Checker != 0) {TitleCard_MarginX = CVarGetInteger("gHUDMargin_R", 0);}; TitleCard_PosX = OTRGetDimensionFromRightEdge(TitleCard_PosX_Modifier+TitleCard_MarginX); } else if (TitleCard_PosType_Checker == 3) {//Anchor None TitleCard_PosX = TitleCard_PosX_Modifier; @@ -1212,7 +1212,7 @@ void Actor_Init(Actor* actor, PlayState* play) { actor->uncullZoneForward = 1000.0f; actor->uncullZoneScale = 350.0f; actor->uncullZoneDownward = 700.0f; - if (CVar_GetS32("gDisableDrawDistance", 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room + if (CVarGetInteger("gDisableDrawDistance", 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room && actor->id != ACTOR_EN_HORSE // Check for Epona, else if we call her she will spawn at the other side of the map + we can hear her during the title screen sequence && actor->id != ACTOR_EN_HORSE_GANON && actor->id != ACTOR_EN_HORSE_ZELDA // check for Zelda's and Ganondorf's horses that will always be scene during cinematic whith camera paning && (play->sceneNum != SCENE_DDAN && actor->id != ACTOR_EN_ZF)) { // Check for DC and Lizalfos for the case where the miniboss music would still play under certains conditions and changing room @@ -2855,7 +2855,7 @@ s32 func_800314B0(PlayState* play, Actor* actor) { s32 func_800314D4(PlayState* play, Actor* actor, Vec3f* arg2, f32 arg3) { f32 var; - if (CVar_GetS32("gDisableDrawDistance", 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room + if (CVarGetInteger("gDisableDrawDistance", 0) != 0 && actor->id != ACTOR_EN_TORCH2 && actor->id != ACTOR_EN_BLKOBJ // Extra check for Dark Link and his room && actor->id != ACTOR_EN_HORSE // Check for Epona, else if we call her she will spawn at the other side of the map + we can hear her during the title screen sequence && actor->id != ACTOR_EN_HORSE_GANON && actor->id != ACTOR_EN_HORSE_ZELDA // check for Zelda's and Ganondorf's horses that will always be scene during cinematic whith camera paning && (play->sceneNum != SCENE_DDAN && actor->id != ACTOR_EN_ZF)) { // Check for DC and Lizalfos for the case where the miniboss music would still play under certains conditions and changing room @@ -3160,7 +3160,7 @@ int gMapLoading = 0; Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params, s16 canRandomize) { - uint8_t tryRandomizeEnemy = CVar_GetS32("gRandomizedEnemies", 0) && gSaveContext.fileNum >= 0 && gSaveContext.fileNum <= 2 && canRandomize; + uint8_t tryRandomizeEnemy = CVarGetInteger("gRandomizedEnemies", 0) && gSaveContext.fileNum >= 0 && gSaveContext.fileNum <= 2 && canRandomize; if (tryRandomizeEnemy) { if (!GetRandomizedEnemy(play, &actorId, &posX, &posY, &posZ, &rotX, &rotY, &rotZ, ¶ms)) { @@ -3252,7 +3252,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos objBankIndex = Object_GetIndex(&play->objectCtx, actorInit->objectId); - if (objBankIndex < 0 && (!gMapLoading || CVar_GetS32("gRandomizedEnemies", 0))) { + if (objBankIndex < 0 && (!gMapLoading || CVarGetInteger("gRandomizedEnemies", 0))) { objBankIndex = 0; } @@ -3331,7 +3331,7 @@ Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, PlayState* play // Gohma (z_boss_goma.c), the Stalchildren spawner (z_en_encount1.c) and the falling platform spawning Stalfos in // Forest Temple (z_bg_mori_bigst.c) that normally rely on this behaviour are changed when // Enemy Rando is on so they still work properly even without assigning a parent. - if (CVar_GetS32("gRandomizedEnemies", 0) && (spawnedActor->id == ACTOR_EN_FLOORMAS || spawnedActor->id == ACTOR_EN_PEEHAT)) { + if (CVarGetInteger("gRandomizedEnemies", 0) && (spawnedActor->id == ACTOR_EN_FLOORMAS || spawnedActor->id == ACTOR_EN_PEEHAT)) { return spawnedActor; } diff --git a/soh/src/code/z_bgcheck.c b/soh/src/code/z_bgcheck.c index 0b0025927..22e89e291 100644 --- a/soh/src/code/z_bgcheck.c +++ b/soh/src/code/z_bgcheck.c @@ -1898,7 +1898,7 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul s32 bgId2; f32 nx, ny, nz; // unit normal of polygon - if (CVar_GetS32("gNoClip", 0) != 0) { + if (CVarGetInteger("gNoClip", 0) != 0) { return false; } @@ -4021,7 +4021,7 @@ u32 func_80041D94(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) { * SurfaceType Get Wall Flags */ s32 func_80041DB8(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) { - if (CVar_GetS32("gClimbEverything", 0) != 0) { + if (CVarGetInteger("gClimbEverything", 0) != 0) { return (1 << 3) | D_80119D90[func_80041D94(colCtx, poly, bgId)]; } else { return D_80119D90[func_80041D94(colCtx, poly, bgId)]; @@ -4118,7 +4118,7 @@ u32 SurfaceType_GetEcho(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) * SurfaceType Is Hookshot Surface */ u32 SurfaceType_IsHookshotSurface(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) { - return CVar_GetS32("gHookshotEverything", 0) || SurfaceType_GetData(colCtx, poly, bgId, 1) >> 17 & 1; + return CVarGetInteger("gHookshotEverything", 0) || SurfaceType_GetData(colCtx, poly, bgId, 1) >> 17 & 1; } /** diff --git a/soh/src/code/z_camera.c b/soh/src/code/z_camera.c index c4db72565..ee999ee3e 100644 --- a/soh/src/code/z_camera.c +++ b/soh/src/code/z_camera.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" #include "vt.h" @@ -1239,7 +1239,7 @@ f32 Camera_LERPClampDist(Camera* camera, f32 dist, f32 min, f32 max) { camera->rUpdateRateInv = Camera_LERPCeilF(rUpdateRateInvTarget, camera->rUpdateRateInv, PCT(OREG(25)), 0.1f); return Camera_LERPCeilF(distTarget, camera->dist, 1.0f / camera->rUpdateRateInv, - CVar_GetS32("gFixCameraDrift", 0) ? 0.0f : 0.2f); + CVarGetInteger("gFixCameraDrift", 0) ? 0.0f : 0.2f); } f32 Camera_ClampDist(Camera* camera, f32 dist, f32 minDist, f32 maxDist, s16 timer) { @@ -1262,7 +1262,7 @@ f32 Camera_ClampDist(Camera* camera, f32 dist, f32 minDist, f32 maxDist, s16 tim camera->rUpdateRateInv = Camera_LERPCeilF(rUpdateRateInvTarget, camera->rUpdateRateInv, PCT(OREG(25)), 0.1f); return Camera_LERPCeilF(distTarget, camera->dist, 1.0f / camera->rUpdateRateInv, - CVar_GetS32("gFixCameraDrift", 0) ? 0.0f : 0.2f); + CVarGetInteger("gFixCameraDrift", 0) ? 0.0f : 0.2f); } s16 Camera_CalcDefaultPitch(Camera* camera, s16 arg1, s16 arg2, s16 arg3) { @@ -1485,11 +1485,11 @@ s32 Camera_Free(Camera* camera) { camera->animState = 0; - f32 newCamX = -D_8015BD7C->state.input[0].cur.right_stick_x * 10.0f * (CVar_GetFloat("gThirdPersonCameraSensitivity", 1.0f)); - f32 newCamY = D_8015BD7C->state.input[0].cur.right_stick_y * 10.0f * (CVar_GetFloat("gThirdPersonCameraSensitivity", 1.0f)); + f32 newCamX = -D_8015BD7C->state.input[0].cur.right_stick_x * 10.0f * (CVarGetFloat("gThirdPersonCameraSensitivity", 1.0f)); + f32 newCamY = D_8015BD7C->state.input[0].cur.right_stick_y * 10.0f * (CVarGetFloat("gThirdPersonCameraSensitivity", 1.0f)); - camera->play->camX += newCamX * (CVar_GetS32("gInvertXAxis", 0) ? -1 : 1); - camera->play->camY += newCamY * (CVar_GetS32("gInvertYAxis", 1) ? 1 : -1); + camera->play->camX += newCamX * (CVarGetInteger("gInvertXAxis", 0) ? -1 : 1); + camera->play->camY += newCamY * (CVarGetInteger("gInvertYAxis", 1) ? 1 : -1); if (camera->play->camY > 0x32A4) { camera->play->camY = 0x32A4; @@ -1498,8 +1498,8 @@ s32 Camera_Free(Camera* camera) { camera->play->camY = -0x228C; } - f32 distTarget = CVar_GetS32("gFreeCameraDistMax", para1->distTarget); - f32 speedScaler = CVar_GetS32("gFreeCameraTransitionSpeed", 25); + f32 distTarget = CVarGetInteger("gFreeCameraDistMax", para1->distTarget); + f32 speedScaler = CVarGetInteger("gFreeCameraTransitionSpeed", 25); f32 distDiff = ABS(distTarget - camera->dist); if (distDiff > 0) camera->dist = Camera_LERPCeilF(distTarget, camera->dist, speedScaler / (distDiff + speedScaler), 0.0f); @@ -1523,7 +1523,7 @@ s32 Camera_Free(Camera* camera) { } s32 Camera_Normal1(Camera* camera) { - if (CVar_GetS32("gFreeCamera", 0) && SetCameraManual(camera) == 1) { + if (CVarGetInteger("gFreeCamera", 0) && SetCameraManual(camera) == 1) { Camera_Free(camera); return 1; } @@ -1704,7 +1704,7 @@ s32 Camera_Normal1(Camera* camera) { Camera_Vec3fVecSphGeoAdd(eyeNext, at, &eyeAdjustment); if ((camera->status == CAM_STAT_ACTIVE) && (!(norm1->interfaceFlags & 0x10))) { anim->swingYawTarget = BINANG_ROT180(camera->playerPosRot.rot.y); - if (!CVar_GetS32("gFixCameraSwing", 0)) { + if (!CVarGetInteger("gFixCameraSwing", 0)) { if (anim->startSwingTimer > 0) { func_80046E20(camera, &eyeAdjustment, norm1->distMin, norm1->unk_0C, &sp98, &anim->swing); } else { @@ -1743,7 +1743,7 @@ s32 Camera_Normal1(Camera* camera) { } // crit wiggle - if(!CVar_GetS32("gDisableCritWiggle",0)) { + if(!CVarGetInteger("gDisableCritWiggle",0)) { if (gSaveContext.health <= 16 && ((camera->play->state.frames % 256) == 0)) { wiggleAdj = Rand_ZeroOne() * 10000.0f; camera->inputDir.y = wiggleAdj + camera->inputDir.y; @@ -1764,7 +1764,7 @@ s32 Camera_Normal1(Camera* camera) { } s32 Camera_Normal2(Camera* camera) { - if (CVar_GetS32("gFreeCamera", 0) && SetCameraManual(camera) == 1) { + if (CVarGetInteger("gFreeCamera", 0) && SetCameraManual(camera) == 1) { Camera_Free(camera); return 1; } @@ -1935,7 +1935,7 @@ s32 Camera_Normal2(Camera* camera) { // riding epona s32 Camera_Normal3(Camera* camera) { - if (CVar_GetS32("gFreeCamera", 0) && SetCameraManual(camera) == 1) { + if (CVarGetInteger("gFreeCamera", 0) && SetCameraManual(camera) == 1) { Camera_Free(camera); return 1; } @@ -2301,7 +2301,7 @@ s32 Camera_Parallel0(Camera* camera) { * Generic jump, jumping off ledges */ s32 Camera_Jump1(Camera* camera) { - if (CVar_GetS32("gFreeCamera", 0) && SetCameraManual(camera) == 1) { + if (CVarGetInteger("gFreeCamera", 0) && SetCameraManual(camera) == 1) { Camera_Free(camera); return 1; } @@ -2451,7 +2451,7 @@ s32 Camera_Jump1(Camera* camera) { // Climbing ladders/vines s32 Camera_Jump2(Camera* camera) { - if (CVar_GetS32("gFreeCamera", 0) && SetCameraManual(camera) == 1) { + if (CVarGetInteger("gFreeCamera", 0) && SetCameraManual(camera) == 1) { Camera_Free(camera); return 1; } @@ -2638,7 +2638,7 @@ s32 Camera_Jump2(Camera* camera) { // swimming s32 Camera_Jump3(Camera* camera) { - if (CVar_GetS32("gFreeCamera", 0) && SetCameraManual(camera) == 1) { + if (CVarGetInteger("gFreeCamera", 0) && SetCameraManual(camera) == 1) { Camera_Free(camera); return 1; } @@ -3100,7 +3100,7 @@ s32 Camera_Battle3(Camera* camera) { * setting value. */ s32 Camera_Battle4(Camera* camera) { - if (CVar_GetS32("gFreeCamera", 0) && SetCameraManual(camera) == 1) { + if (CVarGetInteger("gFreeCamera", 0) && SetCameraManual(camera) == 1) { Camera_Free(camera); return 1; } @@ -4635,7 +4635,7 @@ s32 Camera_Data4(Camera* camera) { * Hanging off of a ledge */ s32 Camera_Unique1(Camera* camera) { - if (CVar_GetS32("gFreeCamera", 0) && SetCameraManual(camera) == 1) { + if (CVarGetInteger("gFreeCamera", 0) && SetCameraManual(camera) == 1) { Camera_Free(camera); return 1; } @@ -4722,7 +4722,7 @@ s32 Camera_Unique1(Camera* camera) { anim->timer--; } - sp8C.yaw = Camera_LERPFloorS(anim->yawTarget, eyeNextAtOffset.yaw, 0.5f, CVar_GetS32("gFixHangingLedgeSwingRate", 0) ? 0xA : 0x2710); + sp8C.yaw = Camera_LERPFloorS(anim->yawTarget, eyeNextAtOffset.yaw, 0.5f, CVarGetInteger("gFixHangingLedgeSwingRate", 0) ? 0xA : 0x2710); Camera_Vec3fVecSphGeoAdd(eyeNext, at, &sp8C); *eye = *eyeNext; Camera_BGCheck(camera, at, eye); @@ -7615,7 +7615,7 @@ Vec3s Camera_Update(Camera* camera) { } // enable/disable debug cam - if (CVar_GetS32("gDebugCamera", 0) && CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_START)) { + if (CVarGetInteger("gDebugCamera", 0) && CHECK_BTN_ALL(D_8015BD7C->state.input[2].press.button, BTN_START)) { gDbgCamEnabled ^= 1; if (gDbgCamEnabled) { DbgCamera_Enable(&D_8015BD80, camera); @@ -7697,7 +7697,7 @@ Vec3s Camera_Update(Camera* camera) { BINANG_TO_DEGF(camera->camDir.x), camera->camDir.y, BINANG_TO_DEGF(camera->camDir.y)); } - if (camera->timer != -1 && CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_DRIGHT) && CVar_GetS32("gDebugCamera", 0)) { + if (camera->timer != -1 && CHECK_BTN_ALL(D_8015BD7C->state.input[0].press.button, BTN_DRIGHT) && CVarGetInteger("gDebugCamera", 0)) { camera->timer = 0; } diff --git a/soh/src/code/z_camera_data.inc b/soh/src/code/z_camera_data.inc index f7bd99549..b9e0ba864 100644 --- a/soh/src/code/z_camera_data.inc +++ b/soh/src/code/z_camera_data.inc @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/code/z_common_data.c b/soh/src/code/z_common_data.c index aa0e3cca3..83486b2d7 100644 --- a/soh/src/code/z_common_data.c +++ b/soh/src/code/z_common_data.c @@ -8,7 +8,7 @@ void SaveContext_Init(void) { gSaveContext.seqId = (u8)NA_BGM_DISABLED; gSaveContext.natureAmbienceId = NATURE_ID_DISABLED; gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX; - gSaveContext.nextCutsceneIndex = CVar_GetS32("gBetaQuestWorld", 0xFFEF); + gSaveContext.nextCutsceneIndex = CVarGetInteger("gBetaQuestWorld", 0xFFEF); gSaveContext.cutsceneTrigger = 0; gSaveContext.chamberCutsceneNum = 0; gSaveContext.nextDayTime = 0xFFFF; diff --git a/soh/src/code/z_construct.c b/soh/src/code/z_construct.c index 6c5f6e21d..1b77d38b3 100644 --- a/soh/src/code/z_construct.c +++ b/soh/src/code/z_construct.c @@ -48,11 +48,11 @@ void func_801109B0(PlayState* play) { ASSERT(interfaceCtx->doActionSegment != NULL); - uint32_t attackDoActionTexSize = ResourceMgr_LoadTexSizeByName(gAttackDoActionENGTex); - memcpy(interfaceCtx->doActionSegment, ResourceMgr_LoadTexByName(gAttackDoActionENGTex), attackDoActionTexSize); - memcpy(interfaceCtx->doActionSegment + (attackDoActionTexSize / 2), ResourceMgr_LoadTexByName(gCheckDoActionENGTex), attackDoActionTexSize); + uint32_t attackDoActionTexSize = GetResourceTexSizeByName(gAttackDoActionENGTex, false); + memcpy(interfaceCtx->doActionSegment, GetResourceDataByName(gAttackDoActionENGTex, false), attackDoActionTexSize); + memcpy(interfaceCtx->doActionSegment + (attackDoActionTexSize / 2), GetResourceDataByName(gCheckDoActionENGTex, false), attackDoActionTexSize); - memcpy(interfaceCtx->doActionSegment + attackDoActionTexSize, ResourceMgr_LoadTexByName(gReturnDoActionENGTex), ResourceMgr_LoadTexSizeByName(gReturnDoActionENGTex)); + memcpy(interfaceCtx->doActionSegment + attackDoActionTexSize, GetResourceDataByName(gReturnDoActionENGTex, false), GetResourceTexSizeByName(gReturnDoActionENGTex, false)); interfaceCtx->iconItemSegment = GAMESTATE_ALLOC_MC( &play->state, 0x1000 * ARRAY_COUNT(gSaveContext.equips.buttonItems)); @@ -431,7 +431,7 @@ void func_80111070(void) { WREG(28) = 0; R_OW_MINIMAP_X = 238; R_OW_MINIMAP_Y = 164; - R_MINIMAP_DISABLED = CVar_GetS32("gMinimalUI", 0); + R_MINIMAP_DISABLED = CVarGetInteger("gMinimalUI", 0); WREG(32) = 122; WREG(33) = 60; WREG(35) = 0; diff --git a/soh/src/code/z_debug.c b/soh/src/code/z_debug.c index c2129ee5f..294f530cc 100644 --- a/soh/src/code/z_debug.c +++ b/soh/src/code/z_debug.c @@ -109,7 +109,7 @@ void func_8006390C(Input* input) { InputCombo* input_combo; s32 i; - if (!CVar_GetS32("gDebugEnabled", 0)) + if (!CVarGetInteger("gDebugEnabled", 0)) return; regGroup = (gGameInfo->regGroup * REG_PAGES + gGameInfo->regPage) * REG_PER_PAGE - REG_PER_PAGE; @@ -192,7 +192,7 @@ void func_80063C04(GfxPrint* printer) { s32 pad; char name[3]; - if (!CVar_GetS32("gDebugEnabled", 0)) + if (!CVarGetInteger("gDebugEnabled", 0)) return; // set up register name string @@ -219,7 +219,7 @@ void func_80063D7C(GraphicsContext* gfxCtx) { GfxPrint printer; Gfx* tempRet; - if (!CVar_GetS32("gDebugEnabled", 0)) + if (!CVarGetInteger("gDebugEnabled", 0)) return; OPEN_DISPS(gfxCtx); diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c index 8aff4abd7..bca0a5326 100644 --- a/soh/src/code/z_demo.c +++ b/soh/src/code/z_demo.c @@ -499,7 +499,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB // cmd->base == 33: Zelda escaping with impa cutscene bool randoCsSkip = (gSaveContext.n64ddFlag && (cmd->base == 8 || cmd->base == 24 || cmd->base == 33)); bool debugCsSkip = (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_START) && - (gSaveContext.fileNum != 0xFEDC) && CVar_GetS32("gDebugEnabled", 0)); + (gSaveContext.fileNum != 0xFEDC) && CVarGetInteger("gDebugEnabled", 0)); if ((gSaveContext.gameMode != 0) && (gSaveContext.gameMode != 3) && (play->sceneNum != SCENE_SPOT00) && (csCtx->frames > 20) && @@ -512,9 +512,9 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB } bool playCutscene = false; - if (!CVar_GetS32("gCreditsFix", 1) && (cmd->startFrame == csCtx->frames)) { + if (!CVarGetInteger("gCreditsFix", 1) && (cmd->startFrame == csCtx->frames)) { playCutscene = true; - } else if (CVar_GetS32("gCreditsFix", 1)) { + } else if (CVarGetInteger("gCreditsFix", 1)) { u16 delay = 0; // HACK: Align visual timing with audio during credits sequence @@ -1637,7 +1637,7 @@ void Cutscene_ProcessCommands(PlayState* play, CutsceneContext* csCtx, u8* cutsc return; } - if (CVar_GetS32("gDebugEnabled", 0) && CHECK_BTN_ALL(play->state.input[0].press.button, BTN_DRIGHT)) { + if (CVarGetInteger("gDebugEnabled", 0) && CHECK_BTN_ALL(play->state.input[0].press.button, BTN_DRIGHT)) { csCtx->state = CS_STATE_UNSKIPPABLE_INIT; return; } diff --git a/soh/src/code/z_draw.c b/soh/src/code/z_draw.c index 140ee399a..7c6b71c6c 100644 --- a/soh/src/code/z_draw.c +++ b/soh/src/code/z_draw.c @@ -757,13 +757,13 @@ void GetItem_DrawRecoveryHeart(PlayState* play, s16 drawId) { 1 * -(play->state.frames * 2), 32, 32)); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); - if (CVar_GetS32("gCosmetics.Consumable_Hearts.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.Consumable_Hearts.Value", (Color_RGB8) { 255, 70, 50 }); + if (CVarGetInteger("gCosmetics.Consumable_Hearts.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.Consumable_Hearts.Value", (Color_RGB8) { 255, 70, 50 }); gDPSetGrayscaleColor(POLY_XLU_DISP++, color.r, color.g, color.b, 255); gSPGrayscale(POLY_XLU_DISP++, true); } gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].dlists[0]); - if (CVar_GetS32("gCosmetics.Consumable_Hearts.Changed", 0)) { + if (CVarGetInteger("gCosmetics.Consumable_Hearts.Changed", 0)) { gSPGrayscale(POLY_XLU_DISP++, false); } CLOSE_DISPS(play->state.gfxCtx); diff --git a/soh/src/code/z_eff_blure.c b/soh/src/code/z_eff_blure.c index 267214ffd..454525868 100644 --- a/soh/src/code/z_eff_blure.c +++ b/soh/src/code/z_eff_blure.c @@ -206,14 +206,14 @@ s32 EffectBlure_Update(void* thisx) { switch (this->trailType) { //there HAS to be a better way to do this. case 2: - if (CVar_GetS32("gCosmetics.Trails_Boomerang.Changed", 0)) { - color = CVar_GetRGBA("gCosmetics.Trails_Boomerang.Value", (Color_RGBA8){ 255, 255, 100, 255 }); + if (CVarGetInteger("gCosmetics.Trails_Boomerang.Changed", 0)) { + color = CVarGetColor("gCosmetics.Trails_Boomerang.Value", (Color_RGBA8){ 255, 255, 100, 255 }); changed = 1; } break; case 3: - if (CVar_GetS32("gCosmetics.Trails_Bombchu.Changed", 0)) { - color = CVar_GetRGBA("gCosmetics.Trails_Bombchu.Value", (Color_RGBA8){ 250, 0, 0, 255 }); + if (CVarGetInteger("gCosmetics.Trails_Bombchu.Changed", 0)) { + color = CVarGetColor("gCosmetics.Trails_Bombchu.Value", (Color_RGBA8){ 250, 0, 0, 255 }); this->p1StartColor.r = color.r; this->p2StartColor.r = color.r * 0.8f; this->p1EndColor.r = color.r * 0.6f; @@ -229,32 +229,32 @@ s32 EffectBlure_Update(void* thisx) { } break; case 4: - if (CVar_GetS32("gCosmetics.Trails_KokiriSword.Changed", 0)) { - color = CVar_GetRGBA("gCosmetics.Trails_KokiriSword.Value", (Color_RGBA8){ 255, 255, 255, 255 }); + if (CVarGetInteger("gCosmetics.Trails_KokiriSword.Changed", 0)) { + color = CVarGetColor("gCosmetics.Trails_KokiriSword.Value", (Color_RGBA8){ 255, 255, 255, 255 }); changed = 1; } break; case 5: - if (CVar_GetS32("gCosmetics.Trails_MasterSword.Changed", 0)) { - color = CVar_GetRGBA("gCosmetics.Trails_MasterSword.Value", (Color_RGBA8){ 255, 255, 255, 255 }); + if (CVarGetInteger("gCosmetics.Trails_MasterSword.Changed", 0)) { + color = CVarGetColor("gCosmetics.Trails_MasterSword.Value", (Color_RGBA8){ 255, 255, 255, 255 }); changed = 1; } break; case 6: - if (CVar_GetS32("gCosmetics.Trails_BiggoronSword.Changed", 0)) { - color = CVar_GetRGBA("gCosmetics.Trails_BiggoronSword.Value", (Color_RGBA8){ 255, 255, 255, 255 }); + if (CVarGetInteger("gCosmetics.Trails_BiggoronSword.Changed", 0)) { + color = CVarGetColor("gCosmetics.Trails_BiggoronSword.Value", (Color_RGBA8){ 255, 255, 255, 255 }); changed = 1; } break; case 7: - if (CVar_GetS32("gCosmetics.Trails_Stick.Changed", 0)) { - color = CVar_GetRGBA("gCosmetics.Trails_Stick.Value", (Color_RGBA8){ 255, 255, 255, 255 }); + if (CVarGetInteger("gCosmetics.Trails_Stick.Changed", 0)) { + color = CVarGetColor("gCosmetics.Trails_Stick.Value", (Color_RGBA8){ 255, 255, 255, 255 }); changed = 1; } break; case 8: - if (CVar_GetS32("gCosmetics.Trails_Hammer.Changed", 0)) { - color = CVar_GetRGBA("gCosmetics.Trails_Hammer.Value", (Color_RGBA8){ 255, 255, 255, 255 }); + if (CVarGetInteger("gCosmetics.Trails_Hammer.Changed", 0)) { + color = CVarGetColor("gCosmetics.Trails_Hammer.Value", (Color_RGBA8){ 255, 255, 255, 255 }); changed = 1; } break; @@ -280,8 +280,8 @@ s32 EffectBlure_Update(void* thisx) { // Don't override boomerang and bombchu trail durations if (this->trailType != 2 && this->trailType != 3) { - if (CVar_GetS32("gCosmetics.Trails_Duration.Changed", 0)) { - this->elemDuration = CVar_GetS32("gCosmetics.Trails_Duration.Value", 4); + if (CVarGetInteger("gCosmetics.Trails_Duration.Changed", 0)) { + this->elemDuration = CVarGetInteger("gCosmetics.Trails_Duration.Value", 4); } } diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c index 9a4b53124..9eb7a2b0a 100644 --- a/soh/src/code/z_en_item00.c +++ b/soh/src/code/z_en_item00.c @@ -333,7 +333,7 @@ void EnItem00_SetupAction(EnItem00* this, EnItem00ActionFunc actionFunc) { void EnItem00_SetObjectDependency(EnItem00* this, PlayState* play, s16 objectIndex) { // Remove object dependency for Enemy Randomizer and Crowd Control to allow Like-likes to // drop equipment correctly in rooms where Like-likes normally don't spawn. - if (CVar_GetS32("gRandomizedEnemies", 0) || CVar_GetS32("gCrowdControl", 0)) { + if (CVarGetInteger("gRandomizedEnemies", 0) || CVarGetInteger("gCrowdControl", 0)) { this->actor.objBankIndex = 0; } else { this->actor.objBankIndex = Object_GetIndex(&play->objectCtx, objectIndex); @@ -552,7 +552,7 @@ void EnItem00_Destroy(Actor* thisx, PlayState* play) { void func_8001DFC8(EnItem00* this, PlayState* play) { - if (!CVar_GetS32("gNewDrops", 0)){ + if (!CVarGetInteger("gNewDrops", 0)){ if ((this->actor.params <= ITEM00_RUPEE_RED) || ((this->actor.params == ITEM00_HEART) && (this->unk_15A < 0)) || (this->actor.params == ITEM00_HEART_PIECE)) { this->actor.shape.rot.y += 960; @@ -576,7 +576,7 @@ void func_8001DFC8(EnItem00* this, PlayState* play) { } if (this->actor.params == ITEM00_HEART_PIECE) { - if (CVar_GetS32("gNewDrops", 0) && !gSaveContext.n64ddFlag) { + if (CVarGetInteger("gNewDrops", 0) && !gSaveContext.n64ddFlag) { this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 20.0f + 50.0f; } else { this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f; @@ -613,7 +613,7 @@ void func_8001E1C8(EnItem00* this, PlayState* play) { f32 originalVelocity; Vec3f effectPos; - if (this->actor.params <= ITEM00_RUPEE_RED && !CVar_GetS32("gNewDrops", 0)) { + if (this->actor.params <= ITEM00_RUPEE_RED && !CVarGetInteger("gNewDrops", 0)) { this->actor.shape.rot.y += 960; } @@ -715,9 +715,9 @@ void func_8001E5C8(EnItem00* this, PlayState* play) { this->actor.world.pos = player->actor.world.pos; - if (this->actor.params <= ITEM00_RUPEE_RED && !CVar_GetS32("gNewDrops", 0)) { + if (this->actor.params <= ITEM00_RUPEE_RED && !CVarGetInteger("gNewDrops", 0)) { this->actor.shape.rot.y += 960; - } else if (this->actor.params == ITEM00_HEART && !CVar_GetS32("gNewDrops", 0)) { + } else if (this->actor.params == ITEM00_HEART && !CVarGetInteger("gNewDrops", 0)) { this->actor.shape.rot.y = 0; } @@ -742,7 +742,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { s32 pad; // OTRTODO: remove special case for bombchu when its 2D drop is implemented - if (CVar_GetS32("gNewDrops", 0) || this->actor.params == ITEM00_BOMBCHU) { //set the rotation system on selected model only :) + if (CVarGetInteger("gNewDrops", 0) || this->actor.params == ITEM00_BOMBCHU) { //set the rotation system on selected model only :) if ((this->actor.params == ITEM00_RUPEE_GREEN) || (this->actor.params == ITEM00_RUPEE_BLUE) || (this->actor.params == ITEM00_RUPEE_RED) || (this->actor.params == ITEM00_ARROWS_SINGLE) || (this->actor.params == ITEM00_ARROWS_SMALL) || (this->actor.params == ITEM00_ARROWS_MEDIUM) || @@ -761,7 +761,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { if (this->unk_15A > 0) { this->unk_15A--; - if (CVar_GetS32("gDropsDontDie", 0) && (this->unk_154 <= 0)) { + if (CVarGetInteger("gDropsDontDie", 0) && (this->unk_154 <= 0)) { this->unk_15A++; } } @@ -977,7 +977,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { if (!(this->unk_156 & this->unk_158)) { switch (this->actor.params) { case ITEM00_RUPEE_GREEN: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { Actor_SetScale(&this->actor, 0.3f); this->scale = 0.3f; this->actor.shape.yOffset = 50.0f; @@ -987,7 +987,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; } case ITEM00_RUPEE_BLUE: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { Actor_SetScale(&this->actor, 0.3f); this->scale = 0.3f; this->actor.shape.yOffset = 50.0f; @@ -997,7 +997,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; } case ITEM00_RUPEE_RED: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { Actor_SetScale(&this->actor, 0.3f); this->scale = 0.3f; this->actor.shape.yOffset = 50.0f; @@ -1014,7 +1014,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; } case ITEM00_RUPEE_ORANGE: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { Actor_SetScale(&this->actor, 0.45f); this->scale = 0.45f; this->actor.shape.yOffset = 50.0f; @@ -1031,7 +1031,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; } case ITEM00_RUPEE_PURPLE: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { Actor_SetScale(&this->actor, 0.4f); this->scale = 0.4f; this->actor.shape.yOffset = 50.0f; @@ -1048,7 +1048,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; } case ITEM00_HEART_PIECE: - if (CVar_GetS32("gNewDrops", 0) && !gSaveContext.n64ddFlag) { + if (CVarGetInteger("gNewDrops", 0) && !gSaveContext.n64ddFlag) { Actor_SetScale(&this->actor, 0.5f); this->scale = 0.5f; this->actor.shape.yOffset = 50.0f; @@ -1067,7 +1067,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { EnItem00_DrawHeartContainer(this, play); break; case ITEM00_HEART: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { this->actor.home.rot.z = Rand_CenteredFloat(65535.0f); this->actor.shape.yOffset = 25.0f; this->actor.shape.shadowScale = 0.3f; @@ -1104,7 +1104,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { } case ITEM00_BOMBS_A: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { Actor_SetScale(&this->actor, 0.2f); this->scale = 0.2f; this->actor.shape.yOffset = 50.0f; @@ -1114,7 +1114,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; } case ITEM00_BOMBS_B: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { Actor_SetScale(&this->actor, 0.2f); this->scale = 0.2f; this->actor.shape.yOffset = 50.0f; @@ -1125,7 +1125,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { } case ITEM00_BOMBS_SPECIAL: case ITEM00_ARROWS_SINGLE: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { Actor_SetScale(&this->actor, 0.2f); this->scale = 0.2f; this->actor.shape.yOffset = 50.0f; @@ -1135,7 +1135,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; } case ITEM00_ARROWS_SMALL: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { Actor_SetScale(&this->actor, 0.2f); this->scale = 0.2f; this->actor.shape.yOffset = 50.0f; @@ -1145,7 +1145,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; } case ITEM00_ARROWS_MEDIUM: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { Actor_SetScale(&this->actor, 0.2f); this->scale = 0.2f; this->actor.shape.yOffset = 50.0f; @@ -1155,7 +1155,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; } case ITEM00_ARROWS_LARGE: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { Actor_SetScale(&this->actor, 0.2f); this->scale = 0.2f; this->actor.shape.yOffset = 50.0f; @@ -1165,7 +1165,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; } case ITEM00_NUTS: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { Actor_SetScale(&this->actor, 0.2f); this->scale = 0.2f; this->actor.shape.yOffset = 50.0f; @@ -1175,7 +1175,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; } case ITEM00_STICK: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { Actor_SetScale(&this->actor, 0.2f); this->scale = 0.2f; this->actor.shape.yOffset = 50.0f; @@ -1185,7 +1185,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; } case ITEM00_MAGIC_LARGE: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { Actor_SetScale(&this->actor, 0.2f); this->scale = 0.2f; this->actor.shape.yOffset = 50.0f; @@ -1195,7 +1195,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; } case ITEM00_MAGIC_SMALL: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { Actor_SetScale(&this->actor, 0.2f); this->scale = 0.2f; this->actor.shape.yOffset = 50.0f; @@ -1205,7 +1205,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; } case ITEM00_SEEDS: - if (CVar_GetS32("gNewDrops", 0)) { + if (CVarGetInteger("gNewDrops", 0)) { Actor_SetScale(&this->actor, 0.2f); this->scale = 0.2f; this->actor.shape.yOffset = 50.0f; @@ -1215,7 +1215,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; } case ITEM00_SMALL_KEY: - if (CVar_GetS32("gNewDrops", 0) && !gSaveContext.n64ddFlag) { + if (CVarGetInteger("gNewDrops", 0) && !gSaveContext.n64ddFlag) { Actor_SetScale(&this->actor, 0.2f); this->scale = 0.2f; this->actor.shape.yOffset = 50.0f; @@ -1386,24 +1386,24 @@ void EnItem00_DrawRupee(EnItem00* this, PlayState* play) { u8 shouldColor = 0; switch (texIndex) { case 0: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_GreenRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_GreenRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_GreenRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_GreenRupee.Changed", 0); break; case 1: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_BlueRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_BlueRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_BlueRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_BlueRupee.Changed", 0); break; case 2: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_RedRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_RedRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_RedRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_RedRupee.Changed", 0); break; case 3: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_PurpleRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_PurpleRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_PurpleRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_PurpleRupee.Changed", 0); break; case 4: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_GoldRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_GoldRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_GoldRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_GoldRupee.Changed", 0); break; } @@ -1552,7 +1552,7 @@ s16 func_8001F404(s16 dropId) { } } - if ((CVar_GetS32("gBombchuDrops", 0) || + if ((CVarGetInteger("gBombchuDrops", 0) || (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_ENABLE_BOMBCHU_DROPS) == 1)) && (dropId == ITEM00_BOMBS_A || dropId == ITEM00_BOMBS_B || dropId == ITEM00_BOMBS_SPECIAL)) { dropId = EnItem00_ConvertBombDropToBombchu(dropId); @@ -1586,7 +1586,7 @@ EnItem00* Item_DropCollectible(PlayState* play, Vec3f* spawnPos, s16 params) { params &= 0x3FFF; - if ((params & 0x00FF) == ITEM00_HEART && CVar_GetS32("gNoHeartDrops", 0)) { return NULL; } + if ((params & 0x00FF) == ITEM00_HEART && CVarGetInteger("gNoHeartDrops", 0)) { return NULL; } if (((params & 0x00FF) == ITEM00_FLEXIBLE) && !param4000) { // TODO: Prevent the cast to EnItem00 here since this is a different actor (En_Elf) @@ -1631,7 +1631,7 @@ EnItem00* Item_DropCollectible2(PlayState* play, Vec3f* spawnPos, s16 params) { params &= 0x3FFF; - if ((params & 0x00FF) == ITEM00_HEART && CVar_GetS32("gNoHeartDrops", 0)) { return NULL; } + if ((params & 0x00FF) == ITEM00_HEART && CVarGetInteger("gNoHeartDrops", 0)) { return NULL; } if (((params & 0x00FF) == ITEM00_FLEXIBLE) && !param4000) { // TODO: Prevent the cast to EnItem00 here since this is a different actor (En_Elf) @@ -1668,7 +1668,7 @@ void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnP param8000 = params & 0x8000; params &= 0x7FFF; - if (CVar_GetS32("gNoRandomDrops", 0)) { return; } + if (CVarGetInteger("gNoRandomDrops", 0)) { return; } if (fromActor != NULL) { if (fromActor->dropFlag) { @@ -1711,11 +1711,11 @@ void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnP EffectSsDeadSound_SpawnStationary(play, spawnPos, NA_SE_EV_BUTTERFRY_TO_FAIRY, true, DEADSOUND_REPEAT_MODE_OFF, 40); return; - } else if (gSaveContext.health <= 0x30 && !CVar_GetS32("gNoHeartDrops", 0)) { // 3 hearts or less + } else if (gSaveContext.health <= 0x30 && !CVarGetInteger("gNoHeartDrops", 0)) { // 3 hearts or less params = 0xB * 0x10; dropTableIndex = 0x0; dropId = ITEM00_HEART; - } else if (gSaveContext.health <= 0x50 && !CVar_GetS32("gNoHeartDrops", 0)) { // 5 hearts or less + } else if (gSaveContext.health <= 0x50 && !CVarGetInteger("gNoHeartDrops", 0)) { // 5 hearts or less params = 0xA * 0x10; dropTableIndex = 0x0; dropId = ITEM00_HEART; @@ -1748,7 +1748,7 @@ void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnP } } - if (dropId != 0xFF && (!CVar_GetS32("gNoHeartDrops", 0) || dropId != ITEM00_HEART)) { + if (dropId != 0xFF && (!CVarGetInteger("gNoHeartDrops", 0) || dropId != ITEM00_HEART)) { dropQuantity = sDropQuantities[params + dropTableIndex]; while (dropQuantity > 0) { if (!param8000) { diff --git a/soh/src/code/z_face_reaction.c b/soh/src/code/z_face_reaction.c index b4dfa50db..c262cd3a2 100644 --- a/soh/src/code/z_face_reaction.c +++ b/soh/src/code/z_face_reaction.c @@ -66,7 +66,7 @@ u16 sReactionTextIds[][PLAYER_MASK_MAX] = { u16 Text_GetFaceReaction(PlayState* play, u32 reactionSet) { u8 currentMask = Player_GetMask(play); - if (CVar_GetS32("gMMBunnyHood", 0) && currentMask == PLAYER_MASK_BUNNY) { + if (CVarGetInteger("gMMBunnyHood", 0) && currentMask == PLAYER_MASK_BUNNY) { return 0; } else { return sReactionTextIds[reactionSet][currentMask]; diff --git a/soh/src/code/z_kaleido_setup.c b/soh/src/code/z_kaleido_setup.c index 704640863..94cb91d49 100644 --- a/soh/src/code/z_kaleido_setup.c +++ b/soh/src/code/z_kaleido_setup.c @@ -18,21 +18,21 @@ void KaleidoSetup_Update(PlayState* play) { play->shootingGalleryStatus <= 1 && gSaveContext.magicState != 8 && gSaveContext.magicState != 9 && (play->sceneNum != SCENE_BOWLING || !Flags_GetSwitch(play, 0x38))) { - if (CVar_GetS32("gCheatEasyPauseBufferFrameAdvance", 0) == 2 && !CHECK_BTN_ALL(input->press.button, BTN_START)) { - CVar_SetS32("gCheatEasyPauseBufferFrameAdvance", 0); + if (CVarGetInteger("gCheatEasyPauseBufferFrameAdvance", 0) == 2 && !CHECK_BTN_ALL(input->press.button, BTN_START)) { + CVarSetInteger("gCheatEasyPauseBufferFrameAdvance", 0); } if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) { if (BREG(0)) { pauseCtx->debugState = 3; } - } else if ((CHECK_BTN_ALL(input->press.button, BTN_START) && !CVar_GetS32("gCheatEasyPauseBufferFrameAdvance", 0)) || CVar_GetS32("gCheatEasyPauseBufferFrameAdvance", 0) == 1) { + } else if ((CHECK_BTN_ALL(input->press.button, BTN_START) && !CVarGetInteger("gCheatEasyPauseBufferFrameAdvance", 0)) || CVarGetInteger("gCheatEasyPauseBufferFrameAdvance", 0) == 1) { gSaveContext.unk_13EE = gSaveContext.unk_13EA; if (CHECK_BTN_ALL(input->cur.button, BTN_L)) - CVar_SetS32("gPauseTriforce", 1); + CVarSetInteger("gPauseTriforce", 1); else - CVar_SetS32("gPauseTriforce", 0); + CVarSetInteger("gPauseTriforce", 0); WREG(16) = -175; diff --git a/soh/src/code/z_kanfont.c b/soh/src/code/z_kanfont.c index 590b25e9d..0eea9be34 100644 --- a/soh/src/code/z_kanfont.c +++ b/soh/src/code/z_kanfont.c @@ -174,7 +174,7 @@ void Font_LoadChar(Font* font, u8 character, u16 codePointIndex) { //__FILE__, __LINE__); if (character < 0x8B) - memcpy(&font->charTexBuf[codePointIndex], ResourceMgr_LoadTexByName(fntTbl[character]), FONT_CHAR_TEX_SIZE); + memcpy(&font->charTexBuf[codePointIndex], GetResourceDataByName(fntTbl[character], false), FONT_CHAR_TEX_SIZE); } /** @@ -183,7 +183,7 @@ void Font_LoadChar(Font* font, u8 character, u16 codePointIndex) { * The different icons are given in the MessageBoxIcon enum. */ void Font_LoadMessageBoxIcon(Font* font, u16 icon) { - memcpy(font->iconBuf, ResourceMgr_LoadTexByName(msgStaticTbl[4 + icon]), FONT_CHAR_TEX_SIZE); + memcpy(font->iconBuf, GetResourceDataByName(msgStaticTbl[4 + icon], false), FONT_CHAR_TEX_SIZE); } /** @@ -218,7 +218,7 @@ void Font_LoadOrderedFont(Font* font) { osSyncPrintf("nes_mes_buf[%d]=%d\n", codePointIndex, font->msgBuf[codePointIndex]); offset = (font->msgBuf[codePointIndex] - '\x20') * FONT_CHAR_TEX_SIZE; - memcpy(fontBuf, ResourceMgr_LoadTexByName(fntTbl[offset / FONT_CHAR_TEX_SIZE]), FONT_CHAR_TEX_SIZE); + memcpy(fontBuf, GetResourceDataByName(fntTbl[offset / FONT_CHAR_TEX_SIZE], false), FONT_CHAR_TEX_SIZE); //DmaMgr_SendRequest1(fontBuf, fontStatic + offset, FONT_CHAR_TEX_SIZE, __FILE__, __LINE__); fontBufIndex += FONT_CHAR_TEX_SIZE / 8; } diff --git a/soh/src/code/z_kankyo.c b/soh/src/code/z_kankyo.c index 7f297bd35..488d5507b 100644 --- a/soh/src/code/z_kankyo.c +++ b/soh/src/code/z_kankyo.c @@ -1,5 +1,5 @@ #include "global.h" -#include "ultra64.h" +#include #include "vt.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/gameplay_field_keep/gameplay_field_keep.h" @@ -1379,7 +1379,7 @@ void Environment_DrawSunAndMoon(PlayState* play) { color = CLAMP_MIN(color, 0.0f); scale = -15.0f * color + 25.0f; - scale *= CVar_GetFloat("gCosmetics.Moon_Size", 1.0f); + scale *= CVarGetFloat("gCosmetics.Moon_Size", 1.0f); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); temp = -y / 80.0f; @@ -1391,8 +1391,8 @@ void Environment_DrawSunAndMoon(PlayState* play) { gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_LOAD); Gfx_SetupDL_51Opa(play->state.gfxCtx); gDPPipeSync(POLY_OPA_DISP++); - if (CVar_GetS32("gCosmetics.World_Moon.Changed", 0)) { - Color_RGB8 moonColor = CVar_GetRGB("gCosmetics.World_Moon.Value", (Color_RGB8){ 0, 0, 240 }); + if (CVarGetInteger("gCosmetics.World_Moon.Changed", 0)) { + Color_RGB8 moonColor = CVarGetColor24("gCosmetics.World_Moon.Value", (Color_RGB8){ 0, 0, 240 }); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, moonColor.r, moonColor.g, moonColor.b, alpha); gDPSetEnvColor(POLY_OPA_DISP++, moonColor.r / 2, moonColor.g / 2, moonColor.b / 2, alpha); } else { @@ -2308,9 +2308,9 @@ void Environment_PatchSandstorm(PlayState* play) { gsSPWideTextureRectangle(OTRGetRectDimensionFromLeftEdge(0) << 2, 0, OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH) << 2, 0x03C0, G_TX_RENDERTILE, 0, 0, 0x008C, -0x008C), }; - ResourceMgr_PatchGfxByName(gFieldSandstormDL, "gfxPatchSandstormRect0", 48, gfxPatchSandstormRect[0]); - ResourceMgr_PatchGfxByName(gFieldSandstormDL, "gfxPatchSandstormRect1", 50, gfxPatchSandstormRect[1]); - ResourceMgr_PatchGfxByName(gFieldSandstormDL, "gfxPatchSandstormRect2", 52, gfxPatchSandstormRect[2]); + ResourceMgr_PatchGfxByName(gFieldSandstormDL, "gfxPatchSandstormRect0", 24, gfxPatchSandstormRect[0]); + ResourceMgr_PatchGfxByName(gFieldSandstormDL, "gfxPatchSandstormRect1", 25, gfxPatchSandstormRect[1]); + ResourceMgr_PatchGfxByName(gFieldSandstormDL, "gfxPatchSandstormRect2", 26, gfxPatchSandstormRect[2]); previousPatchedSandstormScreenSize = ABS(OTRGetRectDimensionFromLeftEdge(0)) + ABS(OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH)); } diff --git a/soh/src/code/z_lifemeter.c b/soh/src/code/z_lifemeter.c index a108938d1..8d5e41a20 100644 --- a/soh/src/code/z_lifemeter.c +++ b/soh/src/code/z_lifemeter.c @@ -120,20 +120,20 @@ s16 sHeartsDDEnv[2][3]; void HealthMeter_Init(PlayState* play) { InterfaceContext* interfaceCtx = &play->interfaceCtx; Color_RGB8 mainColor = {HEARTS_PRIM_R, HEARTS_PRIM_G, HEARTS_PRIM_B}; - if (CVar_GetS32("gCosmetics.Consumable_Hearts.Changed", 0)) { - mainColor = CVar_GetRGB("gCosmetics.Consumable_Hearts.Value", mainColor); + if (CVarGetInteger("gCosmetics.Consumable_Hearts.Changed", 0)) { + mainColor = CVarGetColor24("gCosmetics.Consumable_Hearts.Value", mainColor); } Color_RGB8 mainBorder = {HEARTS_ENV_R, HEARTS_ENV_G, HEARTS_ENV_B}; - if (CVar_GetS32("gCosmetics.Consumable_HeartBorder.Changed", 0)) { - mainBorder = CVar_GetRGB("gCosmetics.Consumable_HeartBorder.Value", mainBorder); + if (CVarGetInteger("gCosmetics.Consumable_HeartBorder.Changed", 0)) { + mainBorder = CVarGetColor24("gCosmetics.Consumable_HeartBorder.Value", mainBorder); } Color_RGB8 ddColor = {HEARTS_DD_ENV_R, HEARTS_DD_ENV_G, HEARTS_DD_ENV_B}; - if (CVar_GetS32("gCosmetics.Consumable_DDHearts.Changed", 0)) { - ddColor = CVar_GetRGB("gCosmetics.Consumable_DDHearts.Value", ddColor); + if (CVarGetInteger("gCosmetics.Consumable_DDHearts.Changed", 0)) { + ddColor = CVarGetColor24("gCosmetics.Consumable_DDHearts.Value", ddColor); } Color_RGB8 ddBorder = {HEARTS_DD_PRIM_R, HEARTS_DD_PRIM_G, HEARTS_DD_PRIM_B}; - if (CVar_GetS32("gCosmetics.Consumable_DDHeartBorder.Changed", 0)) { - ddBorder = CVar_GetRGB("gCosmetics.Consumable_DDHeartBorder.Value", ddBorder); + if (CVarGetInteger("gCosmetics.Consumable_DDHeartBorder.Changed", 0)) { + ddBorder = CVarGetColor24("gCosmetics.Consumable_DDHeartBorder.Value", ddBorder); } interfaceCtx->unk_228 = 0x140; @@ -176,26 +176,26 @@ void HealthMeter_Update(PlayState* play) { s16 gFactor; s16 bFactor; - Top_LM_Margin = CVar_GetS32("gHUDMargin_T", 0); - Left_LM_Margin = CVar_GetS32("gHUDMargin_L", 0); - Right_LM_Margin = CVar_GetS32("gHUDMargin_R", 0); - Bottom_LM_Margin = CVar_GetS32("gHUDMargin_B", 0); + Top_LM_Margin = CVarGetInteger("gHUDMargin_T", 0); + Left_LM_Margin = CVarGetInteger("gHUDMargin_L", 0); + Right_LM_Margin = CVarGetInteger("gHUDMargin_R", 0); + Bottom_LM_Margin = CVarGetInteger("gHUDMargin_B", 0); Color_RGB8 mainColor = {HEARTS_PRIM_R, HEARTS_PRIM_G, HEARTS_PRIM_B}; - if (CVar_GetS32("gCosmetics.Consumable_Hearts.Changed", 0)) { - mainColor = CVar_GetRGB("gCosmetics.Consumable_Hearts.Value", mainColor); + if (CVarGetInteger("gCosmetics.Consumable_Hearts.Changed", 0)) { + mainColor = CVarGetColor24("gCosmetics.Consumable_Hearts.Value", mainColor); } Color_RGB8 mainBorder = {HEARTS_ENV_R, HEARTS_ENV_G, HEARTS_ENV_B}; - if (CVar_GetS32("gCosmetics.Consumable_HeartBorder.Changed", 0)) { - mainBorder = CVar_GetRGB("gCosmetics.Consumable_HeartBorder.Value", mainBorder); + if (CVarGetInteger("gCosmetics.Consumable_HeartBorder.Changed", 0)) { + mainBorder = CVarGetColor24("gCosmetics.Consumable_HeartBorder.Value", mainBorder); } Color_RGB8 ddColor = {HEARTS_DD_ENV_R, HEARTS_DD_ENV_G, HEARTS_DD_ENV_B}; - if (CVar_GetS32("gCosmetics.Consumable_DDHearts.Changed", 0)) { - ddColor = CVar_GetRGB("gCosmetics.Consumable_DDHearts.Value", ddColor); + if (CVarGetInteger("gCosmetics.Consumable_DDHearts.Changed", 0)) { + ddColor = CVarGetColor24("gCosmetics.Consumable_DDHearts.Value", ddColor); } Color_RGB8 ddBorder = {HEARTS_DD_PRIM_R, HEARTS_DD_PRIM_G, HEARTS_DD_PRIM_B}; - if (CVar_GetS32("gCosmetics.Consumable_DDHeartBorder.Changed", 0)) { - ddBorder = CVar_GetRGB("gCosmetics.Consumable_DDHeartBorder.Value", ddBorder); + if (CVarGetInteger("gCosmetics.Consumable_DDHeartBorder.Changed", 0)) { + ddBorder = CVarGetColor24("gCosmetics.Consumable_DDHeartBorder.Value", ddBorder); } if (interfaceCtx->unk_200 != 0) { @@ -336,20 +336,20 @@ static void* sHeartDDTextures[] = { s16 getHealthMeterXOffset() { s16 X_Margins; - if (CVar_GetS32("gHeartsUseMargins", 0) != 0) + if (CVarGetInteger("gHeartsUseMargins", 0) != 0) X_Margins = Left_LM_Margin; else X_Margins = 0; - if (CVar_GetS32("gHeartsCountPosType", 0) != 0) { - if (CVar_GetS32("gHeartsCountPosType", 0) == 1) {//Anchor Left - return OTRGetDimensionFromLeftEdge(CVar_GetS32("gHeartsCountPosX", 0)+X_Margins+70.0f); - } else if (CVar_GetS32("gHeartsCountPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gHeartsCountPosType", 0) != 0) { + if (CVarGetInteger("gHeartsCountPosType", 0) == 1) {//Anchor Left + return OTRGetDimensionFromLeftEdge(CVarGetInteger("gHeartsCountPosX", 0)+X_Margins+70.0f); + } else if (CVarGetInteger("gHeartsCountPosType", 0) == 2) {//Anchor Right X_Margins = Right_LM_Margin; - return OTRGetDimensionFromRightEdge(CVar_GetS32("gHeartsCountPosX", 0)+X_Margins+70.0f); - } else if (CVar_GetS32("gHeartsCountPosType", 0) == 3) {//Anchor None - return CVar_GetS32("gHeartsCountPosX", 0)+70.0f;; - } else if (CVar_GetS32("gHeartsCountPosType", 0) == 4) {//Hidden + return OTRGetDimensionFromRightEdge(CVarGetInteger("gHeartsCountPosX", 0)+X_Margins+70.0f); + } else if (CVarGetInteger("gHeartsCountPosType", 0) == 3) {//Anchor None + return CVarGetInteger("gHeartsCountPosX", 0)+70.0f;; + } else if (CVarGetInteger("gHeartsCountPosType", 0) == 4) {//Hidden return -9999; } } else { @@ -359,15 +359,15 @@ s16 getHealthMeterXOffset() { s16 getHealthMeterYOffset() { s16 Y_Margins; - if (CVar_GetS32("gHeartsUseMargins", 0) != 0) + if (CVarGetInteger("gHeartsUseMargins", 0) != 0) Y_Margins = (Top_LM_Margin*-1); else Y_Margins = 0; f32 HeartsScale = 0.7f; - if (CVar_GetS32("gHeartsCountPosType", 0) != 0) { - HeartsScale = CVar_GetFloat("gHeartsCountScale", 0.7f); - return CVar_GetS32("gHeartsCountPosY", 0)+Y_Margins+(HeartsScale*15); + if (CVarGetInteger("gHeartsCountPosType", 0) != 0) { + HeartsScale = CVarGetFloat("gHeartsCountScale", 0.7f); + return CVarGetInteger("gHeartsCountPosY", 0)+Y_Margins+(HeartsScale*15); } else { return 0.0f+Y_Margins; } @@ -397,8 +397,8 @@ void HealthMeter_Draw(PlayState* play) { u8* curBgImgLoaded = NULL; s32 ddHeartCountMinusOne = gSaveContext.isDoubleDefenseAcquired ? totalHeartCount - 1 : -1; f32 HeartsScale = 0.7f; - if (CVar_GetS32("gHeartsCountPosType", 0) != 0) { - HeartsScale = CVar_GetFloat("gHeartsCountScale", 0.7f); + if (CVarGetInteger("gHeartsCountPosType", 0) != 0) { + HeartsScale = CVarGetFloat("gHeartsCountScale", 0.7f); } static u32 epoch = 0; epoch++; @@ -413,7 +413,7 @@ void HealthMeter_Draw(PlayState* play) { /* s16 X_Margins; s16 Y_Margins; - if (CVar_GetS32("gHeartsUseMargins", 0) != 0) { + if (CVarGetInteger("gHeartsUseMargins", 0) != 0) { X_Margins = Left_LM_Margin; Y_Margins = (Top_LM_Margin*-1); } else { @@ -422,16 +422,16 @@ void HealthMeter_Draw(PlayState* play) { } s16 PosX_original = OTRGetDimensionFromLeftEdge(0.0f)+X_Margins; s16 PosY_original = 0.0f+Y_Margins; - if (CVar_GetS32("gHeartsCountPosType", 0) != 0) { - offsetY = CVar_GetS32("gHeartsCountPosY", 0)+Y_Margins+(HeartsScale*15); - if (CVar_GetS32("gHeartsCountPosType", 0) == 1) {//Anchor Left - offsetX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gHeartsCountPosX", 0)+X_Margins+70.0f); - } else if (CVar_GetS32("gHeartsCountPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gHeartsCountPosType", 0) != 0) { + offsetY = CVarGetInteger("gHeartsCountPosY", 0)+Y_Margins+(HeartsScale*15); + if (CVarGetInteger("gHeartsCountPosType", 0) == 1) {//Anchor Left + offsetX = OTRGetDimensionFromLeftEdge(CVarGetInteger("gHeartsCountPosX", 0)+X_Margins+70.0f); + } else if (CVarGetInteger("gHeartsCountPosType", 0) == 2) {//Anchor Right X_Margins = Right_LM_Margin; - offsetX = OTRGetDimensionFromRightEdge(CVar_GetS32("gHeartsCountPosX", 0)+X_Margins+70.0f); - } else if (CVar_GetS32("gHeartsCountPosType", 0) == 3) {//Anchor None - offsetX = CVar_GetS32("gHeartsCountPosX", 0)+70.0f; - } else if (CVar_GetS32("gHeartsCountPosType", 0) == 4) {//Hidden + offsetX = OTRGetDimensionFromRightEdge(CVarGetInteger("gHeartsCountPosX", 0)+X_Margins+70.0f); + } else if (CVarGetInteger("gHeartsCountPosType", 0) == 3) {//Anchor None + offsetX = CVarGetInteger("gHeartsCountPosX", 0)+70.0f; + } else if (CVarGetInteger("gHeartsCountPosType", 0) == 4) {//Hidden offsetX = -9999; } } else { @@ -615,7 +615,7 @@ void HealthMeter_Draw(PlayState* play) { } offsetX += 10.0f; - s32 lineLength = CVar_GetS32("gHeartsLineLength", 10); + s32 lineLength = CVarGetInteger("gHeartsLineLength", 10); if (lineLength != 0 && (i+1)%lineLength == 0) { offsetX = PosX_anchor; offsetY += 10.0f; @@ -635,7 +635,7 @@ void HealthMeter_HandleCriticalAlarm(PlayState* play) { if (interfaceCtx->unk_22A <= 0) { interfaceCtx->unk_22A = 0; interfaceCtx->unk_22C = 0; - if (CVar_GetS32("gLowHpAlarm", 0) == 0 && !Player_InCsMode(play) && (play->pauseCtx.state == 0) && + if (CVarGetInteger("gLowHpAlarm", 0) == 0 && !Player_InCsMode(play) && (play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0) && HealthMeter_IsCritical() && !Play_InCsMode(play)) { func_80078884(NA_SE_SY_HITPOINT_ALARM); } diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c index 33c89fe47..8e130bad1 100644 --- a/soh/src/code/z_map_exp.c +++ b/soh/src/code/z_map_exp.c @@ -414,7 +414,7 @@ void Map_InitData(PlayState* play, s16 room) { if (sEntranceIconMapIndex < 24) { const char* textureName = minimapTableOW[sEntranceIconMapIndex]; - memcpy(play->interfaceCtx.mapSegment, ResourceMgr_LoadTexByName(textureName), ResourceMgr_LoadTexSizeByName(textureName)); + memcpy(play->interfaceCtx.mapSegment, GetResourceDataByName(textureName, false), GetResourceTexSizeByName(textureName, false)); } interfaceCtx->unk_258 = mapIndex; @@ -448,7 +448,7 @@ void Map_InitData(PlayState* play, s16 room) { //0xFF0, __FILE__, __LINE__); const char* textureName = minimapTableDangeon[gMapData->dgnMinimapTexIndexOffset[mapIndex] + room]; - memcpy(play->interfaceCtx.mapSegment, ResourceMgr_LoadTexByName(textureName), ResourceMgr_LoadTexSizeByName(textureName)); + memcpy(play->interfaceCtx.mapSegment, GetResourceDataByName(textureName, false), GetResourceTexSizeByName(textureName, false)); R_COMPASS_OFFSET_X = gMapData->roomCompassOffsetX[mapIndex][room]; R_COMPASS_OFFSET_Y = gMapData->roomCompassOffsetY[mapIndex][room]; @@ -602,17 +602,17 @@ void Minimap_DrawCompassIcons(PlayState* play) { Player* player = GET_PLAYER(play); s16 tempX, tempZ; Color_RGB8 lastEntranceColor = { 200, 0, 0 }; - if (CVar_GetS32("gCosmetics.Hud_MinimapEntrance.Changed", 0)) { - lastEntranceColor = CVar_GetRGB("gCosmetics.Hud_MinimapEntrance.Value", lastEntranceColor); + if (CVarGetInteger("gCosmetics.Hud_MinimapEntrance.Changed", 0)) { + lastEntranceColor = CVarGetColor24("gCosmetics.Hud_MinimapEntrance.Value", lastEntranceColor); } Color_RGB8 currentPositionColor = { 200, 255, 0 }; - if (CVar_GetS32("gCosmetics.Hud_MinimapPosition.Changed", 0)) { - currentPositionColor = CVar_GetRGB("gCosmetics.Hud_MinimapPosition.Value", currentPositionColor); + if (CVarGetInteger("gCosmetics.Hud_MinimapPosition.Changed", 0)) { + currentPositionColor = CVarGetColor24("gCosmetics.Hud_MinimapPosition.Value", currentPositionColor); } s16 X_Margins_Minimap; s16 Y_Margins_Minimap; - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) { - if (CVar_GetS32("gMinimapPosType", 0) == 0) {X_Margins_Minimap = Right_MM_Margin;}; + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) { + if (CVarGetInteger("gMinimapPosType", 0) == 0) {X_Margins_Minimap = Right_MM_Margin;}; Y_Margins_Minimap = Bottom_MM_Margin; } else { X_Margins_Minimap = 0; @@ -635,22 +635,22 @@ void Minimap_DrawCompassIcons(PlayState* play) { tempZ = player->actor.world.pos.z; tempX /= R_COMPASS_SCALE_X; tempZ /= R_COMPASS_SCALE_Y; - if (CVar_GetS32("gMinimapPosType", 0) != 0) { - if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; + if (CVarGetInteger("gMinimapPosType", 0) != 0) { + if (CVarGetInteger("gMinimapPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; Matrix_Translate( - OTRGetDimensionFromLeftEdge((R_COMPASS_OFFSET_X + (X_Margins_Minimap*10) + tempX + (CVar_GetS32("gMinimapPosX", 0)*10)) / 10.0f), - (R_COMPASS_OFFSET_Y + ((Y_Margins_Minimap*10)*-1) - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); - } else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; + OTRGetDimensionFromLeftEdge((R_COMPASS_OFFSET_X + (X_Margins_Minimap*10) + tempX + (CVarGetInteger("gMinimapPosX", 0)*10)) / 10.0f), + (R_COMPASS_OFFSET_Y + ((Y_Margins_Minimap*10)*-1) - tempZ + ((CVarGetInteger("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); + } else if (CVarGetInteger("gMinimapPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; Matrix_Translate( - OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X + (X_Margins_Minimap*10) + tempX + (CVar_GetS32("gMinimapPosX", 0)*10)) / 10.0f), - (R_COMPASS_OFFSET_Y +((Y_Margins_Minimap*10)*-1) - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); - } else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None + OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X + (X_Margins_Minimap*10) + tempX + (CVarGetInteger("gMinimapPosX", 0)*10)) / 10.0f), + (R_COMPASS_OFFSET_Y +((Y_Margins_Minimap*10)*-1) - tempZ + ((CVarGetInteger("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); + } else if (CVarGetInteger("gMinimapPosType", 0) == 3) {//Anchor None Matrix_Translate( - (R_COMPASS_OFFSET_X + tempX + (CVar_GetS32("gMinimapPosX", 0)*10) / 10.0f), - (R_COMPASS_OFFSET_Y + ((Y_Margins_Minimap*10)*-1) - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); - } else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden + (R_COMPASS_OFFSET_X + tempX + (CVarGetInteger("gMinimapPosX", 0)*10) / 10.0f), + (R_COMPASS_OFFSET_Y + ((Y_Margins_Minimap*10)*-1) - tempZ + ((CVarGetInteger("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); + } else if (CVarGetInteger("gMinimapPosType", 0) == 4) {//Hidden Matrix_Translate( (R_COMPASS_OFFSET_X+(9999*10) + tempX / 10.0f), (R_COMPASS_OFFSET_Y+(9999*10) - tempZ) / 10.0f, 0.0f, MTXMODE_NEW); @@ -673,22 +673,22 @@ void Minimap_DrawCompassIcons(PlayState* play) { tempZ = sPlayerInitialPosZ+Y_Margins_Minimap; tempX /= R_COMPASS_SCALE_X; tempZ /= R_COMPASS_SCALE_Y; - if (CVar_GetS32("gMinimapPosType", 0) != 0) { - if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; + if (CVarGetInteger("gMinimapPosType", 0) != 0) { + if (CVarGetInteger("gMinimapPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; Matrix_Translate( - OTRGetDimensionFromLeftEdge((R_COMPASS_OFFSET_X + (X_Margins_Minimap*10) + tempX + (CVar_GetS32("gMinimapPosX", 0)*10)) / 10.0f), - (R_COMPASS_OFFSET_Y + ((Y_Margins_Minimap*10)*-1) - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); - } else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; + OTRGetDimensionFromLeftEdge((R_COMPASS_OFFSET_X + (X_Margins_Minimap*10) + tempX + (CVarGetInteger("gMinimapPosX", 0)*10)) / 10.0f), + (R_COMPASS_OFFSET_Y + ((Y_Margins_Minimap*10)*-1) - tempZ + ((CVarGetInteger("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); + } else if (CVarGetInteger("gMinimapPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; Matrix_Translate( - OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X + (X_Margins_Minimap*10) + tempX + (CVar_GetS32("gMinimapPosX", 0)*10)) / 10.0f), - (R_COMPASS_OFFSET_Y +((Y_Margins_Minimap*10)*-1) - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); - } else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None + OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X + (X_Margins_Minimap*10) + tempX + (CVarGetInteger("gMinimapPosX", 0)*10)) / 10.0f), + (R_COMPASS_OFFSET_Y +((Y_Margins_Minimap*10)*-1) - tempZ + ((CVarGetInteger("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); + } else if (CVarGetInteger("gMinimapPosType", 0) == 3) {//Anchor None Matrix_Translate( - (R_COMPASS_OFFSET_X + tempX + (CVar_GetS32("gMinimapPosX", 0)*10) / 10.0f), - (R_COMPASS_OFFSET_Y - tempZ + ((CVar_GetS32("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); - } else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden + (R_COMPASS_OFFSET_X + tempX + (CVarGetInteger("gMinimapPosX", 0)*10) / 10.0f), + (R_COMPASS_OFFSET_Y - tempZ + ((CVarGetInteger("gMinimapPosY", 0)*10)*-1)) / 10.0f, 0.0f, MTXMODE_NEW); + } else if (CVarGetInteger("gMinimapPosType", 0) == 4) {//Hidden Matrix_Translate( (R_COMPASS_OFFSET_X+(9999*10) + tempX / 10.0f), (R_COMPASS_OFFSET_Y+(9999*10) - tempZ) / 10.0f, 0.0f, MTXMODE_NEW); @@ -714,23 +714,23 @@ void Minimap_Draw(PlayState* play) { InterfaceContext* interfaceCtx = &play->interfaceCtx; s32 mapIndex = gSaveContext.mapIndex; Color_RGB8 minimapColor = {0, 255, 255}; - if (CVar_GetS32("gCosmetics.Hud_Minimap.Changed", 0)) { - minimapColor = CVar_GetRGB("gCosmetics.Hud_Minimap.Value", minimapColor); + if (CVarGetInteger("gCosmetics.Hud_Minimap.Changed", 0)) { + minimapColor = CVarGetColor24("gCosmetics.Hud_Minimap.Value", minimapColor); } OPEN_DISPS(play->state.gfxCtx); // If any of these CVars are enabled, disable toggling the minimap with L, unless gEnableMapToggle is set bool enableMapToggle = - !(CVar_GetS32("gDebugEnabled", 0) || CVar_GetS32("gMoonJumpOnL", 0) || CVar_GetS32("gTurboOnL", 0)) || - CVar_GetS32("gEnableMapToggle", 0); + !(CVarGetInteger("gDebugEnabled", 0) || CVarGetInteger("gMoonJumpOnL", 0) || CVarGetInteger("gTurboOnL", 0)) || + CVarGetInteger("gEnableMapToggle", 0); if (play->pauseCtx.state < 4) { //Minimap margins s16 X_Margins_Minimap; s16 Y_Margins_Minimap; - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) { - if (CVar_GetS32("gMinimapPosType", 0) == 0) {X_Margins_Minimap = Right_MM_Margin;}; + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) { + if (CVarGetInteger("gMinimapPosType", 0) == 0) {X_Margins_Minimap = Right_MM_Margin;}; Y_Margins_Minimap = Bottom_MM_Margin; } else { X_Margins_Minimap = 0; @@ -763,17 +763,17 @@ void Minimap_Draw(PlayState* play) { s16 dgnMiniMapX = OTRGetRectDimensionFromRightEdge(R_DGN_MINIMAP_X + X_Margins_Minimap); s16 dgnMiniMapY = R_DGN_MINIMAP_Y + Y_Margins_Minimap; - if (CVar_GetS32("gMinimapPosType", 0) != 0) { - dgnMiniMapY = R_DGN_MINIMAP_Y+CVar_GetS32("gMinimapPosY", 0)+Y_Margins_Minimap; - if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; - dgnMiniMapX = OTRGetDimensionFromLeftEdge(R_DGN_MINIMAP_X+CVar_GetS32("gMinimapPosX", 0)+X_Margins_Minimap); - } else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; - dgnMiniMapX = OTRGetDimensionFromRightEdge(R_DGN_MINIMAP_X+CVar_GetS32("gMinimapPosX", 0)+X_Margins_Minimap); - } else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None - dgnMiniMapX = CVar_GetS32("gMinimapPosX", 0); - } else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gMinimapPosType", 0) != 0) { + dgnMiniMapY = R_DGN_MINIMAP_Y+CVarGetInteger("gMinimapPosY", 0)+Y_Margins_Minimap; + if (CVarGetInteger("gMinimapPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; + dgnMiniMapX = OTRGetDimensionFromLeftEdge(R_DGN_MINIMAP_X+CVarGetInteger("gMinimapPosX", 0)+X_Margins_Minimap); + } else if (CVarGetInteger("gMinimapPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; + dgnMiniMapX = OTRGetDimensionFromRightEdge(R_DGN_MINIMAP_X+CVarGetInteger("gMinimapPosX", 0)+X_Margins_Minimap); + } else if (CVarGetInteger("gMinimapPosType", 0) == 3) {//Anchor None + dgnMiniMapX = CVarGetInteger("gMinimapPosX", 0); + } else if (CVarGetInteger("gMinimapPosType", 0) == 4) {//Hidden dgnMiniMapX = -9999; } } @@ -834,17 +834,17 @@ void Minimap_Draw(PlayState* play) { s16 oWMiniMapX = OTRGetRectDimensionFromRightEdge(R_OW_MINIMAP_X + X_Margins_Minimap); s16 oWMiniMapY = R_OW_MINIMAP_Y + Y_Margins_Minimap; - if (CVar_GetS32("gMinimapPosType", 0) != 0) { - oWMiniMapY = R_OW_MINIMAP_Y+CVar_GetS32("gMinimapPosY", 0)+Y_Margins_Minimap; - if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; - oWMiniMapX = OTRGetDimensionFromLeftEdge(R_OW_MINIMAP_X+CVar_GetS32("gMinimapPosX", 0)+X_Margins_Minimap); - } else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; - oWMiniMapX = OTRGetDimensionFromRightEdge(R_OW_MINIMAP_X+CVar_GetS32("gMinimapPosX", 0)+X_Margins_Minimap); - } else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None - oWMiniMapX = CVar_GetS32("gMinimapPosX", 0); - } else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gMinimapPosType", 0) != 0) { + oWMiniMapY = R_OW_MINIMAP_Y+CVarGetInteger("gMinimapPosY", 0)+Y_Margins_Minimap; + if (CVarGetInteger("gMinimapPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; + oWMiniMapX = OTRGetDimensionFromLeftEdge(R_OW_MINIMAP_X+CVarGetInteger("gMinimapPosX", 0)+X_Margins_Minimap); + } else if (CVarGetInteger("gMinimapPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; + oWMiniMapX = OTRGetDimensionFromRightEdge(R_OW_MINIMAP_X+CVarGetInteger("gMinimapPosX", 0)+X_Margins_Minimap); + } else if (CVarGetInteger("gMinimapPosType", 0) == 3) {//Anchor None + oWMiniMapX = CVarGetInteger("gMinimapPosX", 0); + } else if (CVarGetInteger("gMinimapPosType", 0) == 4) {//Hidden oWMiniMapX = -9999; } } @@ -868,45 +868,45 @@ void Minimap_Draw(PlayState* play) { s16 TopLeftY = PosY << 2; s16 TopLeftW = (Map0 ? OTRGetRectDimensionFromLeftEdge(PosX + IconSize) : OTRGetRectDimensionFromRightEdge(PosX + IconSize)) << 2; s16 TopLeftH = (PosY + IconSize) << 2; - if (CVar_GetS32("gMinimapPosType", 0) != 0) { - PosX = gMapData->owEntranceIconPosX[sEntranceIconMapIndex] + CVar_GetS32("gMinimapPosX", 0) + X_Margins_Minimap; - PosY = gMapData->owEntranceIconPosY[sEntranceIconMapIndex] + CVar_GetS32("gMinimapPosY", 0) + Y_Margins_Minimap; - if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; + if (CVarGetInteger("gMinimapPosType", 0) != 0) { + PosX = gMapData->owEntranceIconPosX[sEntranceIconMapIndex] + CVarGetInteger("gMinimapPosX", 0) + X_Margins_Minimap; + PosY = gMapData->owEntranceIconPosY[sEntranceIconMapIndex] + CVarGetInteger("gMinimapPosY", 0) + Y_Margins_Minimap; + if (CVarGetInteger("gMinimapPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; TopLeftX = OTRGetRectDimensionFromLeftEdge(PosX) << 2; TopLeftW = OTRGetRectDimensionFromLeftEdge(PosX + IconSize) << 2; - } else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; + } else if (CVarGetInteger("gMinimapPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; TopLeftX = OTRGetRectDimensionFromRightEdge(PosX) << 2; TopLeftW = OTRGetRectDimensionFromRightEdge(PosX + IconSize) << 2; - } else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None + } else if (CVarGetInteger("gMinimapPosType", 0) == 3) {//Anchor None TopLeftX = PosX << 2; TopLeftW = PosX + IconSize << 2; - } else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden + } else if (CVarGetInteger("gMinimapPosType", 0) == 4) {//Hidden TopLeftX = -9999 << 2; TopLeftW = -9999 + IconSize << 2; } - if (!CVar_GetS32("gMinimapPosType", 0) != 4 && Map0 && !CVar_GetS32("gFixDungeonMinimapIcon", 0)) { //Force top left icon if fix not applied. + if (!CVarGetInteger("gMinimapPosType", 0) != 4 && Map0 && !CVarGetInteger("gFixDungeonMinimapIcon", 0)) { //Force top left icon if fix not applied. TopLeftX = OTRGetRectDimensionFromLeftEdge(gMapData->owEntranceIconPosX[sEntranceIconMapIndex]) << 2; TopLeftY = gMapData->owEntranceIconPosY[sEntranceIconMapIndex] << 2; TopLeftW = OTRGetRectDimensionFromLeftEdge(gMapData->owEntranceIconPosX[sEntranceIconMapIndex] + IconSize) << 2; TopLeftH = (gMapData->owEntranceIconPosY[sEntranceIconMapIndex] + IconSize) << 2; } } - if (CVar_GetS32("gFixDungeonMinimapIcon", 0) != 0){ + if (CVarGetInteger("gFixDungeonMinimapIcon", 0) != 0){ //No idea why and how Original value work but this does actually fix them all. PosY = PosY+1024; } if ((gMapData->owEntranceFlag[sEntranceIconMapIndex] == 0xFFFF) || ((gMapData->owEntranceFlag[sEntranceIconMapIndex] != 0xFFFF) && (gSaveContext.infTable[26] & gBitFlags[gMapData->owEntranceFlag[mapIndex]]))) { - if (!Map0 || !CVar_GetS32("gFixDungeonMinimapIcon", 0)) { + if (!Map0 || !CVarGetInteger("gFixDungeonMinimapIcon", 0)) { gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, IconSize, IconSize, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPWideTextureRectangle(OVERLAY_DISP++, TopLeftX, TopLeftY, TopLeftW, TopLeftH, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); } - } else if (CVar_GetS32("gAlwaysShowDungeonMinimapIcon", 0) != 0){ //Ability to show entrance Before beating the dungeon itself + } else if (CVarGetInteger("gAlwaysShowDungeonMinimapIcon", 0) != 0){ //Ability to show entrance Before beating the dungeon itself gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, IconSize, IconSize, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); @@ -916,17 +916,17 @@ void Minimap_Draw(PlayState* play) { s16 entranceX = OTRGetRectDimensionFromRightEdge(270 + X_Margins_Minimap); s16 entranceY = 154 + Y_Margins_Minimap; - if (CVar_GetS32("gMinimapPosType", 0) != 0) { - entranceY = 154 + Y_Margins_Minimap + CVar_GetS32("gMinimapPosY", 0); - if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; - entranceX = OTRGetRectDimensionFromLeftEdge(270 + X_Margins_Minimap + CVar_GetS32("gMinimapPosX", 0)); - } else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; - entranceX = OTRGetRectDimensionFromRightEdge(270 + X_Margins_Minimap + CVar_GetS32("gMinimapPosX", 0)); - } else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None - entranceX = 270 + X_Margins_Minimap + CVar_GetS32("gMinimapPosX", 0); - } else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gMinimapPosType", 0) != 0) { + entranceY = 154 + Y_Margins_Minimap + CVarGetInteger("gMinimapPosY", 0); + if (CVarGetInteger("gMinimapPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Left_MM_Margin;}; + entranceX = OTRGetRectDimensionFromLeftEdge(270 + X_Margins_Minimap + CVarGetInteger("gMinimapPosX", 0)); + } else if (CVarGetInteger("gMinimapPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap = Right_MM_Margin;}; + entranceX = OTRGetRectDimensionFromRightEdge(270 + X_Margins_Minimap + CVarGetInteger("gMinimapPosX", 0)); + } else if (CVarGetInteger("gMinimapPosType", 0) == 3) {//Anchor None + entranceX = 270 + X_Margins_Minimap + CVarGetInteger("gMinimapPosX", 0); + } else if (CVarGetInteger("gMinimapPosType", 0) == 4) {//Hidden entranceX = -9999; } } @@ -937,7 +937,7 @@ void Minimap_Draw(PlayState* play) { G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPWideTextureRectangle(OVERLAY_DISP++, entranceX << 2, entranceY << 2, (entranceX + 32) << 2, (entranceY + 8) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); - } else if ((play->sceneNum == SCENE_SPOT08) && CVar_GetS32("gAlwaysShowDungeonMinimapIcon", 0) != 0){ + } else if ((play->sceneNum == SCENE_SPOT08) && CVarGetInteger("gAlwaysShowDungeonMinimapIcon", 0) != 0){ gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, @@ -979,10 +979,10 @@ void Map_Update(PlayState* play) { s16 floor; s16 i; - Top_MM_Margin = CVar_GetS32("gHUDMargin_T", 0); - Left_MM_Margin = CVar_GetS32("gHUDMargin_L", 0); - Right_MM_Margin = CVar_GetS32("gHUDMargin_R", 0); - Bottom_MM_Margin = CVar_GetS32("gHUDMargin_B", 0); + Top_MM_Margin = CVarGetInteger("gHUDMargin_T", 0); + Left_MM_Margin = CVarGetInteger("gHUDMargin_L", 0); + Right_MM_Margin = CVarGetInteger("gHUDMargin_R", 0); + Bottom_MM_Margin = CVarGetInteger("gHUDMargin_B", 0); if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0)) { switch (play->sceneNum) { @@ -1052,4 +1052,4 @@ void Map_Update(PlayState* play) { break; } } -} \ No newline at end of file +} diff --git a/soh/src/code/z_map_mark.c b/soh/src/code/z_map_mark.c index 05e66e1aa..8d9f025a0 100644 --- a/soh/src/code/z_map_mark.c +++ b/soh/src/code/z_map_mark.c @@ -113,15 +113,15 @@ void MapMark_DrawForDungeon(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->minimapAlpha); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, interfaceCtx->minimapAlpha); - s32 Top_MC_Margin = CVar_GetS32("gHUDMargin_T", 0); - s32 Left_MC_Margin = CVar_GetS32("gHUDMargin_L", 0); - s32 Right_MC_Margin = CVar_GetS32("gHUDMargin_R", 0); - s32 Bottom_MC_Margin = CVar_GetS32("gHUDMargin_B", 0); + s32 Top_MC_Margin = CVarGetInteger("gHUDMargin_T", 0); + s32 Left_MC_Margin = CVarGetInteger("gHUDMargin_L", 0); + s32 Right_MC_Margin = CVarGetInteger("gHUDMargin_R", 0); + s32 Bottom_MC_Margin = CVarGetInteger("gHUDMargin_B", 0); s32 X_Margins_Minimap_ic; s32 Y_Margins_Minimap_ic; - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) { - if (CVar_GetS32("gMinimapPosType", 0) == 0) {X_Margins_Minimap_ic = Right_MC_Margin;}; + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) { + if (CVarGetInteger("gMinimapPosType", 0) == 0) {X_Margins_Minimap_ic = Right_MC_Margin;}; Y_Margins_Minimap_ic = Bottom_MC_Margin; } else { X_Margins_Minimap_ic = 0; @@ -135,24 +135,24 @@ void MapMark_DrawForDungeon(PlayState* play) { //Minimap chest / boss icon const s32 PosX_Minimap_ori = GREG(94) + OTRGetRectDimensionFromRightEdge(markPoint->x+X_Margins_Minimap_ic) + 204; const s32 PosY_Minimap_ori = GREG(95) + markPoint->y + Y_Margins_Minimap_ic + 140; - if (CVar_GetS32("gMinimapPosType", 0) != 0) { - rectTop = (markPoint->y + Y_Margins_Minimap_ic + 140 + CVar_GetS32("gMinimapPosY", 0)); - if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap_ic = Left_MC_Margin;}; + if (CVarGetInteger("gMinimapPosType", 0) != 0) { + rectTop = (markPoint->y + Y_Margins_Minimap_ic + 140 + CVarGetInteger("gMinimapPosY", 0)); + if (CVarGetInteger("gMinimapPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap_ic = Left_MC_Margin;}; if (play->sceneNum == SCENE_YDAN || play->sceneNum == SCENE_DDAN || play->sceneNum == SCENE_BDAN || play->sceneNum == SCENE_BMORI1 || play->sceneNum == SCENE_HIDAN || play->sceneNum == SCENE_MIZUSIN || play->sceneNum == SCENE_JYASINZOU || play->sceneNum == SCENE_HAKADAN || play->sceneNum == SCENE_HAKADANCH || play->sceneNum == SCENE_ICE_DOUKUTO) { - rectLeft = OTRGetRectDimensionFromLeftEdge(markPoint->x+CVar_GetS32("gMinimapPosX", 0)+204+X_Margins_Minimap_ic); + rectLeft = OTRGetRectDimensionFromLeftEdge(markPoint->x+CVarGetInteger("gMinimapPosX", 0)+204+X_Margins_Minimap_ic); } else { - rectLeft = OTRGetRectDimensionFromLeftEdge(markPoint->x+CVar_GetS32("gMinimapPosX", 0)+204+X_Margins_Minimap_ic); + rectLeft = OTRGetRectDimensionFromLeftEdge(markPoint->x+CVarGetInteger("gMinimapPosX", 0)+204+X_Margins_Minimap_ic); } - } else if (CVar_GetS32("gMinimapPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap_ic = Right_MC_Margin;}; - rectLeft = OTRGetRectDimensionFromRightEdge(markPoint->x+CVar_GetS32("gMinimapPosX", 0)+204+X_Margins_Minimap_ic); - } else if (CVar_GetS32("gMinimapPosType", 0) == 3) {//Anchor None - rectLeft = markPoint->x+CVar_GetS32("gMinimapPosX", 0)+204+X_Margins_Minimap_ic; - } else if (CVar_GetS32("gMinimapPosType", 0) == 4) {//Hidden + } else if (CVarGetInteger("gMinimapPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap_ic = Right_MC_Margin;}; + rectLeft = OTRGetRectDimensionFromRightEdge(markPoint->x+CVarGetInteger("gMinimapPosX", 0)+204+X_Margins_Minimap_ic); + } else if (CVarGetInteger("gMinimapPosType", 0) == 3) {//Anchor None + rectLeft = markPoint->x+CVarGetInteger("gMinimapPosX", 0)+204+X_Margins_Minimap_ic; + } else if (CVarGetInteger("gMinimapPosType", 0) == 4) {//Hidden rectLeft = -9999; } } else { diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 9a4af2db1..af2eb7366 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -95,30 +95,30 @@ void Message_ResetOcarinaNoteState(void) { sOcarinaNoteABtnEnv = (Color_RGB8){ 10, 10, 10 }; sOcarinaNoteCBtnPrim = (Color_RGB8){ 255, 255, 50 }; sOcarinaNoteCBtnEnv = (Color_RGB8){ 10, 10, 10 }; - if (CVar_GetS32("gCosmetics.Hud_AButton.Changed", 0)) { - sOcarinaNoteABtnPrim = CVar_GetRGB("gCosmetics.Hud_AButton.Value", sOcarinaNoteABtnPrim); - } else if (CVar_GetS32("gCosmetics.DefaultColorScheme", 0)) { + if (CVarGetInteger("gCosmetics.Hud_AButton.Changed", 0)) { + sOcarinaNoteABtnPrim = CVarGetColor24("gCosmetics.Hud_AButton.Value", sOcarinaNoteABtnPrim); + } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", 0)) { sOcarinaNoteABtnPrim = (Color_RGB8){ 80, 255, 150 }; } - if (CVar_GetS32("gCosmetics.Hud_CButtons.Changed", 0)) { - sOcarinaNoteCBtnPrim = CVar_GetRGB("gCosmetics.Hud_CButtons.Value", sOcarinaNoteCBtnPrim); + if (CVarGetInteger("gCosmetics.Hud_CButtons.Changed", 0)) { + sOcarinaNoteCBtnPrim = CVarGetColor24("gCosmetics.Hud_CButtons.Value", sOcarinaNoteCBtnPrim); } sOcarinaNoteCUpBtnPrim = sOcarinaNoteCBtnPrim; sOcarinaNoteCDownBtnPrim = sOcarinaNoteCBtnPrim; sOcarinaNoteCLeftBtnPrim = sOcarinaNoteCBtnPrim; sOcarinaNoteCRightBtnPrim = sOcarinaNoteCBtnPrim; - if (CVar_GetS32("gCosmetics.Hud_CUpButton.Changed", 0)) { - sOcarinaNoteCUpBtnPrim = CVar_GetRGB("gCosmetics.Hud_CUpButton.Value", sOcarinaNoteCUpBtnPrim); + if (CVarGetInteger("gCosmetics.Hud_CUpButton.Changed", 0)) { + sOcarinaNoteCUpBtnPrim = CVarGetColor24("gCosmetics.Hud_CUpButton.Value", sOcarinaNoteCUpBtnPrim); } - if (CVar_GetS32("gCosmetics.Hud_CDownButton.Changed", 0)) { - sOcarinaNoteCDownBtnPrim = CVar_GetRGB("gCosmetics.Hud_CDownButton.Value", sOcarinaNoteCDownBtnPrim); + if (CVarGetInteger("gCosmetics.Hud_CDownButton.Changed", 0)) { + sOcarinaNoteCDownBtnPrim = CVarGetColor24("gCosmetics.Hud_CDownButton.Value", sOcarinaNoteCDownBtnPrim); } - if (CVar_GetS32("gCosmetics.Hud_CLeftButton.Changed", 0)) { - sOcarinaNoteCLeftBtnPrim = CVar_GetRGB("gCosmetics.Hud_CLeftButton.Value", sOcarinaNoteCLeftBtnPrim); + if (CVarGetInteger("gCosmetics.Hud_CLeftButton.Changed", 0)) { + sOcarinaNoteCLeftBtnPrim = CVarGetColor24("gCosmetics.Hud_CLeftButton.Value", sOcarinaNoteCLeftBtnPrim); } - if (CVar_GetS32("gCosmetics.Hud_CRightButton.Changed", 0)) { - sOcarinaNoteCRightBtnPrim = CVar_GetRGB("gCosmetics.Hud_CRightButton.Value", sOcarinaNoteCRightBtnPrim); + if (CVarGetInteger("gCosmetics.Hud_CRightButton.Changed", 0)) { + sOcarinaNoteCRightBtnPrim = CVarGetColor24("gCosmetics.Hud_CRightButton.Value", sOcarinaNoteCRightBtnPrim); } } @@ -146,7 +146,7 @@ void Message_UpdateOcarinaGame(PlayState* play) { u8 Message_ShouldAdvance(PlayState* play) { Input* input = &play->state.input[0]; - bool isB_Held = CVar_GetS32("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) + bool isB_Held = CVarGetInteger("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) : CHECK_BTN_ALL(input->press.button, BTN_B); if (CHECK_BTN_ALL(input->press.button, BTN_A) || isB_Held || CHECK_BTN_ALL(input->press.button, BTN_CUP)) { @@ -158,7 +158,7 @@ u8 Message_ShouldAdvance(PlayState* play) { u8 Message_ShouldAdvanceSilent(PlayState* play) { Input* input = &play->state.input[0]; - bool isB_Held = CVar_GetS32("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) + bool isB_Held = CVarGetInteger("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) : CHECK_BTN_ALL(input->press.button, BTN_B); return CHECK_BTN_ALL(input->press.button, BTN_A) || isB_Held || CHECK_BTN_ALL(input->press.button, BTN_CUP); @@ -183,7 +183,7 @@ void Message_HandleChoiceSelection(PlayState* play, u8 numChoices) { static s16 sAnalogStickHeld = false; MessageContext* msgCtx = &play->msgCtx; Input* input = &play->state.input[0]; - bool dpad = CVar_GetS32("gDpadText", 0); + bool dpad = CVarGetInteger("gDpadText", 0); if ((input->rel.stick_y >= 30 && !sAnalogStickHeld) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { sAnalogStickHeld = true; @@ -287,7 +287,7 @@ void Message_FindMessage(PlayState* play, u16 textId) { const char* seg; u16 bufferId = textId; // Use the better owl message if better owl is enabled - if (CVar_GetS32("gBetterOwl", 0) != 0 && (bufferId == 0x2066 || bufferId == 0x607B || + if (CVarGetInteger("gBetterOwl", 0) != 0 && (bufferId == 0x2066 || bufferId == 0x607B || bufferId == 0x10C2 || bufferId == 0x10C6 || bufferId == 0x206A)) { bufferId = 0x71B3; @@ -458,14 +458,14 @@ void Message_DrawTextboxIcon(PlayState* play, Gfx** p, s16 x, s16 y) { { 0, 0, 0 }, { 0, 130, 255 }, }; - if (CVar_GetS32("gCosmetics.Hud_AButton.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.Hud_AButton.Value", (Color_RGB8){ 50, 130, 255 }); + if (CVarGetInteger("gCosmetics.Hud_AButton.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_AButton.Value", (Color_RGB8){ 50, 130, 255 }); sIconPrimColors[0].r = (color.r / 255) * 95; sIconPrimColors[0].g = (color.g / 255) * 95; sIconPrimColors[0].b = (color.b / 255) * 95; sIconPrimColors[1] = color; sIconEnvColors[1] = color; - } else if (CVar_GetS32("gCosmetics.DefaultColorScheme", 0)) { + } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", 0)) { sIconPrimColors[0] = (Color_RGB8){ 0, 200, 80 }; sIconPrimColors[1] = (Color_RGB8){ 50, 255, 130 }; sIconEnvColors[1] = (Color_RGB8){ 50, 255, 130 }; @@ -1024,7 +1024,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { msgCtx->textDelay = msgCtx->msgBufDecoded[++i]; break; case MESSAGE_UNSKIPPABLE: - msgCtx->textUnskippable = CVar_GetS32("gSkipText", 0) != 1; + msgCtx->textUnskippable = CVarGetInteger("gSkipText", 0) != 1; break; case MESSAGE_TWO_CHOICE: msgCtx->textboxEndType = TEXTBOX_ENDTYPE_2_CHOICE; @@ -1108,7 +1108,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { } } if (msgCtx->textDelayTimer == 0) { - msgCtx->textDrawPos = i + CVar_GetS32("gTextSpeed", 2); + msgCtx->textDrawPos = i + CVarGetInteger("gTextSpeed", 2); msgCtx->textDelayTimer = msgCtx->textDelay; } else { msgCtx->textDelayTimer--; @@ -1131,7 +1131,7 @@ void Message_LoadItemIcon(PlayState* play, u16 itemId, s16 y) { R_TEXTBOX_ICON_YPOS = y + 6; R_TEXTBOX_ICON_SIZE = 32; memcpy((uintptr_t)msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, - ResourceMgr_LoadTexByName(gItemIcons[itemId]), ResourceMgr_LoadTexSizeByName(gItemIcons[itemId])); + GetResourceDataByName(gItemIcons[itemId], false), GetResourceTexSizeByName(gItemIcons[itemId], false)); // "Item 32-0" osSyncPrintf("アイテム32-0\n"); } else { @@ -1139,7 +1139,7 @@ void Message_LoadItemIcon(PlayState* play, u16 itemId, s16 y) { R_TEXTBOX_ICON_YPOS = y + 10; R_TEXTBOX_ICON_SIZE = 24; memcpy((uintptr_t)msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, - ResourceMgr_LoadTexByName(gItemIcons[itemId]), ResourceMgr_LoadTexSizeByName(gItemIcons[itemId])); + GetResourceDataByName(gItemIcons[itemId], false), GetResourceTexSizeByName(gItemIcons[itemId], false)); // "Item 24" osSyncPrintf("アイテム24=%d (%d) {%d}\n", itemId, itemId - ITEM_KOKIRI_EMERALD, 84); } @@ -1509,9 +1509,9 @@ void Message_Decode(PlayState* play) { msgCtx->textboxBackgroundUnkArg = font->msgBuf[msgCtx->msgBufPos + 3] & 0xF; memcpy((uintptr_t)msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, - ResourceMgr_LoadTexByName(gRedMessageXLeftTex), ResourceMgr_LoadTexSizeByName(gRedMessageXLeftTex)); + GetResourceDataByName(gRedMessageXLeftTex, false), GetResourceTexSizeByName(gRedMessageXLeftTex, false)); memcpy((uintptr_t)msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE + 0x900, - ResourceMgr_LoadTexByName(gRedMessageXRightTex), ResourceMgr_LoadTexSizeByName(gRedMessageXRightTex)); + GetResourceDataByName(gRedMessageXRightTex, false), GetResourceTexSizeByName(gRedMessageXRightTex, false)); msgCtx->msgBufPos += 3; R_TEXTBOX_BG_YPOS = R_TEXTBOX_Y + 8; @@ -1630,12 +1630,12 @@ void Message_OpenText(PlayState* play, u16 textId) { //DmaMgr_SendRequest1(font->msgBuf, (uintptr_t)(_staff_message_data_staticSegmentRomStart + 4 + font->msgOffset), //font->msgLength, __FILE__, __LINE__); - } else if (CVar_GetS32("gAskToEquip", 0) && - (((LINK_IS_ADULT || CVar_GetS32("gTimelessEquipment", 0)) && + } else if (CVarGetInteger("gAskToEquip", 0) && + (((LINK_IS_ADULT || CVarGetInteger("gTimelessEquipment", 0)) && // 0C = Biggoron, 4B = Giant's, 4E = Mirror Shield, 50-51 = Tunics (textId == 0x0C || textId == 0x4B || textId == 0x4E || textId == 0x50 || textId == 0x51)) || - ((!LINK_IS_ADULT || CVar_GetS32("gTimelessEquipment", 0)) && + ((!LINK_IS_ADULT || CVarGetInteger("gTimelessEquipment", 0)) && // 4C = Deku Shield, A4 = Kokiri Sword (textId == 0x4C || textId == 0xA4)) || // 4D == Hylian Shield @@ -1657,7 +1657,7 @@ void Message_OpenText(PlayState* play, u16 textId) { osSyncPrintf("吹き出し種類=%d\n", msgCtx->textBoxType); if (textBoxType < TEXTBOX_TYPE_NONE_BOTTOM) { const char* textureName = msgStaticTbl[messageStaticIndices[textBoxType]]; - memcpy(msgCtx->textboxSegment, ResourceMgr_LoadTexByName(textureName), MESSAGE_STATIC_TEX_SIZE); + memcpy(msgCtx->textboxSegment, GetResourceDataByName(textureName, false), MESSAGE_STATIC_TEX_SIZE); if (textBoxType == TEXTBOX_TYPE_BLACK) { msgCtx->textboxColorRed = 0; msgCtx->textboxColorGreen = 0; @@ -1999,14 +1999,14 @@ void Message_DrawMain(PlayState* play, Gfx** p) { { 10, 10, 10 }, { 50, 50, 255 }, }; - if (CVar_GetS32("gCosmetics.Hud_AButton.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.Hud_AButton.Value", (Color_RGB8){ 100, 200, 255 }); + if (CVarGetInteger("gCosmetics.Hud_AButton.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_AButton.Value", (Color_RGB8){ 100, 200, 255 }); sOcarinaNoteAPrimColors[0].r = (color.r / 255) * 95; sOcarinaNoteAPrimColors[0].g = (color.g / 255) * 95; sOcarinaNoteAPrimColors[0].b = (color.b / 255) * 95; sOcarinaNoteAPrimColors[1] = color; sOcarinaNoteAEnvColors[1] = color; - } else if (CVar_GetS32("gCosmetics.DefaultColorScheme", 0)) { + } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", 0)) { sOcarinaNoteAPrimColors[0] = (Color_RGB8){ 80, 255, 150 }; sOcarinaNoteAPrimColors[1] = (Color_RGB8){ 100, 255, 200 }; sOcarinaNoteAEnvColors[1] = (Color_RGB8){ 50, 255, 50 }; @@ -2020,8 +2020,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { { 10, 10, 10 }, { 110, 110, 50 }, }; - if (CVar_GetS32("gCosmetics.Hud_CButtons.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.Hud_CButtons.Value", (Color_RGB8){ 100, 200, 255 }); + if (CVarGetInteger("gCosmetics.Hud_CButtons.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_CButtons.Value", (Color_RGB8){ 100, 200, 255 }); sOcarinaNoteCPrimColors[0] = color; sOcarinaNoteCPrimColors[1] = color; sOcarinaNoteCEnvColors[1].r = (color.r / 255) * 95; @@ -2037,8 +2037,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { { 10, 10, 10 }, { 110, 110, 50 }, }; - if (CVar_GetS32("gCosmetics.Hud_CUpButton.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.Hud_CUpButton.Value", (Color_RGB8){ 100, 200, 255 }); + if (CVarGetInteger("gCosmetics.Hud_CUpButton.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_CUpButton.Value", (Color_RGB8){ 100, 200, 255 }); sOcarinaNoteCUpPrimColors[0] = color; sOcarinaNoteCUpPrimColors[1] = color; sOcarinaNoteCUpEnvColors[1].r = (color.r / 255) * 95; @@ -2054,8 +2054,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { { 10, 10, 10 }, { 110, 110, 50 }, }; - if (CVar_GetS32("gCosmetics.Hud_CDownButton.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.Hud_CDownButton.Value", (Color_RGB8){ 100, 200, 255 }); + if (CVarGetInteger("gCosmetics.Hud_CDownButton.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_CDownButton.Value", (Color_RGB8){ 100, 200, 255 }); sOcarinaNoteCDownPrimColors[0] = color; sOcarinaNoteCDownPrimColors[1] = color; sOcarinaNoteCDownEnvColors[1].r = (color.r / 255) * 95; @@ -2071,8 +2071,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { { 10, 10, 10 }, { 110, 110, 50 }, }; - if (CVar_GetS32("gCosmetics.Hud_CLeftButton.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.Hud_CLeftButton.Value", (Color_RGB8){ 100, 200, 255 }); + if (CVarGetInteger("gCosmetics.Hud_CLeftButton.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_CLeftButton.Value", (Color_RGB8){ 100, 200, 255 }); sOcarinaNoteCLeftPrimColors[0] = color; sOcarinaNoteCLeftPrimColors[1] = color; sOcarinaNoteCLeftEnvColors[1].r = (color.r / 255) * 95; @@ -2088,8 +2088,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { { 10, 10, 10 }, { 110, 110, 50 }, }; - if (CVar_GetS32("gCosmetics.Hud_CRightButton.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.Hud_CRightButton.Value", (Color_RGB8){ 100, 200, 255 }); + if (CVarGetInteger("gCosmetics.Hud_CRightButton.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.Hud_CRightButton.Value", (Color_RGB8){ 100, 200, 255 }); sOcarinaNoteCRightPrimColors[0] = color; sOcarinaNoteCRightPrimColors[1] = color; sOcarinaNoteCRightEnvColors[1].r = (color.r / 255) * 95; @@ -2136,7 +2136,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); - bool isB_Held = CVar_GetS32("gSkipText", 0) != 0 ? CHECK_BTN_ALL(play->state.input[0].cur.button, BTN_B) + bool isB_Held = CVarGetInteger("gSkipText", 0) != 0 ? CHECK_BTN_ALL(play->state.input[0].cur.button, BTN_B) : CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B); switch (msgCtx->msgMode) { @@ -2417,7 +2417,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { } break; case MSGMODE_SETUP_DISPLAY_SONG_PLAYED: - if (CVar_GetS32("gFastOcarinaPlayback", 0) == 0 || + if (CVarGetInteger("gFastOcarinaPlayback", 0) == 0 || play->msgCtx.lastPlayedSong == OCARINA_SONG_TIME || play->msgCtx.lastPlayedSong == OCARINA_SONG_STORMS || play->msgCtx.lastPlayedSong == OCARINA_SONG_SUNS) { @@ -2472,7 +2472,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { Message_Decode(play); msgCtx->msgMode = MSGMODE_DISPLAY_SONG_PLAYED_TEXT; - if (CVar_GetS32("gFastOcarinaPlayback", 0) == 0 || play->msgCtx.lastPlayedSong == OCARINA_SONG_TIME + if (CVarGetInteger("gFastOcarinaPlayback", 0) == 0 || play->msgCtx.lastPlayedSong == OCARINA_SONG_TIME || play->msgCtx.lastPlayedSong == OCARINA_SONG_STORMS || play->msgCtx.lastPlayedSong == OCARINA_SONG_SUNS) { msgCtx->stateTimer = 20; @@ -2987,7 +2987,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { * the last value being saved in a static variable. */ void Message_DrawDebugVariableChanged(s16* var, GraphicsContext* gfxCtx) { - if (!CVar_GetS32("gDebugEnabled", 0)) { return; } + if (!CVarGetInteger("gDebugEnabled", 0)) { return; } static s16 sVarLastValue = 0; static s16 sFillTimer = 0; @@ -3124,7 +3124,7 @@ void Message_Update(PlayState* play) { return; } - bool isB_Held = CVar_GetS32("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) && !sTextboxSkipped + bool isB_Held = CVarGetInteger("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) && !sTextboxSkipped : CHECK_BTN_ALL(input->press.button, BTN_B); switch (msgCtx->msgMode) { diff --git a/soh/src/code/z_olib.c b/soh/src/code/z_olib.c index 9446e1dc1..2b72f3014 100644 --- a/soh/src/code/z_olib.c +++ b/soh/src/code/z_olib.c @@ -80,7 +80,7 @@ Vec3f* OLib_VecSphToVec3f(Vec3f* dest, VecSph* sph) { f32 sinYaw; f32 cosYaw; - if (CVar_GetS32("gFixCameraDrift", 0)) { + if (CVarGetInteger("gFixCameraDrift", 0)) { cosPitch = Math_AccurateCosS(sph->pitch); cosYaw = Math_AccurateCosS(sph->yaw); sinPitch = Math_AccurateSinS(sph->pitch); diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 8295b0845..d82b4922f 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -5,6 +5,7 @@ #include "textures/icon_item_static/icon_item_static.h" #include "soh/Enhancements/randomizer/adult_trade_shuffle.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" +#include "libultraship/bridge.h" #ifdef _MSC_VER #include @@ -21,7 +22,7 @@ static uint16_t DO_ACTION_TEX_WIDTH() { // TODO: Figure out why Ship::Texture is not returning a valid width if (_doActionTexWidth == -1) - _doActionTexWidth = ResourceMgr_LoadTexWidthByName(gCheckDoActionENGTex); + _doActionTexWidth = GetResourceTexWidthByName(gCheckDoActionENGTex, false); return _doActionTexWidth; } static uint16_t DO_ACTION_TEX_HEIGHT() { @@ -29,14 +30,14 @@ static uint16_t DO_ACTION_TEX_HEIGHT() { // TODO: Figure out why Ship::Texture is not returning a valid height if (_doActionTexHeight == -1) - _doActionTexHeight = ResourceMgr_LoadTexHeightByName(gCheckDoActionENGTex); + _doActionTexHeight = GetResourceTexHeightByName(gCheckDoActionENGTex, false); return _doActionTexHeight; } static uint32_t _doActionTexSize = -1; static uint32_t DO_ACTION_TEX_SIZE() { if (_doActionTexSize == -1) - _doActionTexSize = ResourceMgr_LoadTexSizeByName(gCheckDoActionENGTex); + _doActionTexSize = GetResourceTexSizeByName(gCheckDoActionENGTex, false); return _doActionTexSize; } @@ -1139,7 +1140,7 @@ void func_80083108(PlayState* play) { if (interfaceCtx->restrictions.tradeItems != 0) { for (i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) { - if ((CVar_GetS32("gMMBunnyHood", 0) != 0) + if ((CVarGetInteger("gMMBunnyHood", 0) != 0) && (gSaveContext.equips.buttonItems[i] >= ITEM_MASK_KEATON) && (gSaveContext.equips.buttonItems[i] <= ITEM_MASK_TRUTH)) { gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] = BTN_ENABLED; @@ -2326,7 +2327,7 @@ u8 Item_Give(PlayState* play, u8 item) { } } } else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) { - if ((item == ITEM_SAW) && CVar_GetS32("gDekuNutUpgradeFix", 0) == 0) { + if ((item == ITEM_SAW) && CVarGetInteger("gDekuNutUpgradeFix", 0) == 0) { gSaveContext.itemGetInf[1] |= 0x8000; } @@ -2717,10 +2718,10 @@ u8 Item_CheckObtainability(u8 item) { // Save when receiving an item, unless it's purchased from a shop void PerformAutosave(PlayState* play, u8 item) { - if (CVar_GetS32("gAutosave", 0) && (play != NULL) && (play->sceneNum != SCENE_KENJYANOMA) && (gSaveContext.pendingSale == ITEM_NONE) && (play->sceneNum != SCENE_GANON_DEMO)) { - if (CVar_GetS32("gAutosaveAllItems", 0)) { + if (CVarGetInteger("gAutosave", 0) && (play != NULL) && (play->sceneNum != SCENE_KENJYANOMA) && (gSaveContext.pendingSale == ITEM_NONE) && (play->sceneNum != SCENE_GANON_DEMO)) { + if (CVarGetInteger("gAutosaveAllItems", 0)) { Play_PerformSave(play); - } else if (CVar_GetS32("gAutosaveMajorItems", 1)) { + } else if (CVarGetInteger("gAutosaveMajorItems", 1)) { switch (item) { case ITEM_STICK: case ITEM_NUT: @@ -2757,7 +2758,7 @@ void PerformAutosave(PlayState* play, u8 item) { case ITEM_BOMBCHU: case ITEM_BOMBCHUS_5: case ITEM_BOMBCHUS_20: - if (!CVar_GetS32("gBombchuDrops", 0)) { + if (!CVarGetInteger("gBombchuDrops", 0)) { Play_PerformSave(play); } break; @@ -2915,7 +2916,7 @@ bool Inventory_HatchPocketCucco(PlayState* play) { void func_80086D5C(s32* buf, u16 size) { u16 i; - //buf = ResourceMgr_LoadTexByName(buf); + //buf = GetResourceDataByName(buf, false); for (i = 0; i < size; i++) { buf[i] = 0; @@ -2958,7 +2959,7 @@ void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 l if (action != DO_ACTION_NONE) { //osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK); - memcpy(interfaceCtx->doActionSegment + (loadOffset * DO_ACTION_TEX_SIZE()), ResourceMgr_LoadTexByName(doAction), + memcpy(interfaceCtx->doActionSegment + (loadOffset * DO_ACTION_TEX_SIZE()), GetResourceDataByName(doAction, false), DO_ACTION_TEX_SIZE()); //DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, //interfaceCtx->doActionSegment + (loadOffset * DO_ACTION_TEX_SIZE), @@ -2992,7 +2993,7 @@ void Interface_SetNaviCall(PlayState* play, u16 naviCallState) { if (((naviCallState == 0x1D) || (naviCallState == 0x1E)) && !interfaceCtx->naviCalling && (play->csCtx.state == CS_STATE_IDLE)) { - if (!CVar_GetS32("gDisableNaviCallAudio", 0)) { + if (!CVarGetInteger("gDisableNaviCallAudio", 0)) { // clang-format off if (naviCallState == 0x1E) { Audio_PlaySoundGeneral(NA_SE_VO_NAVY_CALL, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } @@ -3046,7 +3047,7 @@ void Interface_LoadActionLabelB(PlayState* play, u16 action) { // OTRTODO osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK); - memcpy(interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE(), ResourceMgr_LoadTexByName(doAction), DO_ACTION_TEX_SIZE()); + memcpy(interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE(), GetResourceDataByName(doAction, false), DO_ACTION_TEX_SIZE()); //DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE, //(uintptr_t)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE), DO_ACTION_TEX_SIZE, 0, //&interfaceCtx->loadQueue, NULL, __FILE__, __LINE__); @@ -3347,22 +3348,22 @@ void Interface_UpdateMagicBar(PlayState* play) { Color_RGB8 MagicBorder_2 = { 255, 255, 150 }; Color_RGB8 MagicBorder_3 = { 255, 255, 50 }; - if (CVar_GetS32("gCosmetics.Consumable_MagicBorderActive.Changed", 0)) { //This will make custom color based on users selected colors. - sMagicBorderColors[0][0] = CVar_GetRGB("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_0).r; - sMagicBorderColors[0][1] = CVar_GetRGB("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_0).g; - sMagicBorderColors[0][2] = CVar_GetRGB("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_0).b; + if (CVarGetInteger("gCosmetics.Consumable_MagicBorderActive.Changed", 0)) { //This will make custom color based on users selected colors. + sMagicBorderColors[0][0] = CVarGetColor24("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_0).r; + sMagicBorderColors[0][1] = CVarGetColor24("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_0).g; + sMagicBorderColors[0][2] = CVarGetColor24("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_0).b; - sMagicBorderColors[1][0] = CVar_GetRGB("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_1).r/2; - sMagicBorderColors[1][1] = CVar_GetRGB("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_1).g/2; - sMagicBorderColors[1][2] = CVar_GetRGB("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_1).b/2; + sMagicBorderColors[1][0] = CVarGetColor24("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_1).r/2; + sMagicBorderColors[1][1] = CVarGetColor24("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_1).g/2; + sMagicBorderColors[1][2] = CVarGetColor24("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_1).b/2; - sMagicBorderColors[2][0] = CVar_GetRGB("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_2).r/2.5; - sMagicBorderColors[2][1] = CVar_GetRGB("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_2).g/2.5; - sMagicBorderColors[2][2] = CVar_GetRGB("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_2).b/2.5; + sMagicBorderColors[2][0] = CVarGetColor24("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_2).r/2.5; + sMagicBorderColors[2][1] = CVarGetColor24("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_2).g/2.5; + sMagicBorderColors[2][2] = CVarGetColor24("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_2).b/2.5; - sMagicBorderColors[3][0] = CVar_GetRGB("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_3).r/3; - sMagicBorderColors[3][1] = CVar_GetRGB("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_3).g/3; - sMagicBorderColors[3][2] = CVar_GetRGB("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_3).b/3; + sMagicBorderColors[3][0] = CVarGetColor24("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_3).r/3; + sMagicBorderColors[3][1] = CVarGetColor24("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_3).g/3; + sMagicBorderColors[3][2] = CVarGetColor24("gCosmetics.Consumable_MagicBorderActive.Value", MagicBorder_3).b/3; } static s16 sMagicBorderIndexes[] = { 0, 1, 1, 0 }; @@ -3422,15 +3423,15 @@ void Interface_UpdateMagicBar(PlayState* play) { if (gSaveContext.magic <= 0) { gSaveContext.magic = 0; gSaveContext.magicState = 3; - if (CVar_GetS32("gCosmetics.Consumable_MagicBorder.Changed", 0)) { - sMagicBorder = CVar_GetRGB("gCosmetics.Consumable_MagicBorder.Value", sMagicBorder_ori); + if (CVarGetInteger("gCosmetics.Consumable_MagicBorder.Changed", 0)) { + sMagicBorder = CVarGetColor24("gCosmetics.Consumable_MagicBorder.Value", sMagicBorder_ori); } else { sMagicBorder = sMagicBorder_ori; } } else if (gSaveContext.magic == gSaveContext.magicTarget) { gSaveContext.magicState = 3; - if (CVar_GetS32("gCosmetics.Consumable_MagicBorder.Changed", 0)) { - sMagicBorder = CVar_GetRGB("gCosmetics.Consumable_MagicBorder.Value", sMagicBorder_ori); + if (CVarGetInteger("gCosmetics.Consumable_MagicBorder.Changed", 0)) { + sMagicBorder = CVarGetColor24("gCosmetics.Consumable_MagicBorder.Value", sMagicBorder_ori); } else { sMagicBorder = sMagicBorder_ori; } @@ -3475,8 +3476,8 @@ void Interface_UpdateMagicBar(PlayState* play) { break; case 5: - if (CVar_GetS32("gCosmetics.Consumable_MagicBorder.Changed", 0)) { - sMagicBorder = CVar_GetRGB("gCosmetics.Consumable_MagicBorder.Value", sMagicBorder_ori); + if (CVarGetInteger("gCosmetics.Consumable_MagicBorder.Changed", 0)) { + sMagicBorder = CVarGetColor24("gCosmetics.Consumable_MagicBorder.Value", sMagicBorder_ori); } else { sMagicBorder = sMagicBorder_ori; } @@ -3488,7 +3489,7 @@ void Interface_UpdateMagicBar(PlayState* play) { (msgCtx->msgMode == MSGMODE_NONE) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->sceneLoadFlag == 0) && (play->transitionMode == 0) && !Play_InCsMode(play)) { bool hasLens = false; - for (int buttonIndex = 1; buttonIndex < (CVar_GetS32("gDpadEquips", 0) != 0) ? ARRAY_COUNT(gSaveContext.equips.buttonItems) : 4; buttonIndex++) { + for (int buttonIndex = 1; buttonIndex < (CVarGetInteger("gDpadEquips", 0) != 0) ? ARRAY_COUNT(gSaveContext.equips.buttonItems) : 4; buttonIndex++) { if (gSaveContext.equips.buttonItems[buttonIndex] == ITEM_LENS) { hasLens = true; break; @@ -3501,8 +3502,8 @@ void Interface_UpdateMagicBar(PlayState* play) { Audio_PlaySoundGeneral(NA_SE_SY_GLASSMODE_OFF, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); gSaveContext.magicState = 0; - if (CVar_GetS32("gCosmetics.Consumable_MagicBorder.Changed", 0)) { - sMagicBorder = CVar_GetRGB("gCosmetics.Consumable_MagicBorder.Value", sMagicBorder_ori); + if (CVarGetInteger("gCosmetics.Consumable_MagicBorder.Changed", 0)) { + sMagicBorder = CVarGetColor24("gCosmetics.Consumable_MagicBorder.Value", sMagicBorder_ori); } else { sMagicBorder = sMagicBorder_ori; } @@ -3581,7 +3582,7 @@ void Interface_DrawLineupTick(PlayState* play) { s16 width = 32; s16 height = 32; s16 x = -8 + (SCREEN_WIDTH / 2); - s16 y = CVar_GetS32("gOpenMenuBar", 0) ? -4 : -6; + s16 y = CVarGetInteger("gOpenMenuBar", 0) ? -4 : -6; OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gEmptyCDownArrowTex, width, height, x, y, width, height, 2 << 10, 2 << 10); @@ -3597,11 +3598,11 @@ void Interface_DrawMagicBar(PlayState* play) { Color_RGB8 magicbar_yellow = {250,250,0}; //Magic bar being used Color_RGB8 magicbar_green = {R_MAGIC_FILL_COLOR(0),R_MAGIC_FILL_COLOR(1),R_MAGIC_FILL_COLOR(2)}; //Magic bar fill - if (CVar_GetS32("gCosmetics.Consumable_MagicActive.Changed", 0)) { - magicbar_yellow = CVar_GetRGB("gCosmetics.Consumable_MagicActive.Value", magicbar_yellow); + if (CVarGetInteger("gCosmetics.Consumable_MagicActive.Changed", 0)) { + magicbar_yellow = CVarGetColor24("gCosmetics.Consumable_MagicActive.Value", magicbar_yellow); } - if (CVar_GetS32("gCosmetics.Consumable_Magic.Changed", 0)) { - magicbar_green = CVar_GetRGB("gCosmetics.Consumable_Magic.Value", magicbar_green); + if (CVarGetInteger("gCosmetics.Consumable_Magic.Changed", 0)) { + magicbar_green = CVarGetColor24("gCosmetics.Consumable_Magic.Value", magicbar_green); } OPEN_DISPS(play->state.gfxCtx); @@ -3609,7 +3610,7 @@ void Interface_DrawMagicBar(PlayState* play) { if (gSaveContext.magicLevel != 0) { s16 X_Margins; s16 Y_Margins; - if (CVar_GetS32("gMagicBarUseMargins", 0) != 0) { + if (CVarGetInteger("gMagicBarUseMargins", 0) != 0) { X_Margins = Left_HUD_Margin; Y_Margins = (Top_HUD_Margin*-1); } else { @@ -3627,40 +3628,40 @@ void Interface_DrawMagicBar(PlayState* play) { s16 rMagicBarX; s16 PosX_MidEnd; s16 rMagicFillX; - s32 lineLength = CVar_GetS32("gHeartsLineLength", 10); - if (CVar_GetS32("gMagicBarPosType", 0) != 0) { - magicBarY = CVar_GetS32("gMagicBarPosY", 0)+Y_Margins; - if (CVar_GetS32("gMagicBarPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gMagicBarUseMargins", 0) != 0) {X_Margins = Left_HUD_Margin;}; - PosX_Start = OTRGetDimensionFromLeftEdge(CVar_GetS32("gMagicBarPosX", 0)+X_Margins); - rMagicBarX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gMagicBarPosX", 0)+X_Margins); - PosX_MidEnd = OTRGetDimensionFromLeftEdge(CVar_GetS32("gMagicBarPosX", 0)+X_Margins+8); - rMagicFillX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gMagicBarPosX", 0)+X_Margins+8); - } else if (CVar_GetS32("gMagicBarPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gMagicBarUseMargins", 0) != 0) {X_Margins = Right_HUD_Margin;}; - PosX_Start = OTRGetDimensionFromRightEdge(CVar_GetS32("gMagicBarPosX", 0)+X_Margins); - rMagicBarX = OTRGetDimensionFromRightEdge(CVar_GetS32("gMagicBarPosX", 0)+X_Margins); - PosX_MidEnd = OTRGetDimensionFromRightEdge(CVar_GetS32("gMagicBarPosX", 0)+X_Margins+8); - rMagicFillX = OTRGetDimensionFromRightEdge(CVar_GetS32("gMagicBarPosX", 0)+X_Margins+8); - } else if (CVar_GetS32("gMagicBarPosType", 0) == 3) {//Anchor None - PosX_Start = CVar_GetS32("gMagicBarPosX", 0)+X_Margins; - rMagicBarX = CVar_GetS32("gMagicBarPosX", 0)+X_Margins; - PosX_MidEnd = CVar_GetS32("gMagicBarPosX", 0)+X_Margins+8; - rMagicFillX = CVar_GetS32("gMagicBarPosX", 0)+X_Margins+8; - } else if (CVar_GetS32("gMagicBarPosType", 0) == 4) {//hidden + s32 lineLength = CVarGetInteger("gHeartsLineLength", 10); + if (CVarGetInteger("gMagicBarPosType", 0) != 0) { + magicBarY = CVarGetInteger("gMagicBarPosY", 0)+Y_Margins; + if (CVarGetInteger("gMagicBarPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gMagicBarUseMargins", 0) != 0) {X_Margins = Left_HUD_Margin;}; + PosX_Start = OTRGetDimensionFromLeftEdge(CVarGetInteger("gMagicBarPosX", 0)+X_Margins); + rMagicBarX = OTRGetDimensionFromLeftEdge(CVarGetInteger("gMagicBarPosX", 0)+X_Margins); + PosX_MidEnd = OTRGetDimensionFromLeftEdge(CVarGetInteger("gMagicBarPosX", 0)+X_Margins+8); + rMagicFillX = OTRGetDimensionFromLeftEdge(CVarGetInteger("gMagicBarPosX", 0)+X_Margins+8); + } else if (CVarGetInteger("gMagicBarPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gMagicBarUseMargins", 0) != 0) {X_Margins = Right_HUD_Margin;}; + PosX_Start = OTRGetDimensionFromRightEdge(CVarGetInteger("gMagicBarPosX", 0)+X_Margins); + rMagicBarX = OTRGetDimensionFromRightEdge(CVarGetInteger("gMagicBarPosX", 0)+X_Margins); + PosX_MidEnd = OTRGetDimensionFromRightEdge(CVarGetInteger("gMagicBarPosX", 0)+X_Margins+8); + rMagicFillX = OTRGetDimensionFromRightEdge(CVarGetInteger("gMagicBarPosX", 0)+X_Margins+8); + } else if (CVarGetInteger("gMagicBarPosType", 0) == 3) {//Anchor None + PosX_Start = CVarGetInteger("gMagicBarPosX", 0)+X_Margins; + rMagicBarX = CVarGetInteger("gMagicBarPosX", 0)+X_Margins; + PosX_MidEnd = CVarGetInteger("gMagicBarPosX", 0)+X_Margins+8; + rMagicFillX = CVarGetInteger("gMagicBarPosX", 0)+X_Margins+8; + } else if (CVarGetInteger("gMagicBarPosType", 0) == 4) {//hidden PosX_Start = -9999; rMagicBarX = -9999; PosX_MidEnd = -9999; rMagicFillX = -9999; - } else if (CVar_GetS32("gMagicBarPosType", 0) == 5) {//Anchor To life meter + } else if (CVarGetInteger("gMagicBarPosType", 0) == 5) {//Anchor To life meter magicBarY = R_MAGIC_BAR_SMALL_Y-2 + magicDrop*(lineLength == 0 ? 0 : (gSaveContext.healthCapacity-1)/(0x10*lineLength)) + - CVar_GetS32("gMagicBarPosY", 0) + getHealthMeterYOffset(); - s16 xPushover = CVar_GetS32("gMagicBarPosX", 0) + getHealthMeterXOffset() + R_MAGIC_BAR_X-1; + CVarGetInteger("gMagicBarPosY", 0) + getHealthMeterYOffset(); + s16 xPushover = CVarGetInteger("gMagicBarPosX", 0) + getHealthMeterXOffset() + R_MAGIC_BAR_X-1; PosX_Start = xPushover; rMagicBarX = xPushover; PosX_MidEnd = xPushover+8; - rMagicFillX = CVar_GetS32("gMagicBarPosX", 0) + getHealthMeterXOffset() + R_MAGIC_FILL_X-1; + rMagicFillX = CVarGetInteger("gMagicBarPosX", 0) + getHealthMeterXOffset() + R_MAGIC_FILL_X-1; } } else { if ((gSaveContext.healthCapacity-1)/0x10 >= lineLength && lineLength != 0) { @@ -3792,37 +3793,37 @@ void Interface_DrawItemButtons(PlayState* play) { s16 height; Color_RGB8 bButtonColor = { 0, 150, 0 }; - if (CVar_GetS32("gCosmetics.Hud_BButton.Changed", 0)) { - bButtonColor = CVar_GetRGB("gCosmetics.Hud_BButton.Value", bButtonColor); - } else if (CVar_GetS32("gCosmetics.DefaultColorScheme", 0)) { + if (CVarGetInteger("gCosmetics.Hud_BButton.Changed", 0)) { + bButtonColor = CVarGetColor24("gCosmetics.Hud_BButton.Value", bButtonColor); + } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", 0)) { bButtonColor = (Color_RGB8){ 255, 30, 30 }; } Color_RGB8 cButtonsColor = { 255, 160, 0 }; - if (CVar_GetS32("gCosmetics.Hud_CButtons.Changed", 0)) { - cButtonsColor = CVar_GetRGB("gCosmetics.Hud_CButtons.Value", cButtonsColor); + if (CVarGetInteger("gCosmetics.Hud_CButtons.Changed", 0)) { + cButtonsColor = CVarGetColor24("gCosmetics.Hud_CButtons.Value", cButtonsColor); } Color_RGB8 cUpButtonColor = cButtonsColor; - if (CVar_GetS32("gCosmetics.Hud_CUpButton.Changed", 0)) { - cUpButtonColor = CVar_GetRGB("gCosmetics.Hud_CUpButton.Value", cUpButtonColor); + if (CVarGetInteger("gCosmetics.Hud_CUpButton.Changed", 0)) { + cUpButtonColor = CVarGetColor24("gCosmetics.Hud_CUpButton.Value", cUpButtonColor); } Color_RGB8 cDownButtonColor = cButtonsColor; - if (CVar_GetS32("gCosmetics.Hud_CDownButton.Changed", 0)) { - cDownButtonColor = CVar_GetRGB("gCosmetics.Hud_CDownButton.Value", cDownButtonColor); + if (CVarGetInteger("gCosmetics.Hud_CDownButton.Changed", 0)) { + cDownButtonColor = CVarGetColor24("gCosmetics.Hud_CDownButton.Value", cDownButtonColor); } Color_RGB8 cLeftButtonColor = cButtonsColor; - if (CVar_GetS32("gCosmetics.Hud_CLeftButton.Changed", 0)) { - cLeftButtonColor = CVar_GetRGB("gCosmetics.Hud_CLeftButton.Value", cLeftButtonColor); + if (CVarGetInteger("gCosmetics.Hud_CLeftButton.Changed", 0)) { + cLeftButtonColor = CVarGetColor24("gCosmetics.Hud_CLeftButton.Value", cLeftButtonColor); } Color_RGB8 cRightButtonColor = cButtonsColor; - if (CVar_GetS32("gCosmetics.Hud_CRightButton.Changed", 0)) { - cRightButtonColor = CVar_GetRGB("gCosmetics.Hud_CRightButton.Value", cRightButtonColor); + if (CVarGetInteger("gCosmetics.Hud_CRightButton.Changed", 0)) { + cRightButtonColor = CVarGetColor24("gCosmetics.Hud_CRightButton.Value", cRightButtonColor); } Color_RGB8 startButtonColor = { 200, 0, 0 }; - if (CVar_GetS32("gCosmetics.Hud_StartButton.Changed", 0)) { - startButtonColor = CVar_GetRGB("gCosmetics.Hud_StartButton.Value", startButtonColor); - } else if (CVar_GetS32("gCosmetics.DefaultColorScheme", 0)) { + if (CVarGetInteger("gCosmetics.Hud_StartButton.Changed", 0)) { + startButtonColor = CVarGetColor24("gCosmetics.Hud_StartButton.Value", startButtonColor); + } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", 0)) { startButtonColor = (Color_RGB8){ 120, 120, 120 }; } @@ -3831,12 +3832,12 @@ void Interface_DrawItemButtons(PlayState* play) { s16 Y_Margins_BtnB; s16 BBtn_Size = 32; int BBtnScaled = BBtn_Size * 0.95f; - if (CVar_GetS32("gBBtnPosType", 0) != 0) { - BBtnScaled = BBtn_Size * CVar_GetFloat("gBBtnScale", 0.95f); + if (CVarGetInteger("gBBtnPosType", 0) != 0) { + BBtnScaled = BBtn_Size * CVarGetFloat("gBBtnScale", 0.95f); } int BBtn_factor = (1 << 10) * BBtn_Size / BBtnScaled; - if (CVar_GetS32("gBBtnUseMargins", 0) != 0) { - if (CVar_GetS32("gBBtnPosType", 0) == 0) {X_Margins_BtnB = Right_HUD_Margin;}; + if (CVarGetInteger("gBBtnUseMargins", 0) != 0) { + if (CVarGetInteger("gBBtnPosType", 0) == 0) {X_Margins_BtnB = Right_HUD_Margin;}; Y_Margins_BtnB = (Top_HUD_Margin*-1); } else { X_Margins_BtnB = 0; @@ -3846,17 +3847,17 @@ void Interface_DrawItemButtons(PlayState* play) { s16 PosY_BtnB_ori = R_ITEM_BTN_Y(0)+Y_Margins_BtnB; s16 PosX_BtnB; s16 PosY_BtnB; - if (CVar_GetS32("gBBtnPosType", 0) != 0) { - PosY_BtnB = CVar_GetS32("gBBtnPosY", 0)+Y_Margins_BtnB; - if (CVar_GetS32("gBBtnPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Left_HUD_Margin;}; - PosX_BtnB = OTRGetDimensionFromLeftEdge(CVar_GetS32("gBBtnPosX", 0)+X_Margins_BtnB); - } else if (CVar_GetS32("gBBtnPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Right_HUD_Margin;}; - PosX_BtnB = OTRGetDimensionFromRightEdge(CVar_GetS32("gBBtnPosX", 0)+X_Margins_BtnB); - } else if (CVar_GetS32("gBBtnPosType", 0) == 3) {//Anchor None - PosX_BtnB = CVar_GetS32("gBBtnPosX", 0); - } else if (CVar_GetS32("gBBtnPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gBBtnPosType", 0) != 0) { + PosY_BtnB = CVarGetInteger("gBBtnPosY", 0)+Y_Margins_BtnB; + if (CVarGetInteger("gBBtnPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Left_HUD_Margin;}; + PosX_BtnB = OTRGetDimensionFromLeftEdge(CVarGetInteger("gBBtnPosX", 0)+X_Margins_BtnB); + } else if (CVarGetInteger("gBBtnPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Right_HUD_Margin;}; + PosX_BtnB = OTRGetDimensionFromRightEdge(CVarGetInteger("gBBtnPosX", 0)+X_Margins_BtnB); + } else if (CVarGetInteger("gBBtnPosType", 0) == 3) {//Anchor None + PosX_BtnB = CVarGetInteger("gBBtnPosX", 0); + } else if (CVarGetInteger("gBBtnPosType", 0) == 4) {//Hidden PosX_BtnB = -9999; } } else { @@ -3866,8 +3867,8 @@ void Interface_DrawItemButtons(PlayState* play) { //Start Button s16 X_Margins_StartBtn; s16 Y_Margins_StartBtn; - if (CVar_GetS32("gStartBtnUseMargins", 0) != 0) { - if (CVar_GetS32("gStartBtnPosType", 0) == 0) { + if (CVarGetInteger("gStartBtnUseMargins", 0) != 0) { + if (CVarGetInteger("gStartBtnPosType", 0) == 0) { X_Margins_StartBtn = Right_HUD_Margin; }; Y_Margins_StartBtn = Top_HUD_Margin*-1; @@ -3878,8 +3879,8 @@ void Interface_DrawItemButtons(PlayState* play) { s16 StartBtn_Icon_H = 32; s16 StartBtn_Icon_W = 32; float Start_BTN_Scale = 0.75f; - if (CVar_GetS32("gStartBtnPosType", 0) != 0) { - Start_BTN_Scale = CVar_GetFloat("gStartBtnScale", 0.75f); + if (CVarGetInteger("gStartBtnPosType", 0) != 0) { + Start_BTN_Scale = CVarGetFloat("gStartBtnScale", 0.75f); } int StartBTN_H_Scaled = StartBtn_Icon_H * Start_BTN_Scale; int StartBTN_W_Scaled = StartBtn_Icon_W * Start_BTN_Scale; @@ -3891,17 +3892,17 @@ void Interface_DrawItemButtons(PlayState* play) { s16 StartBTN_Label_H = DO_ACTION_TEX_HEIGHT(); s16 PosX_StartBtn; s16 PosY_StartBtn; - if (CVar_GetS32("gStartBtnPosType", 0) != 0) { - PosY_StartBtn = CVar_GetS32("gStartBtnPosY", 0)-(Start_BTN_Scale*13)+Y_Margins_StartBtn; - if (CVar_GetS32("gStartBtnPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gStartBtnUseMargins", 0) != 0) {X_Margins_StartBtn = Left_HUD_Margin;}; - PosX_StartBtn = OTRGetDimensionFromLeftEdge(CVar_GetS32("gStartBtnPosX", 0)-(Start_BTN_Scale*13)+X_Margins_StartBtn); - } else if (CVar_GetS32("gStartBtnPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gStartBtnUseMargins", 0) != 0) {X_Margins_StartBtn = Right_HUD_Margin;}; - PosX_StartBtn = OTRGetDimensionFromRightEdge(CVar_GetS32("gStartBtnPosX", 0)-(Start_BTN_Scale*13)+X_Margins_StartBtn); - } else if (CVar_GetS32("gStartBtnPosType", 0) == 3) {//Anchor None - PosX_StartBtn = CVar_GetS32("gStartBtnPosX", 0); - } else if (CVar_GetS32("gStartBtnPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gStartBtnPosType", 0) != 0) { + PosY_StartBtn = CVarGetInteger("gStartBtnPosY", 0)-(Start_BTN_Scale*13)+Y_Margins_StartBtn; + if (CVarGetInteger("gStartBtnPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gStartBtnUseMargins", 0) != 0) {X_Margins_StartBtn = Left_HUD_Margin;}; + PosX_StartBtn = OTRGetDimensionFromLeftEdge(CVarGetInteger("gStartBtnPosX", 0)-(Start_BTN_Scale*13)+X_Margins_StartBtn); + } else if (CVarGetInteger("gStartBtnPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gStartBtnUseMargins", 0) != 0) {X_Margins_StartBtn = Right_HUD_Margin;}; + PosX_StartBtn = OTRGetDimensionFromRightEdge(CVarGetInteger("gStartBtnPosX", 0)-(Start_BTN_Scale*13)+X_Margins_StartBtn); + } else if (CVarGetInteger("gStartBtnPosType", 0) == 3) {//Anchor None + PosX_StartBtn = CVarGetInteger("gStartBtnPosX", 0); + } else if (CVarGetInteger("gStartBtnPosType", 0) == 4) {//Hidden PosX_StartBtn = -9999; } } else { @@ -3921,29 +3922,29 @@ void Interface_DrawItemButtons(PlayState* play) { s16 Y_Margins_CR; s16 Y_Margins_CU; s16 Y_Margins_CD; - if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) { - if (CVar_GetS32("gCBtnLPosType", 0) == 0) {X_Margins_CL = Right_HUD_Margin;}; + if (CVarGetInteger("gCBtnLUseMargins", 0) != 0) { + if (CVarGetInteger("gCBtnLPosType", 0) == 0) {X_Margins_CL = Right_HUD_Margin;}; Y_Margins_CL = (Top_HUD_Margin*-1); } else { X_Margins_CL = 0; Y_Margins_CL = 0; } - if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) { - if (CVar_GetS32("gCBtnRPosType", 0) == 0) {X_Margins_CR = Right_HUD_Margin;}; + if (CVarGetInteger("gCBtnRUseMargins", 0) != 0) { + if (CVarGetInteger("gCBtnRPosType", 0) == 0) {X_Margins_CR = Right_HUD_Margin;}; Y_Margins_CR = (Top_HUD_Margin*-1); } else { X_Margins_CR = 0; Y_Margins_CR = 0; } - if (CVar_GetS32("gCBtnUUseMargins", 0) != 0) { - if (CVar_GetS32("gCBtnUPosType", 0) == 0) {X_Margins_CU = Right_HUD_Margin;}; + if (CVarGetInteger("gCBtnUUseMargins", 0) != 0) { + if (CVarGetInteger("gCBtnUPosType", 0) == 0) {X_Margins_CU = Right_HUD_Margin;}; Y_Margins_CU = (Top_HUD_Margin*-1); } else { X_Margins_CU = 0; Y_Margins_CU = 0; } - if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) { - if (CVar_GetS32("gCBtnDPosType", 0) == 0) {X_Margins_CD = Right_HUD_Margin;}; + if (CVarGetInteger("gCBtnDUseMargins", 0) != 0) { + if (CVarGetInteger("gCBtnDPosType", 0) == 0) {X_Margins_CD = Right_HUD_Margin;}; Y_Margins_CD = (Top_HUD_Margin*-1); } else { X_Margins_CD = 0; @@ -3953,7 +3954,7 @@ void Interface_DrawItemButtons(PlayState* play) { const s16 C_Right_BTN_Pos_ori[] = { C_RIGHT_BUTTON_X+X_Margins_CR, C_RIGHT_BUTTON_Y+Y_Margins_CR }; const s16 C_Up_BTN_Pos_ori[] = { C_UP_BUTTON_X+X_Margins_CU, C_UP_BUTTON_Y+Y_Margins_CU }; const s16 C_Down_BTN_Pos_ori[] = { C_DOWN_BUTTON_X+X_Margins_CD, C_DOWN_BUTTON_Y+Y_Margins_CD }; - s16 LabelX_Navi=7 + !!CVar_GetS32("gNaviTextFix", 0); + s16 LabelX_Navi=7 + !!CVarGetInteger("gNaviTextFix", 0); s16 LabelY_Navi=4; s16 C_Left_BTN_Pos[2]; //(X,Y) s16 C_Right_BTN_Pos[2]; @@ -3961,23 +3962,23 @@ void Interface_DrawItemButtons(PlayState* play) { s16 C_Down_BTN_Pos[2]; //C button Left s16 C_Left_BTN_Size = 32; - float CLeftScale = CVar_GetFloat("gCBtnLScale", 0.87f); + float CLeftScale = CVarGetFloat("gCBtnLScale", 0.87f); int CLeftScaled = C_Left_BTN_Size * 0.87f; - if (CVar_GetS32("gCBtnLPosType", 0) != 0) { + if (CVarGetInteger("gCBtnLPosType", 0) != 0) { CLeftScaled = C_Left_BTN_Size * CLeftScale; } int CLeft_factor = (1 << 10) * C_Left_BTN_Size / CLeftScaled; - if (CVar_GetS32("gCBtnLPosType", 0) != 0) { - C_Left_BTN_Pos[1] = CVar_GetS32("gCBtnLPosY", 0)+Y_Margins_CL; - if (CVar_GetS32("gCBtnLPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Left_HUD_Margin;}; - C_Left_BTN_Pos[0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL); - } else if (CVar_GetS32("gCBtnLPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Right_HUD_Margin;}; - C_Left_BTN_Pos[0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL); - } else if (CVar_GetS32("gCBtnLPosType", 0) == 3) {//Anchor None - C_Left_BTN_Pos[0] = CVar_GetS32("gCBtnLPosX", 0); - } else if (CVar_GetS32("gCBtnLPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gCBtnLPosType", 0) != 0) { + C_Left_BTN_Pos[1] = CVarGetInteger("gCBtnLPosY", 0)+Y_Margins_CL; + if (CVarGetInteger("gCBtnLPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Left_HUD_Margin;}; + C_Left_BTN_Pos[0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCBtnLPosX", 0)+X_Margins_CL); + } else if (CVarGetInteger("gCBtnLPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Right_HUD_Margin;}; + C_Left_BTN_Pos[0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gCBtnLPosX", 0)+X_Margins_CL); + } else if (CVarGetInteger("gCBtnLPosType", 0) == 3) {//Anchor None + C_Left_BTN_Pos[0] = CVarGetInteger("gCBtnLPosX", 0); + } else if (CVarGetInteger("gCBtnLPosType", 0) == 4) {//Hidden C_Left_BTN_Pos[0] = -9999; } } else { @@ -3986,23 +3987,23 @@ void Interface_DrawItemButtons(PlayState* play) { } //C button Right s16 C_Right_BTN_Size = 32; - float CRightScale = CVar_GetFloat("gCBtnRScale", 0.87f); + float CRightScale = CVarGetFloat("gCBtnRScale", 0.87f); int CRightScaled = C_Right_BTN_Size * 0.87f; - if (CVar_GetS32("gCBtnRPosType", 0) != 0) { + if (CVarGetInteger("gCBtnRPosType", 0) != 0) { CRightScaled = C_Right_BTN_Size * CRightScale; } int CRight_factor = (1 << 10) * C_Right_BTN_Size / CRightScaled; - if (CVar_GetS32("gCBtnRPosType", 0) != 0) { - C_Right_BTN_Pos[1] = CVar_GetS32("gCBtnRPosY", 0)+Y_Margins_CR; - if (CVar_GetS32("gCBtnRPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Left_HUD_Margin;}; - C_Right_BTN_Pos[0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR); - } else if (CVar_GetS32("gCBtnRPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Right_HUD_Margin;}; - C_Right_BTN_Pos[0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR); - } else if (CVar_GetS32("gCBtnRPosType", 0) == 3) {//Anchor None - C_Right_BTN_Pos[0] = CVar_GetS32("gCBtnRPosX", 0); - } else if (CVar_GetS32("gCBtnRPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gCBtnRPosType", 0) != 0) { + C_Right_BTN_Pos[1] = CVarGetInteger("gCBtnRPosY", 0)+Y_Margins_CR; + if (CVarGetInteger("gCBtnRPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Left_HUD_Margin;}; + C_Right_BTN_Pos[0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCBtnRPosX", 0)+X_Margins_CR); + } else if (CVarGetInteger("gCBtnRPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Right_HUD_Margin;}; + C_Right_BTN_Pos[0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gCBtnRPosX", 0)+X_Margins_CR); + } else if (CVarGetInteger("gCBtnRPosType", 0) == 3) {//Anchor None + C_Right_BTN_Pos[0] = CVarGetInteger("gCBtnRPosX", 0); + } else if (CVarGetInteger("gCBtnRPosType", 0) == 4) {//Hidden C_Right_BTN_Pos[0] = -9999; } } else { @@ -4012,22 +4013,22 @@ void Interface_DrawItemButtons(PlayState* play) { //C Button Up s16 C_Up_BTN_Size = 32; int CUpScaled = C_Up_BTN_Size * 0.5f; - float CUpScale = CVar_GetFloat("gCBtnUScale", 0.5f); - if (CVar_GetS32("gCBtnUPosType", 0) != 0) { + float CUpScale = CVarGetFloat("gCBtnUScale", 0.5f); + if (CVarGetInteger("gCBtnUPosType", 0) != 0) { CUpScaled = C_Up_BTN_Size * CUpScale; } int CUp_factor = (1 << 10) * C_Up_BTN_Size / CUpScaled; - if (CVar_GetS32("gCBtnUPosType", 0) != 0) { - C_Up_BTN_Pos[1] = CVar_GetS32("gCBtnUPosY", 0)+Y_Margins_CU; - if (CVar_GetS32("gCBtnUPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCBtnUUseMargins", 0) != 0) {X_Margins_CU = Left_HUD_Margin;}; - C_Up_BTN_Pos[0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnUPosX", 0)+X_Margins_CU); - } else if (CVar_GetS32("gCBtnUPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCBtnUUseMargins", 0) != 0) {X_Margins_CU = Right_HUD_Margin;}; - C_Up_BTN_Pos[0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnUPosX", 0)+X_Margins_CU); - } else if (CVar_GetS32("gCBtnUPosType", 0) == 3) {//Anchor None - C_Up_BTN_Pos[0] = CVar_GetS32("gCBtnUPosX", 0); - } else if (CVar_GetS32("gCBtnUPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gCBtnUPosType", 0) != 0) { + C_Up_BTN_Pos[1] = CVarGetInteger("gCBtnUPosY", 0)+Y_Margins_CU; + if (CVarGetInteger("gCBtnUPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCBtnUUseMargins", 0) != 0) {X_Margins_CU = Left_HUD_Margin;}; + C_Up_BTN_Pos[0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCBtnUPosX", 0)+X_Margins_CU); + } else if (CVarGetInteger("gCBtnUPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCBtnUUseMargins", 0) != 0) {X_Margins_CU = Right_HUD_Margin;}; + C_Up_BTN_Pos[0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gCBtnUPosX", 0)+X_Margins_CU); + } else if (CVarGetInteger("gCBtnUPosType", 0) == 3) {//Anchor None + C_Up_BTN_Pos[0] = CVarGetInteger("gCBtnUPosX", 0); + } else if (CVarGetInteger("gCBtnUPosType", 0) == 4) {//Hidden C_Up_BTN_Pos[0] = -9999; } } else { @@ -4036,24 +4037,24 @@ void Interface_DrawItemButtons(PlayState* play) { } //C Button down s16 C_Down_BTN_Size = 32; - float CDownScale = CVar_GetFloat("gCBtnDScale", 0.87f); - if (CVar_GetS32("gCBtnDPosType", 0) == 0) { + float CDownScale = CVarGetFloat("gCBtnDScale", 0.87f); + if (CVarGetInteger("gCBtnDPosType", 0) == 0) { CDownScale = 0.87f; } int CDownScaled = C_Down_BTN_Size * CDownScale; int CDown_factor = (1 << 10) * C_Down_BTN_Size / CDownScaled; int PositionAdjustment = CDownScaled/2; - if (CVar_GetS32("gCBtnDPosType", 0) != 0) { - C_Down_BTN_Pos[1] = CVar_GetS32("gCBtnDPosY", 0)+Y_Margins_CD; - if (CVar_GetS32("gCBtnDPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Left_HUD_Margin;}; - C_Down_BTN_Pos[0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD); - } else if (CVar_GetS32("gCBtnDPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Right_HUD_Margin;}; - C_Down_BTN_Pos[0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD); - } else if (CVar_GetS32("gCBtnDPosType", 0) == 3) {//Anchor None - C_Down_BTN_Pos[0] = CVar_GetS32("gCBtnDPosX", 0); - } else if (CVar_GetS32("gCBtnDPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gCBtnDPosType", 0) != 0) { + C_Down_BTN_Pos[1] = CVarGetInteger("gCBtnDPosY", 0)+Y_Margins_CD; + if (CVarGetInteger("gCBtnDPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Left_HUD_Margin;}; + C_Down_BTN_Pos[0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCBtnDPosX", 0)+X_Margins_CD); + } else if (CVarGetInteger("gCBtnDPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Right_HUD_Margin;}; + C_Down_BTN_Pos[0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gCBtnDPosX", 0)+X_Margins_CD); + } else if (CVarGetInteger("gCBtnDPosType", 0) == 3) {//Anchor None + C_Down_BTN_Pos[0] = CVarGetInteger("gCBtnDPosX", 0); + } else if (CVarGetInteger("gCBtnDPosType", 0) == 4) {//Hidden C_Down_BTN_Pos[0] = -9999; } } else { @@ -4127,7 +4128,7 @@ void Interface_DrawItemButtons(PlayState* play) { doAction = newName; } - memcpy(interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE() * 2, ResourceMgr_LoadTexByName(doAction), DO_ACTION_TEX_SIZE()); + memcpy(interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE() * 2, GetResourceDataByName(doAction, false), DO_ACTION_TEX_SIZE()); gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE() * 2, G_IM_FMT_IA, DO_ACTION_TEX_WIDTH(), DO_ACTION_TEX_HEIGHT(), 0, G_TX_NOMIRROR | G_TX_WRAP, @@ -4201,22 +4202,22 @@ void Interface_DrawItemButtons(PlayState* play) { s16 Y_Margins_CL; s16 Y_Margins_CR; s16 Y_Margins_CD; - if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) { - if (CVar_GetS32("gCBtnLPosType", 0) == 0) {X_Margins_CL = Right_HUD_Margin;}; + if (CVarGetInteger("gCBtnLUseMargins", 0) != 0) { + if (CVarGetInteger("gCBtnLPosType", 0) == 0) {X_Margins_CL = Right_HUD_Margin;}; Y_Margins_CL = (Top_HUD_Margin*-1); } else { X_Margins_CL = 0; Y_Margins_CL = 0; } - if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) { - if (CVar_GetS32("gCBtnRPosType", 0) == 0) {X_Margins_CR = Right_HUD_Margin;}; + if (CVarGetInteger("gCBtnRUseMargins", 0) != 0) { + if (CVarGetInteger("gCBtnRPosType", 0) == 0) {X_Margins_CR = Right_HUD_Margin;}; Y_Margins_CR = (Top_HUD_Margin*-1); } else { X_Margins_CR = 0; Y_Margins_CR = 0; } - if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) { - if (CVar_GetS32("gCBtnDPosType", 0) == 0) {X_Margins_CD = Right_HUD_Margin;}; + if (CVarGetInteger("gCBtnDUseMargins", 0) != 0) { + if (CVarGetInteger("gCBtnDPosType", 0) == 0) {X_Margins_CD = Right_HUD_Margin;}; Y_Margins_CD = (Top_HUD_Margin*-1); } else { X_Margins_CD = 0; @@ -4234,17 +4235,17 @@ void Interface_DrawItemButtons(PlayState* play) { }; s16 ItemIconPos[3][2]; //(X,Y) //C button Left - if (CVar_GetS32("gCBtnLPosType", 0) != 0) { - ItemIconPos[0][1] = CVar_GetS32("gCBtnLPosY", 0)+Y_Margins_CL; - if (CVar_GetS32("gCBtnLPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Left_HUD_Margin;}; - ItemIconPos[0][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL); - } else if (CVar_GetS32("gCBtnLPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Right_HUD_Margin;}; - ItemIconPos[0][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL); - } else if (CVar_GetS32("gCBtnLPosType", 0) == 3) {//Anchor None - ItemIconPos[0][0] = CVar_GetS32("gCBtnLPosX", 0); - } else if (CVar_GetS32("gCBtnLPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gCBtnLPosType", 0) != 0) { + ItemIconPos[0][1] = CVarGetInteger("gCBtnLPosY", 0)+Y_Margins_CL; + if (CVarGetInteger("gCBtnLPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Left_HUD_Margin;}; + ItemIconPos[0][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCBtnLPosX", 0)+X_Margins_CL); + } else if (CVarGetInteger("gCBtnLPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Right_HUD_Margin;}; + ItemIconPos[0][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gCBtnLPosX", 0)+X_Margins_CL); + } else if (CVarGetInteger("gCBtnLPosType", 0) == 3) {//Anchor None + ItemIconPos[0][0] = CVarGetInteger("gCBtnLPosX", 0); + } else if (CVarGetInteger("gCBtnLPosType", 0) == 4) {//Hidden ItemIconPos[0][0] = -9999; } } else { @@ -4252,17 +4253,17 @@ void Interface_DrawItemButtons(PlayState* play) { ItemIconPos[0][1] = ItemIconPos_ori[0][1]; } //C Button down - if (CVar_GetS32("gCBtnDPosType", 0) != 0) { - ItemIconPos[1][1] = CVar_GetS32("gCBtnDPosY", 0)+Y_Margins_CD; - if (CVar_GetS32("gCBtnDPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Left_HUD_Margin;}; - ItemIconPos[1][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD); - } else if (CVar_GetS32("gCBtnDPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Right_HUD_Margin;}; - ItemIconPos[1][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD); - } else if (CVar_GetS32("gCBtnDPosType", 0) == 3) {//Anchor None - ItemIconPos[1][0] = CVar_GetS32("gCBtnDPosX", 0); - } else if (CVar_GetS32("gCBtnDPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gCBtnDPosType", 0) != 0) { + ItemIconPos[1][1] = CVarGetInteger("gCBtnDPosY", 0)+Y_Margins_CD; + if (CVarGetInteger("gCBtnDPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Left_HUD_Margin;}; + ItemIconPos[1][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCBtnDPosX", 0)+X_Margins_CD); + } else if (CVarGetInteger("gCBtnDPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Right_HUD_Margin;}; + ItemIconPos[1][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gCBtnDPosX", 0)+X_Margins_CD); + } else if (CVarGetInteger("gCBtnDPosType", 0) == 3) {//Anchor None + ItemIconPos[1][0] = CVarGetInteger("gCBtnDPosX", 0); + } else if (CVarGetInteger("gCBtnDPosType", 0) == 4) {//Hidden ItemIconPos[1][0] = -9999; } } else { @@ -4270,17 +4271,17 @@ void Interface_DrawItemButtons(PlayState* play) { ItemIconPos[1][1] = ItemIconPos_ori[1][1]; } //C button Right - if (CVar_GetS32("gCBtnRPosType", 0) != 0) { - ItemIconPos[2][1] = CVar_GetS32("gCBtnRPosY", 0)+Y_Margins_CR; - if (CVar_GetS32("gCBtnRPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Left_HUD_Margin;}; - ItemIconPos[2][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR); - } else if (CVar_GetS32("gCBtnRPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Right_HUD_Margin;}; - ItemIconPos[2][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR); - } else if (CVar_GetS32("gCBtnRPosType", 0) == 3) {//Anchor None - ItemIconPos[2][0] = CVar_GetS32("gCBtnRPosX", 0); - } else if (CVar_GetS32("gCBtnRPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gCBtnRPosType", 0) != 0) { + ItemIconPos[2][1] = CVarGetInteger("gCBtnRPosY", 0)+Y_Margins_CR; + if (CVarGetInteger("gCBtnRPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Left_HUD_Margin;}; + ItemIconPos[2][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCBtnRPosX", 0)+X_Margins_CR); + } else if (CVarGetInteger("gCBtnRPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Right_HUD_Margin;}; + ItemIconPos[2][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gCBtnRPosX", 0)+X_Margins_CR); + } else if (CVarGetInteger("gCBtnRPosType", 0) == 3) {//Anchor None + ItemIconPos[2][0] = CVarGetInteger("gCBtnRPosX", 0); + } else if (CVarGetInteger("gCBtnRPosType", 0) == 4) {//Hidden ItemIconPos[2][0] = -9999; } } else { @@ -4330,36 +4331,36 @@ void Interface_DrawItemIconTexture(PlayState* play, void* texture, s16 button) { s16 Y_Margins_BtnB; s16 X_Margins_DPad_Items; s16 Y_Margins_DPad_Items; - if (CVar_GetS32("gBBtnUseMargins", 0) != 0) { - if (CVar_GetS32("gBBtnPosType", 0) == 0) {X_Margins_BtnB = Right_HUD_Margin;}; + if (CVarGetInteger("gBBtnUseMargins", 0) != 0) { + if (CVarGetInteger("gBBtnPosType", 0) == 0) {X_Margins_BtnB = Right_HUD_Margin;}; Y_Margins_BtnB = (Top_HUD_Margin*-1); } else { X_Margins_BtnB = 0; Y_Margins_BtnB = 0; } - if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) { - if (CVar_GetS32("gCBtnLPosType", 0) == 0) {X_Margins_CL = Right_HUD_Margin;}; + if (CVarGetInteger("gCBtnLUseMargins", 0) != 0) { + if (CVarGetInteger("gCBtnLPosType", 0) == 0) {X_Margins_CL = Right_HUD_Margin;}; Y_Margins_CL = (Top_HUD_Margin*-1); } else { X_Margins_CL = 0; Y_Margins_CL = 0; } - if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) { - if (CVar_GetS32("gCBtnRPosType", 0) == 0) {X_Margins_CR = Right_HUD_Margin;}; + if (CVarGetInteger("gCBtnRUseMargins", 0) != 0) { + if (CVarGetInteger("gCBtnRPosType", 0) == 0) {X_Margins_CR = Right_HUD_Margin;}; Y_Margins_CR = (Top_HUD_Margin*-1); } else { X_Margins_CR = 0; Y_Margins_CR = 0; } - if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) { - if (CVar_GetS32("gCBtnDPosType", 0) == 0) {X_Margins_CD = Right_HUD_Margin;}; + if (CVarGetInteger("gCBtnDUseMargins", 0) != 0) { + if (CVarGetInteger("gCBtnDPosType", 0) == 0) {X_Margins_CD = Right_HUD_Margin;}; Y_Margins_CD = (Top_HUD_Margin*-1); } else { X_Margins_CD = 0; Y_Margins_CD = 0; } - if (CVar_GetS32("gDPadUseMargins", 0) != 0) { - if (CVar_GetS32("gDPadPosType", 0) == 0) {X_Margins_DPad_Items = Right_HUD_Margin;}; + if (CVarGetInteger("gDPadUseMargins", 0) != 0) { + if (CVarGetInteger("gDPadPosType", 0) == 0) {X_Margins_DPad_Items = Right_HUD_Margin;}; Y_Margins_DPad_Items = (Top_HUD_Margin*-1); } else { X_Margins_DPad_Items = 0; @@ -4393,29 +4394,29 @@ void Interface_DrawItemIconTexture(PlayState* play, void* texture, s16 button) { }; //(X,Y) Used with custom position to place it properly. s16 ItemIconPos[8][2]; //(X,Y) //DPadItems - if (CVar_GetS32("gDPadPosType", 0) != 0) { - ItemIconPos[4][1] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[0][1];//Up - ItemIconPos[5][1] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[1][1];//Down - ItemIconPos[6][1] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[2][1];//Left - ItemIconPos[7][1] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[3][1];//Right - if (CVar_GetS32("gDPadPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gDPadUseMargins", 0) != 0) {X_Margins_DPad_Items = Left_HUD_Margin;}; - ItemIconPos[4][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[0][0]); - ItemIconPos[5][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[1][0]); - ItemIconPos[6][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[2][0]); - ItemIconPos[7][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[3][0]); - } else if (CVar_GetS32("gDPadPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gDPadUseMargins", 0) != 0) {X_Margins_DPad_Items = Right_HUD_Margin;}; - ItemIconPos[4][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[0][0]); - ItemIconPos[5][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[1][0]); - ItemIconPos[6][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[2][0]); - ItemIconPos[7][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[3][0]); - } else if (CVar_GetS32("gDPadPosType", 0) == 3) {//Anchor None - ItemIconPos[4][0] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[0][0]; - ItemIconPos[5][0] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[1][0]; - ItemIconPos[6][0] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[2][0]; - ItemIconPos[7][0] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[3][0]; - } else if (CVar_GetS32("gDPadPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gDPadPosType", 0) != 0) { + ItemIconPos[4][1] = CVarGetInteger("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[0][1];//Up + ItemIconPos[5][1] = CVarGetInteger("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[1][1];//Down + ItemIconPos[6][1] = CVarGetInteger("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[2][1];//Left + ItemIconPos[7][1] = CVarGetInteger("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[3][1];//Right + if (CVarGetInteger("gDPadPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gDPadUseMargins", 0) != 0) {X_Margins_DPad_Items = Left_HUD_Margin;}; + ItemIconPos[4][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[0][0]); + ItemIconPos[5][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[1][0]); + ItemIconPos[6][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[2][0]); + ItemIconPos[7][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[3][0]); + } else if (CVarGetInteger("gDPadPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gDPadUseMargins", 0) != 0) {X_Margins_DPad_Items = Right_HUD_Margin;}; + ItemIconPos[4][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[0][0]); + ItemIconPos[5][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[1][0]); + ItemIconPos[6][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[2][0]); + ItemIconPos[7][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[3][0]); + } else if (CVarGetInteger("gDPadPosType", 0) == 3) {//Anchor None + ItemIconPos[4][0] = CVarGetInteger("gDPadPosX", 0)+DPad_ItemsOffset[0][0]; + ItemIconPos[5][0] = CVarGetInteger("gDPadPosX", 0)+DPad_ItemsOffset[1][0]; + ItemIconPos[6][0] = CVarGetInteger("gDPadPosX", 0)+DPad_ItemsOffset[2][0]; + ItemIconPos[7][0] = CVarGetInteger("gDPadPosX", 0)+DPad_ItemsOffset[3][0]; + } else if (CVarGetInteger("gDPadPosType", 0) == 4) {//Hidden ItemIconPos[4][0] = -9999; ItemIconPos[5][0] = -9999; ItemIconPos[6][0] = -9999; @@ -4432,17 +4433,17 @@ void Interface_DrawItemIconTexture(PlayState* play, void* texture, s16 button) { ItemIconPos[7][1] = ItemIconPos_ori[7][1]; } //B Button - if (CVar_GetS32("gBBtnPosType", 0) != 0) { - ItemIconPos[0][1] = CVar_GetS32("gBBtnPosY", 0)+Y_Margins_BtnB; - if (CVar_GetS32("gBBtnPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Left_HUD_Margin;}; - ItemIconPos[0][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gBBtnPosX", 0)+X_Margins_BtnB); - } else if (CVar_GetS32("gBBtnPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Right_HUD_Margin;}; - ItemIconPos[0][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gBBtnPosX", 0)+X_Margins_BtnB); - } else if (CVar_GetS32("gBBtnPosType", 0) == 3) {//Anchor None - ItemIconPos[0][0] = CVar_GetS32("gBBtnPosX", 0); - } else if (CVar_GetS32("gBBtnPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gBBtnPosType", 0) != 0) { + ItemIconPos[0][1] = CVarGetInteger("gBBtnPosY", 0)+Y_Margins_BtnB; + if (CVarGetInteger("gBBtnPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Left_HUD_Margin;}; + ItemIconPos[0][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gBBtnPosX", 0)+X_Margins_BtnB); + } else if (CVarGetInteger("gBBtnPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Right_HUD_Margin;}; + ItemIconPos[0][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gBBtnPosX", 0)+X_Margins_BtnB); + } else if (CVarGetInteger("gBBtnPosType", 0) == 3) {//Anchor None + ItemIconPos[0][0] = CVarGetInteger("gBBtnPosX", 0); + } else if (CVarGetInteger("gBBtnPosType", 0) == 4) {//Hidden ItemIconPos[0][0] = -9999; } } else { @@ -4450,17 +4451,17 @@ void Interface_DrawItemIconTexture(PlayState* play, void* texture, s16 button) { ItemIconPos[0][1] = ItemIconPos_ori[0][1]; } //C button Left - if (CVar_GetS32("gCBtnLPosType", 0) != 0) { - ItemIconPos[1][1] = CVar_GetS32("gCBtnLPosY", 0)+Y_Margins_CL; - if (CVar_GetS32("gCBtnLPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Left_HUD_Margin;}; - ItemIconPos[1][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL); - } else if (CVar_GetS32("gCBtnLPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Right_HUD_Margin;}; - ItemIconPos[1][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL); - } else if (CVar_GetS32("gCBtnLPosType", 0) == 3) {//Anchor None - ItemIconPos[1][0] = CVar_GetS32("gCBtnLPosX", 0); - } else if (CVar_GetS32("gCBtnLPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gCBtnLPosType", 0) != 0) { + ItemIconPos[1][1] = CVarGetInteger("gCBtnLPosY", 0)+Y_Margins_CL; + if (CVarGetInteger("gCBtnLPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Left_HUD_Margin;}; + ItemIconPos[1][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCBtnLPosX", 0)+X_Margins_CL); + } else if (CVarGetInteger("gCBtnLPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Right_HUD_Margin;}; + ItemIconPos[1][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gCBtnLPosX", 0)+X_Margins_CL); + } else if (CVarGetInteger("gCBtnLPosType", 0) == 3) {//Anchor None + ItemIconPos[1][0] = CVarGetInteger("gCBtnLPosX", 0); + } else if (CVarGetInteger("gCBtnLPosType", 0) == 4) {//Hidden ItemIconPos[1][0] = -9999; } } else { @@ -4468,17 +4469,17 @@ void Interface_DrawItemIconTexture(PlayState* play, void* texture, s16 button) { ItemIconPos[1][1] = ItemIconPos_ori[1][1]; } //C Button down - if (CVar_GetS32("gCBtnDPosType", 0) != 0) { - ItemIconPos[2][1] = CVar_GetS32("gCBtnDPosY", 0)+Y_Margins_CD; - if (CVar_GetS32("gCBtnDPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Left_HUD_Margin;}; - ItemIconPos[2][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD); - } else if (CVar_GetS32("gCBtnDPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Right_HUD_Margin;}; - ItemIconPos[2][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD); - } else if (CVar_GetS32("gCBtnDPosType", 0) == 3) {//Anchor None - ItemIconPos[2][0] = CVar_GetS32("gCBtnDPosX", 0); - } else if (CVar_GetS32("gCBtnDPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gCBtnDPosType", 0) != 0) { + ItemIconPos[2][1] = CVarGetInteger("gCBtnDPosY", 0)+Y_Margins_CD; + if (CVarGetInteger("gCBtnDPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Left_HUD_Margin;}; + ItemIconPos[2][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCBtnDPosX", 0)+X_Margins_CD); + } else if (CVarGetInteger("gCBtnDPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Right_HUD_Margin;}; + ItemIconPos[2][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gCBtnDPosX", 0)+X_Margins_CD); + } else if (CVarGetInteger("gCBtnDPosType", 0) == 3) {//Anchor None + ItemIconPos[2][0] = CVarGetInteger("gCBtnDPosX", 0); + } else if (CVarGetInteger("gCBtnDPosType", 0) == 4) {//Hidden ItemIconPos[2][0] = -9999; } } else { @@ -4486,17 +4487,17 @@ void Interface_DrawItemIconTexture(PlayState* play, void* texture, s16 button) { ItemIconPos[2][1] = ItemIconPos_ori[2][1]; } //C button Right - if (CVar_GetS32("gCBtnRPosType", 0) != 0) { - ItemIconPos[3][1] = CVar_GetS32("gCBtnRPosY", 0)+Y_Margins_CR; - if (CVar_GetS32("gCBtnRPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Left_HUD_Margin;}; - ItemIconPos[3][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR); - } else if (CVar_GetS32("gCBtnRPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Right_HUD_Margin;}; - ItemIconPos[3][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR); - } else if (CVar_GetS32("gCBtnRPosType", 0) == 3) {//Anchor None - ItemIconPos[3][0] = CVar_GetS32("gCBtnRPosX", 0); - } else if (CVar_GetS32("gCBtnRPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gCBtnRPosType", 0) != 0) { + ItemIconPos[3][1] = CVarGetInteger("gCBtnRPosY", 0)+Y_Margins_CR; + if (CVarGetInteger("gCBtnRPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Left_HUD_Margin;}; + ItemIconPos[3][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCBtnRPosX", 0)+X_Margins_CR); + } else if (CVarGetInteger("gCBtnRPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Right_HUD_Margin;}; + ItemIconPos[3][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gCBtnRPosX", 0)+X_Margins_CR); + } else if (CVarGetInteger("gCBtnRPosType", 0) == 3) {//Anchor None + ItemIconPos[3][0] = CVarGetInteger("gCBtnRPosX", 0); + } else if (CVarGetInteger("gCBtnRPosType", 0) == 4) {//Hidden ItemIconPos[3][0] = -9999; } } else { @@ -4539,36 +4540,36 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { s16 Y_Margins_BtnB; s16 X_Margins_DPad_Items; s16 Y_Margins_DPad_Items; - if (CVar_GetS32("gBBtnUseMargins", 0) != 0) { - if (CVar_GetS32("gBBtnPosType", 0) == 0) {X_Margins_BtnB = Right_HUD_Margin;}; + if (CVarGetInteger("gBBtnUseMargins", 0) != 0) { + if (CVarGetInteger("gBBtnPosType", 0) == 0) {X_Margins_BtnB = Right_HUD_Margin;}; Y_Margins_BtnB = (Top_HUD_Margin*-1); } else { X_Margins_BtnB = 0; Y_Margins_BtnB = 0; } - if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) { - if (CVar_GetS32("gCBtnLPosType", 0) == 0) {X_Margins_CL = Right_HUD_Margin;}; + if (CVarGetInteger("gCBtnLUseMargins", 0) != 0) { + if (CVarGetInteger("gCBtnLPosType", 0) == 0) {X_Margins_CL = Right_HUD_Margin;}; Y_Margins_CL = (Top_HUD_Margin*-1); } else { X_Margins_CL = 0; Y_Margins_CL = 0; } - if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) { - if (CVar_GetS32("gCBtnRPosType", 0) == 0) {X_Margins_CR = Right_HUD_Margin;}; + if (CVarGetInteger("gCBtnRUseMargins", 0) != 0) { + if (CVarGetInteger("gCBtnRPosType", 0) == 0) {X_Margins_CR = Right_HUD_Margin;}; Y_Margins_CR = (Top_HUD_Margin*-1); } else { X_Margins_CR = 0; Y_Margins_CR = 0; } - if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) { - if (CVar_GetS32("gCBtnDPosType", 0) == 0) {X_Margins_CD = Right_HUD_Margin;}; + if (CVarGetInteger("gCBtnDUseMargins", 0) != 0) { + if (CVarGetInteger("gCBtnDPosType", 0) == 0) {X_Margins_CD = Right_HUD_Margin;}; Y_Margins_CD = (Top_HUD_Margin*-1); } else { X_Margins_CD = 0; Y_Margins_CD = 0; } - if (CVar_GetS32("gDPadUseMargins", 0) != 0) { - if (CVar_GetS32("gDPadPosType", 0) == 0) {X_Margins_DPad_Items = Right_HUD_Margin;}; + if (CVarGetInteger("gDPadUseMargins", 0) != 0) { + if (CVarGetInteger("gDPadPosType", 0) == 0) {X_Margins_DPad_Items = Right_HUD_Margin;}; Y_Margins_DPad_Items = (Top_HUD_Margin*-1); } else { X_Margins_DPad_Items = 0; @@ -4592,29 +4593,29 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { {23,19},//Right }; //(X,Y) Used with custom position to place it properly. //DPadItems - if (CVar_GetS32("gDPadPosType", 0) != 0) { - ItemIconPos[4][1] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[0][1];//Up - ItemIconPos[5][1] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[1][1];//Down - ItemIconPos[6][1] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[2][1];//Left - ItemIconPos[7][1] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[3][1];//Right - if (CVar_GetS32("gDPadPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gDPadUseMargins", 0) != 0) {X_Margins_DPad_Items = Left_HUD_Margin;}; - ItemIconPos[4][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[0][0]); - ItemIconPos[5][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[1][0]); - ItemIconPos[6][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[2][0]); - ItemIconPos[7][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[3][0]); - } else if (CVar_GetS32("gDPadPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gDPadUseMargins", 0) != 0) {X_Margins_DPad_Items = Right_HUD_Margin;}; - ItemIconPos[4][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[0][0]); - ItemIconPos[5][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[1][0]); - ItemIconPos[6][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[2][0]); - ItemIconPos[7][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[3][0]); - } else if (CVar_GetS32("gDPadPosType", 0) == 3) {//Anchor None - ItemIconPos[4][0] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[0][0]; - ItemIconPos[5][0] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[1][0]; - ItemIconPos[6][0] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[2][0]; - ItemIconPos[7][0] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[3][0]; - } else if (CVar_GetS32("gDPadPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gDPadPosType", 0) != 0) { + ItemIconPos[4][1] = CVarGetInteger("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[0][1];//Up + ItemIconPos[5][1] = CVarGetInteger("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[1][1];//Down + ItemIconPos[6][1] = CVarGetInteger("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[2][1];//Left + ItemIconPos[7][1] = CVarGetInteger("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[3][1];//Right + if (CVarGetInteger("gDPadPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gDPadUseMargins", 0) != 0) {X_Margins_DPad_Items = Left_HUD_Margin;}; + ItemIconPos[4][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[0][0]); + ItemIconPos[5][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[1][0]); + ItemIconPos[6][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[2][0]); + ItemIconPos[7][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[3][0]); + } else if (CVarGetInteger("gDPadPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gDPadUseMargins", 0) != 0) {X_Margins_DPad_Items = Right_HUD_Margin;}; + ItemIconPos[4][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[0][0]); + ItemIconPos[5][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[1][0]); + ItemIconPos[6][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[2][0]); + ItemIconPos[7][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[3][0]); + } else if (CVarGetInteger("gDPadPosType", 0) == 3) {//Anchor None + ItemIconPos[4][0] = CVarGetInteger("gDPadPosX", 0)+DPad_ItemsOffset[0][0]; + ItemIconPos[5][0] = CVarGetInteger("gDPadPosX", 0)+DPad_ItemsOffset[1][0]; + ItemIconPos[6][0] = CVarGetInteger("gDPadPosX", 0)+DPad_ItemsOffset[2][0]; + ItemIconPos[7][0] = CVarGetInteger("gDPadPosX", 0)+DPad_ItemsOffset[3][0]; + } else if (CVarGetInteger("gDPadPosType", 0) == 4) {//Hidden ItemIconPos[4][0] = -9999; ItemIconPos[5][0] = -9999; ItemIconPos[6][0] = -9999; @@ -4633,17 +4634,17 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { //B Button s16 PosX_adjust = 1; s16 PosY_adjust = 17; - if (CVar_GetS32("gBBtnPosType", 0) != 0) { - ItemIconPos[0][1] = CVar_GetS32("gBBtnPosY", 0)+Y_Margins_BtnB+PosY_adjust; - if (CVar_GetS32("gBBtnPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Left_HUD_Margin;}; - ItemIconPos[0][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gBBtnPosX", 0)+X_Margins_BtnB+PosX_adjust); - } else if (CVar_GetS32("gBBtnPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Right_HUD_Margin;}; - ItemIconPos[0][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gBBtnPosX", 0)+X_Margins_BtnB+PosX_adjust); - } else if (CVar_GetS32("gBBtnPosType", 0) == 3) {//Anchor None - ItemIconPos[0][0] = CVar_GetS32("gBBtnPosX", 0)+PosX_adjust; - } else if (CVar_GetS32("gBBtnPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gBBtnPosType", 0) != 0) { + ItemIconPos[0][1] = CVarGetInteger("gBBtnPosY", 0)+Y_Margins_BtnB+PosY_adjust; + if (CVarGetInteger("gBBtnPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Left_HUD_Margin;}; + ItemIconPos[0][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gBBtnPosX", 0)+X_Margins_BtnB+PosX_adjust); + } else if (CVarGetInteger("gBBtnPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB = Right_HUD_Margin;}; + ItemIconPos[0][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gBBtnPosX", 0)+X_Margins_BtnB+PosX_adjust); + } else if (CVarGetInteger("gBBtnPosType", 0) == 3) {//Anchor None + ItemIconPos[0][0] = CVarGetInteger("gBBtnPosX", 0)+PosX_adjust; + } else if (CVarGetInteger("gBBtnPosType", 0) == 4) {//Hidden ItemIconPos[0][0] = -9999; } } else { @@ -4651,17 +4652,17 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { ItemIconPos[0][1] = ItemIconPos_ori[0][1]; } //C button Left - if (CVar_GetS32("gCBtnLPosType", 0) != 0) { - ItemIconPos[1][1] = CVar_GetS32("gCBtnLPosY", 0)+Y_Margins_CL+PosY_adjust; - if (CVar_GetS32("gCBtnLPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Left_HUD_Margin;}; - ItemIconPos[1][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL+PosX_adjust); - } else if (CVar_GetS32("gCBtnLPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Right_HUD_Margin;}; - ItemIconPos[1][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL+PosX_adjust); - } else if (CVar_GetS32("gCBtnLPosType", 0) == 3) {//Anchor None - ItemIconPos[1][0] = CVar_GetS32("gCBtnLPosX", 0)+PosX_adjust; - } else if (CVar_GetS32("gCBtnLPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gCBtnLPosType", 0) != 0) { + ItemIconPos[1][1] = CVarGetInteger("gCBtnLPosY", 0)+Y_Margins_CL+PosY_adjust; + if (CVarGetInteger("gCBtnLPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Left_HUD_Margin;}; + ItemIconPos[1][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCBtnLPosX", 0)+X_Margins_CL+PosX_adjust); + } else if (CVarGetInteger("gCBtnLPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Right_HUD_Margin;}; + ItemIconPos[1][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gCBtnLPosX", 0)+X_Margins_CL+PosX_adjust); + } else if (CVarGetInteger("gCBtnLPosType", 0) == 3) {//Anchor None + ItemIconPos[1][0] = CVarGetInteger("gCBtnLPosX", 0)+PosX_adjust; + } else if (CVarGetInteger("gCBtnLPosType", 0) == 4) {//Hidden ItemIconPos[1][0] = -9999; } } else { @@ -4669,17 +4670,17 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { ItemIconPos[1][1] = ItemIconPos_ori[1][1]; } //C Button down - if (CVar_GetS32("gCBtnDPosType", 0) != 0) { - ItemIconPos[2][1] = CVar_GetS32("gCBtnDPosY", 0)+Y_Margins_CD+PosY_adjust; - if (CVar_GetS32("gCBtnDPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Left_HUD_Margin;}; - ItemIconPos[2][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD+PosX_adjust); - } else if (CVar_GetS32("gCBtnDPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Right_HUD_Margin;}; - ItemIconPos[2][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD+PosX_adjust); - } else if (CVar_GetS32("gCBtnDPosType", 0) == 3) {//Anchor None - ItemIconPos[2][0] = CVar_GetS32("gCBtnDPosX", 0)+PosX_adjust; - } else if (CVar_GetS32("gCBtnDPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gCBtnDPosType", 0) != 0) { + ItemIconPos[2][1] = CVarGetInteger("gCBtnDPosY", 0)+Y_Margins_CD+PosY_adjust; + if (CVarGetInteger("gCBtnDPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Left_HUD_Margin;}; + ItemIconPos[2][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCBtnDPosX", 0)+X_Margins_CD+PosX_adjust); + } else if (CVarGetInteger("gCBtnDPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Right_HUD_Margin;}; + ItemIconPos[2][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gCBtnDPosX", 0)+X_Margins_CD+PosX_adjust); + } else if (CVarGetInteger("gCBtnDPosType", 0) == 3) {//Anchor None + ItemIconPos[2][0] = CVarGetInteger("gCBtnDPosX", 0)+PosX_adjust; + } else if (CVarGetInteger("gCBtnDPosType", 0) == 4) {//Hidden ItemIconPos[2][0] = -9999; } } else { @@ -4687,17 +4688,17 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { ItemIconPos[2][1] = ItemIconPos_ori[2][1]; } //C button Right - if (CVar_GetS32("gCBtnRPosType", 0) != 0) { - ItemIconPos[3][1] = CVar_GetS32("gCBtnRPosY", 0)+Y_Margins_CR+PosY_adjust; - if (CVar_GetS32("gCBtnRPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Left_HUD_Margin;}; - ItemIconPos[3][0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR+PosX_adjust); - } else if (CVar_GetS32("gCBtnRPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Right_HUD_Margin;}; - ItemIconPos[3][0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR+PosX_adjust); - } else if (CVar_GetS32("gCBtnRPosType", 0) == 3) {//Anchor None - ItemIconPos[3][0] = CVar_GetS32("gCBtnRPosX", 0)+PosX_adjust; - } else if (CVar_GetS32("gCBtnRPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gCBtnRPosType", 0) != 0) { + ItemIconPos[3][1] = CVarGetInteger("gCBtnRPosY", 0)+Y_Margins_CR+PosY_adjust; + if (CVarGetInteger("gCBtnRPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Left_HUD_Margin;}; + ItemIconPos[3][0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCBtnRPosX", 0)+X_Margins_CR+PosX_adjust); + } else if (CVarGetInteger("gCBtnRPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Right_HUD_Margin;}; + ItemIconPos[3][0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gCBtnRPosX", 0)+X_Margins_CR+PosX_adjust); + } else if (CVarGetInteger("gCBtnRPosType", 0) == 3) {//Anchor None + ItemIconPos[3][0] = CVarGetInteger("gCBtnRPosX", 0)+PosX_adjust; + } else if (CVarGetInteger("gCBtnRPosType", 0) == 4) {//Hidden ItemIconPos[3][0] = -9999; } } else { @@ -4926,19 +4927,19 @@ void Interface_Draw(PlayState* play) { Color_RGB8 rColor; Color_RGB8 keyCountColor = { 200, 230, 255 }; - if (CVar_GetS32("gCosmetics.Hud_KeyCount.Changed", 0)) { - keyCountColor = CVar_GetRGB("gCosmetics.Hud_KeyCount.Value", keyCountColor); + if (CVarGetInteger("gCosmetics.Hud_KeyCount.Changed", 0)) { + keyCountColor = CVarGetColor24("gCosmetics.Hud_KeyCount.Value", keyCountColor); } Color_RGB8 dPadColor = { 255, 255, 255 }; - if (CVar_GetS32("gCosmetics.Hud_Dpad.Changed", 0)) { - dPadColor = CVar_GetRGB("gCosmetics.Hud_Dpad.Value", dPadColor); + if (CVarGetInteger("gCosmetics.Hud_Dpad.Changed", 0)) { + dPadColor = CVarGetColor24("gCosmetics.Hud_Dpad.Value", dPadColor); } Color_RGB8 aButtonColor = { 90, 90, 255 }; - if (CVar_GetS32("gCosmetics.Hud_AButton.Changed", 0)) { - aButtonColor = CVar_GetRGB("gCosmetics.Hud_AButton.Value", aButtonColor); - } else if (CVar_GetS32("gCosmetics.DefaultColorScheme", 0)) { + if (CVarGetInteger("gCosmetics.Hud_AButton.Changed", 0)) { + aButtonColor = CVarGetColor24("gCosmetics.Hud_AButton.Value", aButtonColor); + } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", 0)) { aButtonColor = (Color_RGB8){ 0, 200, 50 }; } @@ -4960,7 +4961,7 @@ void Interface_Draw(PlayState* play) { s16 svar4; s16 svar5; s16 svar6; - bool fullUi = !CVar_GetS32("gMinimalUI", 0) || !R_MINIMAP_DISABLED || play->pauseCtx.state != 0; + bool fullUi = !CVarGetInteger("gMinimalUI", 0) || !R_MINIMAP_DISABLED || play->pauseCtx.state != 0; if (chaosEffectNoUI) { return; @@ -4988,40 +4989,40 @@ void Interface_Draw(PlayState* play) { if (fullUi) { // Rupee Icon - if (CVar_GetS32("gDynamicWalletIcon", 0)) { + if (CVarGetInteger("gDynamicWalletIcon", 0)) { switch (CUR_UPG_VALUE(UPG_WALLET)) { case 0: - if (CVar_GetS32("gCosmetics.Consumable_GreenRupee.Changed", 0)) { - rColor = CVar_GetRGB("gCosmetics.Consumable_GreenRupee.Value", rupeeWalletColors[0]); + if (CVarGetInteger("gCosmetics.Consumable_GreenRupee.Changed", 0)) { + rColor = CVarGetColor24("gCosmetics.Consumable_GreenRupee.Value", rupeeWalletColors[0]); } else { rColor = rupeeWalletColors[0]; } break; case 1: - if (CVar_GetS32("gCosmetics.Consumable_BlueRupee.Changed", 0)) { - rColor = CVar_GetRGB("gCosmetics.Consumable_BlueRupee.Value", rupeeWalletColors[1]); + if (CVarGetInteger("gCosmetics.Consumable_BlueRupee.Changed", 0)) { + rColor = CVarGetColor24("gCosmetics.Consumable_BlueRupee.Value", rupeeWalletColors[1]); } else { rColor = rupeeWalletColors[1]; } break; case 2: - if (CVar_GetS32("gCosmetics.Consumable_RedRupee.Changed", 0)) { - rColor = CVar_GetRGB("gCosmetics.Consumable_RedRupee.Value", rupeeWalletColors[2]); + if (CVarGetInteger("gCosmetics.Consumable_RedRupee.Changed", 0)) { + rColor = CVarGetColor24("gCosmetics.Consumable_RedRupee.Value", rupeeWalletColors[2]); } else { rColor = rupeeWalletColors[2]; } break; case 3: - if (CVar_GetS32("gCosmetics.Consumable_PurpleRupee.Changed", 0)) { - rColor = CVar_GetRGB("gCosmetics.Consumable_PurpleRupee.Value", rupeeWalletColors[3]); + if (CVarGetInteger("gCosmetics.Consumable_PurpleRupee.Changed", 0)) { + rColor = CVarGetColor24("gCosmetics.Consumable_PurpleRupee.Value", rupeeWalletColors[3]); } else { rColor = rupeeWalletColors[3]; } break; } } else { - if (CVar_GetS32("gCosmetics.Consumable_GreenRupee.Changed", rupeeWalletColors)) { - rColor = CVar_GetRGB("gCosmetics.Consumable_GreenRupee.Value", rupeeWalletColors[0]); + if (CVarGetInteger("gCosmetics.Consumable_GreenRupee.Changed", rupeeWalletColors)) { + rColor = CVarGetColor24("gCosmetics.Consumable_GreenRupee.Value", rupeeWalletColors[0]); } else { rColor = rupeeWalletColors[0]; } @@ -5030,8 +5031,8 @@ void Interface_Draw(PlayState* play) { //Rupee icon & counter s16 X_Margins_RC; s16 Y_Margins_RC; - if (CVar_GetS32("gRCUseMargins", 0) != 0) { - if (CVar_GetS32("gRCPosType", 0) == 0) {X_Margins_RC = Left_HUD_Margin;}; + if (CVarGetInteger("gRCUseMargins", 0) != 0) { + if (CVarGetInteger("gRCPosType", 0) == 0) {X_Margins_RC = Left_HUD_Margin;}; Y_Margins_RC = Bottom_HUD_Margin; } else { X_Margins_RC = 0; @@ -5041,17 +5042,17 @@ void Interface_Draw(PlayState* play) { s16 PosY_RC_ori = 206+Y_Margins_RC; s16 PosX_RC; s16 PosY_RC; - if (CVar_GetS32("gRCPosType", 0) != 0) { - PosY_RC = CVar_GetS32("gRCPosY", 0)+Y_Margins_RC; - if (CVar_GetS32("gRCPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gRCUseMargins", 0) != 0) {X_Margins_RC = Left_HUD_Margin;}; - PosX_RC = OTRGetDimensionFromLeftEdge(CVar_GetS32("gRCPosX", 0)+X_Margins_RC); - } else if (CVar_GetS32("gRCPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gRCUseMargins", 0) != 0) {X_Margins_RC = Right_HUD_Margin;}; - PosX_RC = OTRGetDimensionFromRightEdge(CVar_GetS32("gRCPosX", 0)+X_Margins_RC); - } else if (CVar_GetS32("gRCPosType", 0) == 3) {//Anchor None - PosX_RC = CVar_GetS32("gRCPosX", 0); - } else if (CVar_GetS32("gRCPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gRCPosType", 0) != 0) { + PosY_RC = CVarGetInteger("gRCPosY", 0)+Y_Margins_RC; + if (CVarGetInteger("gRCPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gRCUseMargins", 0) != 0) {X_Margins_RC = Left_HUD_Margin;}; + PosX_RC = OTRGetDimensionFromLeftEdge(CVarGetInteger("gRCPosX", 0)+X_Margins_RC); + } else if (CVarGetInteger("gRCPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gRCUseMargins", 0) != 0) {X_Margins_RC = Right_HUD_Margin;}; + PosX_RC = OTRGetDimensionFromRightEdge(CVarGetInteger("gRCPosX", 0)+X_Margins_RC); + } else if (CVarGetInteger("gRCPosType", 0) == 3) {//Anchor None + PosX_RC = CVarGetInteger("gRCPosX", 0); + } else if (CVarGetInteger("gRCPosType", 0) == 4) {//Hidden PosX_RC = -9999; } } else { @@ -5079,8 +5080,8 @@ void Interface_Draw(PlayState* play) { if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] >= 0) { s16 X_Margins_SKC; s16 Y_Margins_SKC; - if (CVar_GetS32("gSKCUseMargins", 0) != 0) { - if (CVar_GetS32("gSKCPosType", 0) == 0) {X_Margins_SKC = Left_HUD_Margin;}; + if (CVarGetInteger("gSKCUseMargins", 0) != 0) { + if (CVarGetInteger("gSKCPosType", 0) == 0) {X_Margins_SKC = Left_HUD_Margin;}; Y_Margins_SKC = Bottom_HUD_Margin; } else { X_Margins_SKC = 0; @@ -5090,17 +5091,17 @@ void Interface_Draw(PlayState* play) { s16 PosY_SKC_ori = 190+Y_Margins_SKC; s16 PosX_SKC; s16 PosY_SKC; - if (CVar_GetS32("gSKCPosType", 0) != 0) { - PosY_SKC = CVar_GetS32("gSKCPosY", 0)+Y_Margins_SKC; - if (CVar_GetS32("gSKCPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gSKCUseMargins", 0) != 0) {X_Margins_SKC = Left_HUD_Margin;}; - PosX_SKC = OTRGetDimensionFromLeftEdge(CVar_GetS32("gSKCPosX", 0)+X_Margins_SKC); - } else if (CVar_GetS32("gSKCPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gSKCUseMargins", 0) != 0) {X_Margins_SKC = Right_HUD_Margin;}; - PosX_SKC = OTRGetDimensionFromRightEdge(CVar_GetS32("gSKCPosX", 0)+X_Margins_SKC); - } else if (CVar_GetS32("gSKCPosType", 0) == 3) {//Anchor None - PosX_SKC = CVar_GetS32("gSKCPosX", 0); - } else if (CVar_GetS32("gSKCPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gSKCPosType", 0) != 0) { + PosY_SKC = CVarGetInteger("gSKCPosY", 0)+Y_Margins_SKC; + if (CVarGetInteger("gSKCPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gSKCUseMargins", 0) != 0) {X_Margins_SKC = Left_HUD_Margin;}; + PosX_SKC = OTRGetDimensionFromLeftEdge(CVarGetInteger("gSKCPosX", 0)+X_Margins_SKC); + } else if (CVarGetInteger("gSKCPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gSKCUseMargins", 0) != 0) {X_Margins_SKC = Right_HUD_Margin;}; + PosX_SKC = OTRGetDimensionFromRightEdge(CVarGetInteger("gSKCPosX", 0)+X_Margins_SKC); + } else if (CVarGetInteger("gSKCPosType", 0) == 3) {//Anchor None + PosX_SKC = CVarGetInteger("gSKCPosX", 0); + } else if (CVarGetInteger("gSKCPosType", 0) == 4) {//Hidden PosX_SKC = -9999; } } else { @@ -5186,7 +5187,7 @@ void Interface_Draw(PlayState* play) { gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); } - if (CVar_GetS32("gDrawLineupTick", 0)) { + if (CVarGetInteger("gDrawLineupTick", 0)) { Interface_DrawLineupTick(play); } @@ -5250,24 +5251,24 @@ void Interface_Draw(PlayState* play) { s16 BbtnPosY; s16 X_Margins_BtnB_label; s16 Y_Margins_BtnB_label; - if (CVar_GetS32("gBBtnUseMargins", 0) != 0) { - if (CVar_GetS32("gBBtnPosType", 0) == 0) {X_Margins_BtnB_label = Right_HUD_Margin;}; + if (CVarGetInteger("gBBtnUseMargins", 0) != 0) { + if (CVarGetInteger("gBBtnPosType", 0) == 0) {X_Margins_BtnB_label = Right_HUD_Margin;}; Y_Margins_BtnB_label = (Top_HUD_Margin*-1); } else { X_Margins_BtnB_label = 0; Y_Margins_BtnB_label = 0; } - if (CVar_GetS32("gBBtnPosType", 0) != 0) { - BbtnPosY = CVar_GetS32("gBBtnPosY", 0)+Y_Margins_BtnB_label+PosY_adjust; - if (CVar_GetS32("gBBtnPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB_label = Left_HUD_Margin;}; - BbtnPosX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gBBtnPosX", 0)+X_Margins_BtnB_label+PosX_adjust); - } else if (CVar_GetS32("gBBtnPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB_label = Right_HUD_Margin;}; - BbtnPosX = OTRGetDimensionFromRightEdge(CVar_GetS32("gBBtnPosX", 0)+X_Margins_BtnB_label+PosX_adjust); - } else if (CVar_GetS32("gBBtnPosType", 0) == 3) {//Anchor None - BbtnPosX = CVar_GetS32("gBBtnPosX", 0)+PosX_adjust; - } else if (CVar_GetS32("gBBtnPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gBBtnPosType", 0) != 0) { + BbtnPosY = CVarGetInteger("gBBtnPosY", 0)+Y_Margins_BtnB_label+PosY_adjust; + if (CVarGetInteger("gBBtnPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB_label = Left_HUD_Margin;}; + BbtnPosX = OTRGetDimensionFromLeftEdge(CVarGetInteger("gBBtnPosX", 0)+X_Margins_BtnB_label+PosX_adjust); + } else if (CVarGetInteger("gBBtnPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gBBtnUseMargins", 0) != 0) {X_Margins_BtnB_label = Right_HUD_Margin;}; + BbtnPosX = OTRGetDimensionFromRightEdge(CVarGetInteger("gBBtnPosX", 0)+X_Margins_BtnB_label+PosX_adjust); + } else if (CVarGetInteger("gBBtnPosType", 0) == 3) {//Anchor None + BbtnPosX = CVarGetInteger("gBBtnPosX", 0)+PosX_adjust; + } else if (CVarGetInteger("gBBtnPosType", 0) == 4) {//Hidden BbtnPosX = -9999; } } else { @@ -5329,7 +5330,7 @@ void Interface_Draw(PlayState* play) { Interface_DrawAmmoCount(play, 3, interfaceCtx->cRightAlpha); } - if (CVar_GetS32("gDpadEquips", 0) != 0) { + if (CVarGetInteger("gDpadEquips", 0) != 0) { // DPad is only greyed-out when all 4 DPad directions are too uint16_t dpadAlpha = MAX(MAX(MAX(interfaceCtx->dpadUpAlpha, interfaceCtx->dpadDownAlpha), interfaceCtx->dpadLeftAlpha), @@ -5340,24 +5341,24 @@ void Interface_Draw(PlayState* play) { s16 DpadPosY; s16 X_Margins_Dpad; s16 Y_Margins_Dpad; - if (CVar_GetS32("gDPadUseMargins", 0) != 0) { - if (CVar_GetS32("gDPadPosType", 0) == 0) {X_Margins_Dpad = Right_HUD_Margin;}; + if (CVarGetInteger("gDPadUseMargins", 0) != 0) { + if (CVarGetInteger("gDPadPosType", 0) == 0) {X_Margins_Dpad = Right_HUD_Margin;}; Y_Margins_Dpad = (Top_HUD_Margin*-1); } else { Y_Margins_Dpad = 0; X_Margins_Dpad = 0; } - if (CVar_GetS32("gDPadPosType", 0) != 0) { - DpadPosY = CVar_GetS32("gDPadPosY", 0)+Y_Margins_Dpad; - if (CVar_GetS32("gDPadPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gDPadUseMargins", 0) != 0) {X_Margins_Dpad = Left_HUD_Margin;}; - DpadPosX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_Dpad); - } else if (CVar_GetS32("gDPadPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gDPadUseMargins", 0) != 0) {X_Margins_Dpad = Right_HUD_Margin;}; - DpadPosX = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_Dpad); - } else if (CVar_GetS32("gDPadPosType", 0) == 3) {//Anchor None - DpadPosX = CVar_GetS32("gDPadPosX", 0); - } else if (CVar_GetS32("gDPadPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gDPadPosType", 0) != 0) { + DpadPosY = CVarGetInteger("gDPadPosY", 0)+Y_Margins_Dpad; + if (CVarGetInteger("gDPadPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gDPadUseMargins", 0) != 0) {X_Margins_Dpad = Left_HUD_Margin;}; + DpadPosX = OTRGetDimensionFromLeftEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_Dpad); + } else if (CVarGetInteger("gDPadPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gDPadUseMargins", 0) != 0) {X_Margins_Dpad = Right_HUD_Margin;}; + DpadPosX = OTRGetDimensionFromRightEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_Dpad); + } else if (CVarGetInteger("gDPadPosType", 0) == 3) {//Anchor None + DpadPosX = CVarGetInteger("gDPadPosX", 0); + } else if (CVarGetInteger("gDPadPosType", 0) == 4) {//Hidden DpadPosX = -9999; } } else { @@ -5426,7 +5427,7 @@ void Interface_Draw(PlayState* play) { Gfx_SetupDL_42Overlay(play->state.gfxCtx); s16 X_Margins_BtnA; s16 Y_Margins_BtnA; - if (CVar_GetS32("gABtnUseMargins", 0) != 0) { + if (CVarGetInteger("gABtnUseMargins", 0) != 0) { X_Margins_BtnA = Right_HUD_Margin; Y_Margins_BtnA = (Top_HUD_Margin*-1); } else { @@ -5441,21 +5442,21 @@ void Interface_Draw(PlayState* play) { s16 PosY_BtnA; s16 rAIconX; s16 rAIconY; - if (CVar_GetS32("gABtnPosType", 0) != 0) { - PosY_BtnA = CVar_GetS32("gABtnPosY", 0)+Y_Margins_BtnA; + if (CVarGetInteger("gABtnPosType", 0) != 0) { + PosY_BtnA = CVarGetInteger("gABtnPosY", 0)+Y_Margins_BtnA; rAIconY = 98.0f - PosY_BtnA; - if (CVar_GetS32("gABtnPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gABtnUseMargins", 0) != 0) {X_Margins_BtnA = Left_HUD_Margin;}; - PosX_BtnA = OTRGetDimensionFromLeftEdge(CVar_GetS32("gABtnPosX", 0)+X_Margins_BtnA); - rAIconX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gABtnPosX", 0)+X_Margins_BtnA); - } else if (CVar_GetS32("gABtnPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gABtnUseMargins", 0) != 0) {X_Margins_BtnA = Right_HUD_Margin;}; - PosX_BtnA = OTRGetDimensionFromRightEdge(CVar_GetS32("gABtnPosX", 0)+X_Margins_BtnA); - rAIconX= OTRGetDimensionFromRightEdge(CVar_GetS32("gABtnPosX", 0)+X_Margins_BtnA); - } else if (CVar_GetS32("gABtnPosType", 0) == 3) {//Anchor None - PosX_BtnA = CVar_GetS32("gABtnPosX", 0); - rAIconX = CVar_GetS32("gABtnPosX", 0); - } else if (CVar_GetS32("gABtnPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gABtnPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gABtnUseMargins", 0) != 0) {X_Margins_BtnA = Left_HUD_Margin;}; + PosX_BtnA = OTRGetDimensionFromLeftEdge(CVarGetInteger("gABtnPosX", 0)+X_Margins_BtnA); + rAIconX = OTRGetDimensionFromLeftEdge(CVarGetInteger("gABtnPosX", 0)+X_Margins_BtnA); + } else if (CVarGetInteger("gABtnPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gABtnUseMargins", 0) != 0) {X_Margins_BtnA = Right_HUD_Margin;}; + PosX_BtnA = OTRGetDimensionFromRightEdge(CVarGetInteger("gABtnPosX", 0)+X_Margins_BtnA); + rAIconX= OTRGetDimensionFromRightEdge(CVarGetInteger("gABtnPosX", 0)+X_Margins_BtnA); + } else if (CVarGetInteger("gABtnPosType", 0) == 3) {//Anchor None + PosX_BtnA = CVarGetInteger("gABtnPosX", 0); + rAIconX = CVarGetInteger("gABtnPosX", 0); + } else if (CVarGetInteger("gABtnPosType", 0) == 4) {//Hidden PosX_BtnA = -9999; rAIconX = -9999; } @@ -5549,7 +5550,7 @@ void Interface_Draw(PlayState* play) { if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0)) { if (gSaveContext.minigameState != 1) { // Carrots rendering if the action corresponds to riding a horse - if (interfaceCtx->unk_1EE == 8 && !CVar_GetS32("gInfiniteEpona", 0)) { + if (interfaceCtx->unk_1EE == 8 && !CVarGetInteger("gInfiniteEpona", 0)) { // Load Carrot Icon gDPLoadTextureBlock(OVERLAY_DISP++, gCarrotIconTex, G_IM_FMT_RGBA, G_IM_SIZ_32b, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, @@ -5559,17 +5560,17 @@ void Interface_Draw(PlayState* play) { s16 CarrotsPosX = ZREG(14); s16 CarrotsPosY = ZREG(15); s16 CarrotsMargins_X = 0; - if (CVar_GetS32("gCarrotsPosType", 0) != 0) { - CarrotsPosY = CVar_GetS32("gCarrotsPosY", 0); - if (CVar_GetS32("gCarrotsPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCarrotsUseMargins", 0) != 0) {CarrotsMargins_X = Left_HUD_Margin;}; - CarrotsPosX = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCarrotsPosX", 0)+CarrotsMargins_X); - } else if (CVar_GetS32("gCarrotsPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCarrotsUseMargins", 0) != 0) {CarrotsMargins_X = Right_HUD_Margin;}; - CarrotsPosX = OTRGetDimensionFromRightEdge(CVar_GetS32("gCarrotsPosX", 0)+CarrotsMargins_X); - } else if (CVar_GetS32("gCarrotsPosType", 0) == 3) {//Anchor None - CarrotsPosX = CVar_GetS32("gCarrotsPosX", 0); - } else if (CVar_GetS32("gCarrotsPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gCarrotsPosType", 0) != 0) { + CarrotsPosY = CVarGetInteger("gCarrotsPosY", 0); + if (CVarGetInteger("gCarrotsPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCarrotsUseMargins", 0) != 0) {CarrotsMargins_X = Left_HUD_Margin;}; + CarrotsPosX = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCarrotsPosX", 0)+CarrotsMargins_X); + } else if (CVarGetInteger("gCarrotsPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCarrotsUseMargins", 0) != 0) {CarrotsMargins_X = Right_HUD_Margin;}; + CarrotsPosX = OTRGetDimensionFromRightEdge(CVarGetInteger("gCarrotsPosX", 0)+CarrotsMargins_X); + } else if (CVarGetInteger("gCarrotsPosType", 0) == 3) {//Anchor None + CarrotsPosX = CVarGetInteger("gCarrotsPosX", 0); + } else if (CVarGetInteger("gCarrotsPosType", 0) == 4) {//Hidden CarrotsPosX = -9999; } } @@ -5588,25 +5589,25 @@ void Interface_Draw(PlayState* play) { } else { // Score for the Horseback Archery s32 X_Margins_Archery; - if (CVar_GetS32("gASUseMargins", 0) != 0) { - if (CVar_GetS32("gASPosType", 0) == 0) {X_Margins_Archery = Right_HUD_Margin;}; + if (CVarGetInteger("gASUseMargins", 0) != 0) { + if (CVarGetInteger("gASPosType", 0) == 0) {X_Margins_Archery = Right_HUD_Margin;}; } else { X_Margins_Archery = 0; } s16 ArcheryPos_Y = ZREG(15); s16 ArcheryPos_X = OTRGetRectDimensionFromRightEdge(WREG(32)+X_Margins_Archery); - if (CVar_GetS32("gASPosType", 0) != 0) { - ArcheryPos_Y = CVar_GetS32("gASPosY", 0); - if (CVar_GetS32("gASPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gASUseMargins", 0) != 0) {X_Margins_Archery = Left_HUD_Margin;}; - ArcheryPos_X = OTRGetRectDimensionFromLeftEdge(CVar_GetS32("gASPosX", 0)+X_Margins_Archery); - } else if (CVar_GetS32("gASPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gASUseMargins", 0) != 0) {X_Margins_Archery = Right_HUD_Margin;}; - ArcheryPos_X = OTRGetRectDimensionFromRightEdge(CVar_GetS32("gASPosX", 0)+X_Margins_Archery); - } else if (CVar_GetS32("gASPosType", 0) == 3) {//Anchor None - ArcheryPos_X = CVar_GetS32("gASPosX", 0)+204+X_Margins_Archery; - } else if (CVar_GetS32("gASPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gASPosType", 0) != 0) { + ArcheryPos_Y = CVarGetInteger("gASPosY", 0); + if (CVarGetInteger("gASPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gASUseMargins", 0) != 0) {X_Margins_Archery = Left_HUD_Margin;}; + ArcheryPos_X = OTRGetRectDimensionFromLeftEdge(CVarGetInteger("gASPosX", 0)+X_Margins_Archery); + } else if (CVarGetInteger("gASPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gASUseMargins", 0) != 0) {X_Margins_Archery = Right_HUD_Margin;}; + ArcheryPos_X = OTRGetRectDimensionFromRightEdge(CVarGetInteger("gASPosX", 0)+X_Margins_Archery); + } else if (CVarGetInteger("gASPosType", 0) == 3) {//Anchor None + ArcheryPos_X = CVarGetInteger("gASPosX", 0)+204+X_Margins_Archery; + } else if (CVarGetInteger("gASPosType", 0) == 4) {//Hidden ArcheryPos_X = -9999; } } @@ -6025,24 +6026,24 @@ void Interface_Draw(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); s32 X_Margins_Timer; - if (CVar_GetS32("gTimersUseMargins", 0) != 0) { - if (CVar_GetS32("gTimersPosType", 0) == 0) {X_Margins_Timer = Left_HUD_Margin;}; + if (CVarGetInteger("gTimersUseMargins", 0) != 0) { + if (CVarGetInteger("gTimersPosType", 0) == 0) {X_Margins_Timer = Left_HUD_Margin;}; } else { X_Margins_Timer = 0; } svar5 = OTRGetRectDimensionFromLeftEdge(gSaveContext.timerX[svar6]+X_Margins_Timer); svar2 = gSaveContext.timerY[svar6]; - if (CVar_GetS32("gTimersPosType", 0) != 0) { - svar2 = (CVar_GetS32("gTimersPosY", 0)); - if (CVar_GetS32("gTimersPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gTimersUseMargins", 0) != 0) {X_Margins_Timer = Left_HUD_Margin;}; - svar5 = OTRGetRectDimensionFromLeftEdge(CVar_GetS32("gTimersPosX", 0)+X_Margins_Timer); - } else if (CVar_GetS32("gTimersPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gTimersUseMargins", 0) != 0) {X_Margins_Timer = Right_HUD_Margin;}; - svar5 = OTRGetRectDimensionFromRightEdge(CVar_GetS32("gTimersPosX", 0)+X_Margins_Timer); - } else if (CVar_GetS32("gTimersPosType", 0) == 3) {//Anchor None - svar5 = CVar_GetS32("gTimersPosX", 0)+204+X_Margins_Timer; - } else if (CVar_GetS32("gTimersPosType", 0) == 4) {//Hidden + if (CVarGetInteger("gTimersPosType", 0) != 0) { + svar2 = (CVarGetInteger("gTimersPosY", 0)); + if (CVarGetInteger("gTimersPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gTimersUseMargins", 0) != 0) {X_Margins_Timer = Left_HUD_Margin;}; + svar5 = OTRGetRectDimensionFromLeftEdge(CVarGetInteger("gTimersPosX", 0)+X_Margins_Timer); + } else if (CVarGetInteger("gTimersPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gTimersUseMargins", 0) != 0) {X_Margins_Timer = Right_HUD_Margin;}; + svar5 = OTRGetRectDimensionFromRightEdge(CVarGetInteger("gTimersPosX", 0)+X_Margins_Timer); + } else if (CVarGetInteger("gTimersPosType", 0) == 3) {//Anchor None + svar5 = CVarGetInteger("gTimersPosX", 0)+204+X_Margins_Timer; + } else if (CVarGetInteger("gTimersPosType", 0) == 4) {//Hidden svar5 = -9999; } } @@ -6108,10 +6109,10 @@ void Interface_Update(PlayState* play) { u16 action; Input* debugInput = &play->state.input[2]; - Top_HUD_Margin = CVar_GetS32("gHUDMargin_T", 0); - Left_HUD_Margin = CVar_GetS32("gHUDMargin_L", 0); - Right_HUD_Margin = CVar_GetS32("gHUDMargin_R", 0); - Bottom_HUD_Margin = CVar_GetS32("gHUDMargin_B", 0); + Top_HUD_Margin = CVarGetInteger("gHUDMargin_T", 0); + Left_HUD_Margin = CVarGetInteger("gHUDMargin_L", 0); + Right_HUD_Margin = CVarGetInteger("gHUDMargin_R", 0); + Bottom_HUD_Margin = CVarGetInteger("gHUDMargin_B", 0); if (CHECK_BTN_ALL(debugInput->press.button, BTN_DLEFT)) { gSaveContext.language = LANGUAGE_ENG; @@ -6256,11 +6257,11 @@ void Interface_Update(PlayState* play) { D_80125A58 = func_8008F2F8(play); if (D_80125A58 == 1) { - if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == 2 || CVar_GetS32("gSuperTunic", 0) != 0) { + if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == 2 || CVarGetInteger("gSuperTunic", 0) != 0) { D_80125A58 = 0; } } else if ((func_8008F2F8(play) >= 2) && (func_8008F2F8(play) < 5)) { - if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == 3 || CVar_GetS32("gSuperTunic", 0) != 0) { + if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == 3 || CVarGetInteger("gSuperTunic", 0) != 0) { D_80125A58 = 0; } } diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index 04f239ca8..08f3cb432 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -554,10 +554,10 @@ void Play_Init(GameState* thisx) { gTrnsnUnkState = 0; play->transitionMode = 0; - if (CVar_GetS32("gSceneTransitions", 255)!= 255){ - play->transitionMode = CVar_GetS32("gSceneTransitions", 0); - gSaveContext.nextTransitionType = CVar_GetS32("gSceneTransitions", 0); - play->fadeTransition = CVar_GetS32("gSceneTransitions", 0); + if (CVarGetInteger("gSceneTransitions", 255)!= 255){ + play->transitionMode = CVarGetInteger("gSceneTransitions", 0); + gSaveContext.nextTransitionType = CVarGetInteger("gSceneTransitions", 0); + play->fadeTransition = CVarGetInteger("gSceneTransitions", 0); } FrameAdvance_Init(&play->frameAdvCtx); @@ -686,7 +686,7 @@ void Play_Update(PlayState* play) { ActorOverlayTable_LogPrint(); } - if (CVar_GetS32("gFreeCamera", 0) && Player_InCsMode(play)) { + if (CVarGetInteger("gFreeCamera", 0) && Player_InCsMode(play)) { play->manualCamera = false; } @@ -869,7 +869,7 @@ void Play_Update(PlayState* play) { // Don't autosave in grottos or cutscenes // Also don't save when you first load a file - if (CVar_GetS32("gAutosave", 0) && (gSaveContext.cutsceneIndex == 0) && (play->gameplayFrames > 60) && + if (CVarGetInteger("gAutosave", 0) && (gSaveContext.cutsceneIndex == 0) && (play->gameplayFrames > 60) && (play->sceneNum != SCENE_YOUSEI_IZUMI_TATE) && (play->sceneNum != SCENE_KAKUSIANA) && (play->sceneNum != SCENE_KENJYANOMA)) { Play_PerformSave(play); } @@ -1088,7 +1088,7 @@ void Play_Update(PlayState* play) { if (!gSaveContext.sohStats.gameComplete) { gSaveContext.sohStats.playTimer++; - if (CVar_GetS32("gMMBunnyHood", 0) && Player_GetMask(play) == PLAYER_MASK_BUNNY) { + if (CVarGetInteger("gMMBunnyHood", 0) && Player_GetMask(play) == PLAYER_MASK_BUNNY) { gSaveContext.sohStats.count[COUNT_TIME_BUNNY_HOOD]++; } } @@ -1645,13 +1645,13 @@ time_t Play_GetRealTime() { void Play_Main(GameState* thisx) { PlayState* play = (PlayState*)thisx; - if (CVar_GetS32("gCheatEasyPauseBufferFrameAdvance", 0)) { - CVar_SetS32("gCheatEasyPauseBufferFrameAdvance", CVar_GetS32("gCheatEasyPauseBufferFrameAdvance", 0) - 1); + if (CVarGetInteger("gCheatEasyPauseBufferFrameAdvance", 0)) { + CVarSetInteger("gCheatEasyPauseBufferFrameAdvance", CVarGetInteger("gCheatEasyPauseBufferFrameAdvance", 0) - 1); } - if (CVar_GetS32("gPauseBufferBlockInputFrame", 0)) { - CVar_SetS32("gPauseBufferBlockInputFrame", CVar_GetS32("gPauseBufferBlockInputFrame", 0) - 1); + if (CVarGetInteger("gPauseBufferBlockInputFrame", 0)) { + CVarSetInteger("gPauseBufferBlockInputFrame", CVarGetInteger("gPauseBufferBlockInputFrame", 0) - 1); } - if (play->envCtx.unk_EE[2] == 0 && CVar_GetS32("gLetItSnow", 0)) { + if (play->envCtx.unk_EE[2] == 0 && CVarGetInteger("gLetItSnow", 0)) { play->envCtx.unk_EE[3] = 64; Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_OBJECT_KANKYO, 0, 0, 0, 0, 0, 0, 3, 0); } @@ -1697,7 +1697,7 @@ void Play_Main(GameState* thisx) { LOG_NUM("1", 1); } - if (CVar_GetS32("gTimeSync", 0)) { + if (CVarGetInteger("gTimeSync", 0)) { const int maxRealDaySeconds = 86400; const int maxInGameDayTicks = 65536; @@ -2194,7 +2194,7 @@ void Play_PerformSave(PlayState* play) { } else { Save_SaveFile(); } - if (CVar_GetS32("gAutosave", 0)) { + if (CVarGetInteger("gAutosave", 0)) { Overlay_DisplayText(3.0f, "Game Saved"); } } diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index 617cf274e..43b22988b 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -363,7 +363,7 @@ s32 Player_ActionToModelGroup(Player* this, s32 actionParam) { void Player_SetModelsForHoldingShield(Player* this) { if ((this->stateFlags1 & 0x400000) && ((this->itemAction < 0) || (this->itemAction == this->heldItemAction))) { - if ((CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemAction != PLAYER_IA_STICK) || + if ((CVarGetInteger("gShieldTwoHanded", 0) && (this->heldItemAction != PLAYER_IA_STICK) || !Player_HoldsTwoHandedWeapon(this)) && !Player_IsChildWithHylianShield(this)) { this->rightHandType = 10; this->rightHandDLists = &sPlayerDListGroups[10][gSaveContext.linkAge]; @@ -490,7 +490,7 @@ s32 Player_IsBurningStickInRange(PlayState* play, Vec3f* pos, f32 xzRange, f32 y s32 Player_GetStrength(void) { s32 strengthUpgrade = CUR_UPG_VALUE(UPG_STRENGTH); - if (CVar_GetS32("gTimelessEquipment", 0) || LINK_IS_ADULT) { + if (CVarGetInteger("gTimelessEquipment", 0) || LINK_IS_ADULT) { return strengthUpgrade; } else if (strengthUpgrade != 0) { return PLAYER_STR_BRACELET; @@ -634,9 +634,9 @@ s32 func_8008F2F8(PlayState* play) { triggerEntry = &sTextTriggers[var]; if ((triggerEntry->flag != 0) && !(gSaveContext.textTriggerFlags & triggerEntry->flag) && - (((var == 0) && (this->currentTunic != PLAYER_TUNIC_GORON && CVar_GetS32("gSuperTunic", 0) == 0)) || + (((var == 0) && (this->currentTunic != PLAYER_TUNIC_GORON && CVarGetInteger("gSuperTunic", 0) == 0)) || (((var == 1) || (var == 3)) && (this->currentBoots == PLAYER_BOOTS_IRON) && - (this->currentTunic != PLAYER_TUNIC_ZORA && CVar_GetS32("gSuperTunic", 0) == 0)))) { + (this->currentTunic != PLAYER_TUNIC_ZORA && CVarGetInteger("gSuperTunic", 0) == 0)))) { Message_StartTextbox(play, triggerEntry->textId, NULL); gSaveContext.textTriggerFlags |= triggerEntry->flag; } @@ -749,14 +749,14 @@ void func_8008F470(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dLis Color_RGB8 sTemp; color = &sTunicColors[tunic]; - if (tunic == PLAYER_TUNIC_KOKIRI && CVar_GetS32("gCosmetics.Link_KokiriTunic.Changed", 0)) { - sTemp = CVar_GetRGB("gCosmetics.Link_KokiriTunic.Value", sTunicColors[PLAYER_TUNIC_KOKIRI]); + if (tunic == PLAYER_TUNIC_KOKIRI && CVarGetInteger("gCosmetics.Link_KokiriTunic.Changed", 0)) { + sTemp = CVarGetColor24("gCosmetics.Link_KokiriTunic.Value", sTunicColors[PLAYER_TUNIC_KOKIRI]); color = &sTemp; - } else if (tunic == PLAYER_TUNIC_GORON && CVar_GetS32("gCosmetics.Link_GoronTunic.Changed", 0)) { - sTemp = CVar_GetRGB("gCosmetics.Link_GoronTunic.Value", sTunicColors[PLAYER_TUNIC_GORON]); + } else if (tunic == PLAYER_TUNIC_GORON && CVarGetInteger("gCosmetics.Link_GoronTunic.Changed", 0)) { + sTemp = CVarGetColor24("gCosmetics.Link_GoronTunic.Value", sTunicColors[PLAYER_TUNIC_GORON]); color = &sTemp; - } else if (tunic == PLAYER_TUNIC_ZORA && CVar_GetS32("gCosmetics.Link_ZoraTunic.Changed", 0)) { - sTemp = CVar_GetRGB("gCosmetics.Link_ZoraTunic.Value", sTunicColors[PLAYER_TUNIC_ZORA]); + } else if (tunic == PLAYER_TUNIC_ZORA && CVarGetInteger("gCosmetics.Link_ZoraTunic.Changed", 0)) { + sTemp = CVarGetColor24("gCosmetics.Link_ZoraTunic.Value", sTunicColors[PLAYER_TUNIC_ZORA]); color = &sTemp; } @@ -774,11 +774,11 @@ void func_8008F470(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dLis gDPPipeSync(POLY_OPA_DISP++); color = &sGauntletColors[strengthUpgrade - 2]; - if (strengthUpgrade == PLAYER_STR_SILVER_G && CVar_GetS32("gCosmetics.Gloves_SilverGauntlets.Changed", 0)) { - sTemp = CVar_GetRGB("gCosmetics.Gloves_SilverGauntlets.Value", sGauntletColors[PLAYER_STR_SILVER_G - 2]); + if (strengthUpgrade == PLAYER_STR_SILVER_G && CVarGetInteger("gCosmetics.Gloves_SilverGauntlets.Changed", 0)) { + sTemp = CVarGetColor24("gCosmetics.Gloves_SilverGauntlets.Value", sGauntletColors[PLAYER_STR_SILVER_G - 2]); color = &sTemp; - } else if (strengthUpgrade == PLAYER_STR_GOLD_G && CVar_GetS32("gCosmetics.Gloves_GoldenGauntlets.Changed", 0)) { - sTemp = CVar_GetRGB("gCosmetics.Gloves_GoldenGauntlets.Value", sGauntletColors[PLAYER_STR_GOLD_G - 2]); + } else if (strengthUpgrade == PLAYER_STR_GOLD_G && CVarGetInteger("gCosmetics.Gloves_GoldenGauntlets.Changed", 0)) { + sTemp = CVarGetColor24("gCosmetics.Gloves_GoldenGauntlets.Value", sGauntletColors[PLAYER_STR_GOLD_G - 2]); color = &sTemp; } gDPSetEnvColor(POLY_OPA_DISP++, color->r, color->g, color->b, 0); @@ -948,8 +948,8 @@ s32 func_8008FCC8(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s } if (limbIndex == PLAYER_LIMB_HEAD) { - if (CVar_GetS32("gCosmetics.Link_HeadScale.Changed", 0)) { - f32 scale = CVar_GetFloat("gCosmetics.Link_HeadScale.Value", 1.0f); + if (CVarGetInteger("gCosmetics.Link_HeadScale.Changed", 0)) { + f32 scale = CVarGetFloat("gCosmetics.Link_HeadScale.Value", 1.0f); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); if (scale > 1.2f) { Matrix_Translate(-((LINK_IS_ADULT ? 320.0f : 200.0f) * scale), 0.0f, 0.0f, MTXMODE_APPLY); @@ -961,8 +961,8 @@ s32 func_8008FCC8(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s rot->y -= this->unk_6B8; rot->z += this->unk_6B6; } else if (limbIndex == PLAYER_LIMB_L_HAND) { - if (CVar_GetS32("gCosmetics.Link_SwordScale.Changed", 0)) { - f32 scale = CVar_GetFloat("gCosmetics.Link_SwordScale.Value", 1.0f); + if (CVarGetInteger("gCosmetics.Link_SwordScale.Changed", 0)) { + f32 scale = CVarGetFloat("gCosmetics.Link_SwordScale.Value", 1.0f); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); Matrix_Translate(-((LINK_IS_ADULT ? 320.0f : 200.0f) * scale), 0.0f, 0.0f, MTXMODE_APPLY); } @@ -1176,7 +1176,7 @@ void func_800906D4(PlayState* play, Player* this, Vec3f* newTipPos) { void Player_DrawGetItemIceTrap(PlayState* play, Player* this, Vec3f* refPos, s32 drawIdPlusOne, f32 height) { OPEN_DISPS(play->state.gfxCtx); - if (CVar_GetS32("gLetItSnow", 0)) { + if (CVarGetInteger("gLetItSnow", 0)) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY); @@ -1607,7 +1607,7 @@ s32 func_80091880(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s type = gPlayerModelTypes[modelGroup][3]; if ((type == 18) || (type == 19)) { dListOffset = ptr[1] * ptrSize; - } else if (type == 16 && CVar_GetS32("gPauseLiveLink", 0)) { + } else if (type == 16 && CVarGetInteger("gPauseLiveLink", 0)) { //if (ptr[0] == 1) //dListOffset = 4; } @@ -1686,8 +1686,8 @@ void func_80091A24(PlayState* play, void* seg04, void* seg06, SkelAnime* skelAni sp12C[0] = sword; sp12C[1] = shield; - Matrix_SetTranslateRotateYXZ(pos->x - ((CVar_GetS32("gPauseLiveLink", 0) && LINK_AGE_IN_YEARS == YEARS_ADULT) ? 25 : 0), - pos->y - (CVar_GetS32("gPauseTriforce", 0) ? 16 : 0), pos->z, rot); + Matrix_SetTranslateRotateYXZ(pos->x - ((CVarGetInteger("gPauseLiveLink", 0) && LINK_AGE_IN_YEARS == YEARS_ADULT) ? 25 : 0), + pos->y - (CVarGetInteger("gPauseTriforce", 0) ? 16 : 0), pos->z, rot); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); gSPSegment(POLY_OPA_DISP++, 0x04, seg04); @@ -1706,7 +1706,7 @@ void func_80091A24(PlayState* play, void* seg04, void* seg06, SkelAnime* skelAni func_8008F470(play, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, 0, tunic, boots, 0, func_80091880, NULL, &sp12C); - if (CVar_GetS32("gPauseTriforce", 0)) { + if (CVarGetInteger("gPauseTriforce", 0)) { Matrix_SetTranslateRotateYXZ(pos->x - (LINK_AGE_IN_YEARS == YEARS_ADULT ? 25 : 0), pos->y + 280 + (LINK_AGE_IN_YEARS == YEARS_ADULT ? 48 : 0), pos->z, rot); @@ -1740,8 +1740,8 @@ void func_8009214C(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f* po Vec3s* srcTable; s32 i; bool canswitchrnd = false; - s16 SelectedMode = CVar_GetS32("gPauseLiveLink", 0); - MinFrameCount = CVar_GetS32("gMinFrameCount", 200); + s16 SelectedMode = CVarGetInteger("gPauseLiveLink", 0); + MinFrameCount = CVarGetInteger("gMinFrameCount", 200); gSegments[4] = VIRTUAL_TO_PHYSICAL(segment + 0x3800); gSegments[6] = VIRTUAL_TO_PHYSICAL(segment + 0x8800); @@ -1766,7 +1766,7 @@ void func_8009214C(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f* po }; s16 AnimArraySize = ARRAY_COUNT(PauseMenuAnimSet); - if (CVar_GetS32("gPauseLiveLink", 0) || CVar_GetS32("gPauseTriforce", 0)) { + if (CVarGetInteger("gPauseLiveLink", 0) || CVarGetInteger("gPauseTriforce", 0)) { uintptr_t anim = 0; // Initialise anim if (CUR_EQUIP_VALUE(EQUIP_SWORD) >= 3) { @@ -1923,7 +1923,7 @@ void func_8009214C(PlayState* play, u8* segment, SkelAnime* skelAnime, Vec3f* po //anim = gPlayerAnim_link_wait_itemD2_20f; // Use for biggoron sword? - if (CVar_GetS32("gPauseTriforce", 0)) { + if (CVarGetInteger("gPauseTriforce", 0)) { anim = gPlayerAnim_link_magic_kaze2; sword = 0; shield = 0; diff --git a/soh/src/code/z_room.c b/soh/src/code/z_room.c index 17f810c55..c135123f8 100644 --- a/soh/src/code/z_room.c +++ b/soh/src/code/z_room.c @@ -401,7 +401,7 @@ BgImage* func_80096A74(PolygonType1* polygon1, PlayState* play) { camera = GET_ACTIVE_CAM(play); camId = camera->camDataIdx; - if (camId == -1 && CVar_GetS32("gNoRestrictItems", 0)) { + if (camId == -1 && CVarGetInteger("gNoRestrictItems", 0)) { // This prevents a crash when using items that change the // camera (such as din's fire) on scenes with prerendered backgrounds return NULL; diff --git a/soh/src/code/z_skelanime.c b/soh/src/code/z_skelanime.c index ddfd99716..d0404ae17 100644 --- a/soh/src/code/z_skelanime.c +++ b/soh/src/code/z_skelanime.c @@ -845,7 +845,7 @@ AnimationEntry* AnimationContext_AddEntry(AnimationContext* animationCtx, Animat */ void AnimationContext_SetLoadFrame(PlayState* play, LinkAnimationHeader* animation, s32 frame, s32 limbCount, Vec3s* frameTable) { - if (CVar_GetS32("gN64WeirdFrames", 0) && frame < 0) { + if (CVarGetInteger("gN64WeirdFrames", 0) && frame < 0) { Vec3s* src = (Vec3s*)getN64WeirdFrame((sizeof(Vec3s) * limbCount + 2) * frame); memcpy(frameTable, src, sizeof(Vec3s) * limbCount + 2); return; diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index adb778f1c..106f81ddc 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -136,7 +136,7 @@ void Sram_OpenSave() { Save_LoadFile(); - if (!CVar_GetS32("gRememberSaveLocation", 0) || gSaveContext.savedSceneNum == SCENE_YOUSEI_IZUMI_TATE || + if (!CVarGetInteger("gRememberSaveLocation", 0) || gSaveContext.savedSceneNum == SCENE_YOUSEI_IZUMI_TATE || gSaveContext.savedSceneNum == SCENE_KAKUSIANA) { switch (gSaveContext.savedSceneNum) { case SCENE_YDAN: @@ -285,7 +285,7 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { u16* ptr; u16 checksum; - if (fileChooseCtx->buttonIndex != 0 || !CVar_GetS32("gDebugEnabled", 0)) { + if (fileChooseCtx->buttonIndex != 0 || !CVarGetInteger("gDebugEnabled", 0)) { Sram_InitNewSave(); } else { Sram_InitDebugSave(); @@ -296,7 +296,7 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { gSaveContext.dayTime = 0x6AAB; gSaveContext.cutsceneIndex = 0xFFF1; - if ((fileChooseCtx->buttonIndex == 0 && CVar_GetS32("gDebugEnabled", 0)) || CVar_GetS32("gNaviSkipCutscene", 0)) { + if ((fileChooseCtx->buttonIndex == 0 && CVarGetInteger("gDebugEnabled", 0)) || CVarGetInteger("gNaviSkipCutscene", 0)) { gSaveContext.cutsceneIndex = 0; } @@ -304,7 +304,7 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { gSaveContext.playerName[offset] = Save_GetSaveMetaInfo(fileChooseCtx->buttonIndex)->playerName[offset]; } - if (fileChooseCtx->questType[fileChooseCtx->buttonIndex] == 2 && strnlen(CVar_GetString("gSpoilerLog", ""), 1) != 0 && + if (fileChooseCtx->questType[fileChooseCtx->buttonIndex] == 2 && strnlen(CVarGetString("gSpoilerLog", ""), 1) != 0 && !((Save_GetSaveMetaInfo(fileChooseCtx->buttonIndex)->requiresMasterQuest && !ResourceMgr_GameHasMasterQuest()) || (Save_GetSaveMetaInfo(fileChooseCtx->buttonIndex)->requiresMasterQuest && !ResourceMgr_GameHasOriginal()))) { // Set N64DD Flags for save file diff --git a/soh/src/code/z_ss_sram.c b/soh/src/code/z_ss_sram.c index 8be84e07b..51f28a068 100644 --- a/soh/src/code/z_ss_sram.c +++ b/soh/src/code/z_ss_sram.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" #include diff --git a/soh/src/libultra/gu/cosf.c b/soh/src/libultra/gu/cosf.c index cae7159ea..31c2e2b0b 100644 --- a/soh/src/libultra/gu/cosf.c +++ b/soh/src/libultra/gu/cosf.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" static const du P[] = { diff --git a/soh/src/libultra/gu/sinf.c b/soh/src/libultra/gu/sinf.c index bb7f58e72..38c9594d1 100644 --- a/soh/src/libultra/gu/sinf.c +++ b/soh/src/libultra/gu/sinf.c @@ -1,5 +1,5 @@ #include "global.h" -#include "ultra64.h" +#include static const du P[] = { { 0x3FF00000, 0x00000000 }, { 0xBFC55554, 0xBC83656D }, { 0x3F8110ED, 0x3804C2A0 }, diff --git a/soh/src/libultra/gu/sins.c b/soh/src/libultra/gu/sins.c index 4b538f67d..fae3665b7 100644 --- a/soh/src/libultra/gu/sins.c +++ b/soh/src/libultra/gu/sins.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "sintable.c" s16 sins(u16 x) { diff --git a/soh/src/libultra/gu/sintable.c b/soh/src/libultra/gu/sintable.c index d430d65ae..90a78e885 100644 --- a/soh/src/libultra/gu/sintable.c +++ b/soh/src/libultra/gu/sintable.c @@ -1,4 +1,4 @@ -#include "ultra64/types.h" +#include static s16 sintable[0x400] = { 0x0000, 0x0032, 0x0064, 0x0096, 0x00C9, 0x00FB, 0x012D, 0x0160, 0x0192, 0x01C4, 0x01F7, 0x0229, 0x025B, 0x028E, diff --git a/soh/src/libultra/io/contpfs.c b/soh/src/libultra/io/contpfs.c index e14641a6a..7ca55f2fd 100644 --- a/soh/src/libultra/io/contpfs.c +++ b/soh/src/libultra/io/contpfs.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" s32 __osPfsInodeCacheChannel = -1; diff --git a/soh/src/libultra/io/contramwrite.c b/soh/src/libultra/io/contramwrite.c index e27c03227..0acf6a9e7 100644 --- a/soh/src/libultra/io/contramwrite.c +++ b/soh/src/libultra/io/contramwrite.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" s32 __osContRamWrite(OSMesgQueue* mq, s32 channel, u16 address, u8* buffer, s32 force) { diff --git a/soh/src/libultra/io/contsetch.c b/soh/src/libultra/io/contsetch.c index 0e7502b0c..fe9fe13d7 100644 --- a/soh/src/libultra/io/contsetch.c +++ b/soh/src/libultra/io/contsetch.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" /* diff --git a/soh/src/libultra/io/pfsallocatefile.c b/soh/src/libultra/io/pfsallocatefile.c index c20531224..29971e9b3 100644 --- a/soh/src/libultra/io/pfsallocatefile.c +++ b/soh/src/libultra/io/pfsallocatefile.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" #include "ultra64/pfs.h" diff --git a/soh/src/libultra/io/pfschecker.c b/soh/src/libultra/io/pfschecker.c index b0a94f1ad..be4d34893 100644 --- a/soh/src/libultra/io/pfschecker.c +++ b/soh/src/libultra/io/pfschecker.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" #include "ultra64/pfs.h" diff --git a/soh/src/libultra/io/pfsfilestate.c b/soh/src/libultra/io/pfsfilestate.c index 367a7f27d..94534e026 100644 --- a/soh/src/libultra/io/pfsfilestate.c +++ b/soh/src/libultra/io/pfsfilestate.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" s32 osPfsFileState(OSPfs* pfs, s32 fileNo, OSPfsState* state) { diff --git a/soh/src/libultra/io/pfsfindfile.c b/soh/src/libultra/io/pfsfindfile.c index d7798e4fb..bd5e13717 100644 --- a/soh/src/libultra/io/pfsfindfile.c +++ b/soh/src/libultra/io/pfsfindfile.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" s32 osPfsFindFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32* fileNo) { diff --git a/soh/src/libultra/io/pfsfreeblocks.c b/soh/src/libultra/io/pfsfreeblocks.c index 7210c6581..23959e0af 100644 --- a/soh/src/libultra/io/pfsfreeblocks.c +++ b/soh/src/libultra/io/pfsfreeblocks.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" #include "ultra64/pfs.h" diff --git a/soh/src/libultra/io/pfsgetstatus.c b/soh/src/libultra/io/pfsgetstatus.c index 3a1e962a2..9c52996e8 100644 --- a/soh/src/libultra/io/pfsgetstatus.c +++ b/soh/src/libultra/io/pfsgetstatus.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" OSPifRam gPifMempakBuf; diff --git a/soh/src/libultra/io/pfsinitpak.c b/soh/src/libultra/io/pfsinitpak.c index c7563c84c..455bdae63 100644 --- a/soh/src/libultra/io/pfsinitpak.c +++ b/soh/src/libultra/io/pfsinitpak.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" s32 osPfsInitPak(OSMesgQueue* queue, OSPfs* pfs, s32 channel) { diff --git a/soh/src/libultra/io/pfsisplug.c b/soh/src/libultra/io/pfsisplug.c index a1b73cf8e..9e12c964e 100644 --- a/soh/src/libultra/io/pfsisplug.c +++ b/soh/src/libultra/io/pfsisplug.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" s32 osPfsIsPlug(OSMesgQueue* mq, u8* pattern) { diff --git a/soh/src/libultra/io/pfsreadwritefile.c b/soh/src/libultra/io/pfsreadwritefile.c index 8c93ddc7b..8d8a8f443 100644 --- a/soh/src/libultra/io/pfsreadwritefile.c +++ b/soh/src/libultra/io/pfsreadwritefile.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" #define CHECK_IPAGE(p, pfs) \ diff --git a/soh/src/libultra/os/afterprenmi.c b/soh/src/libultra/os/afterprenmi.c index b59814763..06316ac2a 100644 --- a/soh/src/libultra/os/afterprenmi.c +++ b/soh/src/libultra/os/afterprenmi.c @@ -1,4 +1,4 @@ -#include "ultra64.h" +#include #include "global.h" s32 osAfterPreNMI(void) { diff --git a/soh/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/soh/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index b1774251b..bcb66e56f 100644 --- a/soh/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/soh/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -258,7 +258,7 @@ void ArmsHook_Shoot(ArmsHook* this, PlayState* play) { sp60.y = this->unk_1F4.y - (this->unk_1E8.y - this->unk_1F4.y); sp60.z = this->unk_1F4.z - (this->unk_1E8.z - this->unk_1F4.z); u16 buttonsToCheck = BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN; - if (CVar_GetS32("gDpadEquips", 0) != 0) { + if (CVarGetInteger("gDpadEquips", 0) != 0) { buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT; } if (BgCheck_EntityLineTest1(&play->colCtx, &sp60, &this->unk_1E8, &sp78, &poly, true, true, true, true, diff --git a/soh/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h b/soh/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h index b624599a5..75597abc1 100644 --- a/soh/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h +++ b/soh/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.h @@ -1,7 +1,7 @@ #ifndef Z_ARMS_HOOK_H #define Z_ARMS_HOOK_H -#include "ultra64.h" +#include #include "global.h" struct ArmsHook; diff --git a/soh/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c b/soh/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c index ba74514e6..af001d2b6 100644 --- a/soh/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/soh/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -196,12 +196,12 @@ void ArrowFire_Draw(Actor* thisx, PlayState* play2) { Actor* tranform; Color_RGB8 primaryColor = {255, 200, 0}; - if (CVar_GetS32("gCosmetics.Arrows_FirePrimary.Changed", 0)) { - primaryColor = CVar_GetRGB("gCosmetics.Arrows_FirePrimary.Value", primaryColor); + if (CVarGetInteger("gCosmetics.Arrows_FirePrimary.Changed", 0)) { + primaryColor = CVarGetColor24("gCosmetics.Arrows_FirePrimary.Value", primaryColor); } Color_RGB8 secondaryColor = {255, 0, 0}; - if (CVar_GetS32("gCosmetics.Arrows_FireSecondary.Changed", 0)) { - secondaryColor = CVar_GetRGB("gCosmetics.Arrows_FireSecondary.Value", secondaryColor); + if (CVarGetInteger("gCosmetics.Arrows_FireSecondary.Changed", 0)) { + secondaryColor = CVarGetColor24("gCosmetics.Arrows_FireSecondary.Value", secondaryColor); } stateFrames = play->state.frames; diff --git a/soh/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h b/soh/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h index 44af3decf..6f192c7cf 100644 --- a/soh/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h +++ b/soh/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.h @@ -1,7 +1,7 @@ #ifndef Z_ARROW_FIRE_H #define Z_ARROW_FIRE_H -#include "ultra64.h" +#include #include "global.h" struct ArrowFire; diff --git a/soh/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c b/soh/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c index 6f0e731d4..566e34367 100644 --- a/soh/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/soh/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -197,12 +197,12 @@ void ArrowIce_Draw(Actor* thisx, PlayState* play) { EnArrow* arrow = (EnArrow*)this->actor.parent; Color_RGB8 primaryColor = {170, 255, 255}; - if (CVar_GetS32("gCosmetics.Arrows_IcePrimary.Changed", 0)) { - primaryColor = CVar_GetRGB("gCosmetics.Arrows_IcePrimary.Value", primaryColor); + if (CVarGetInteger("gCosmetics.Arrows_IcePrimary.Changed", 0)) { + primaryColor = CVarGetColor24("gCosmetics.Arrows_IcePrimary.Value", primaryColor); } Color_RGB8 secondaryColor = {0, 0, 255}; - if (CVar_GetS32("gCosmetics.Arrows_IceSecondary.Changed", 0)) { - secondaryColor = CVar_GetRGB("gCosmetics.Arrows_IceSecondary.Value", secondaryColor); + if (CVarGetInteger("gCosmetics.Arrows_IceSecondary.Changed", 0)) { + secondaryColor = CVarGetColor24("gCosmetics.Arrows_IceSecondary.Value", secondaryColor); } if ((arrow != NULL) && (arrow->actor.update != NULL) && (this->timer < 255)) { diff --git a/soh/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h b/soh/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h index 1a6ed24b3..2320c5fe1 100644 --- a/soh/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h +++ b/soh/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.h @@ -1,7 +1,7 @@ #ifndef Z_ARROW_ICE_H #define Z_ARROW_ICE_H -#include "ultra64.h" +#include #include "global.h" struct ArrowIce; diff --git a/soh/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c b/soh/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c index 96f78f433..7e625b1c0 100644 --- a/soh/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/soh/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -195,12 +195,12 @@ void ArrowLight_Draw(Actor* thisx, PlayState* play) { Actor* tranform; Color_RGB8 primaryColor = {255, 255, 170}; - if (CVar_GetS32("gCosmetics.Arrows_LightPrimary.Changed", 0)) { - primaryColor = CVar_GetRGB("gCosmetics.Arrows_LightPrimary.Value", primaryColor); + if (CVarGetInteger("gCosmetics.Arrows_LightPrimary.Changed", 0)) { + primaryColor = CVarGetColor24("gCosmetics.Arrows_LightPrimary.Value", primaryColor); } Color_RGB8 secondaryColor = {255, 255, 0}; - if (CVar_GetS32("gCosmetics.Arrows_LightSecondary.Changed", 0)) { - secondaryColor = CVar_GetRGB("gCosmetics.Arrows_LightSecondary.Value", secondaryColor); + if (CVarGetInteger("gCosmetics.Arrows_LightSecondary.Changed", 0)) { + secondaryColor = CVarGetColor24("gCosmetics.Arrows_LightSecondary.Value", secondaryColor); } if ((arrow != NULL) && (arrow->actor.update != NULL) && (this->timer < 255)) { diff --git a/soh/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h b/soh/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h index 78bef515e..6a68f5fc4 100644 --- a/soh/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h +++ b/soh/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.h @@ -1,7 +1,7 @@ #ifndef Z_ARROW_LIGHT_H #define Z_ARROW_LIGHT_H -#include "ultra64.h" +#include #include "global.h" struct ArrowLight; diff --git a/soh/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h b/soh/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h index 358c6bcae..1b98922cc 100644 --- a/soh/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h +++ b/soh/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h @@ -1,7 +1,7 @@ #ifndef Z_BG_BDAN_OBJECTS_H #define Z_BG_BDAN_OBJECTS_H -#include "ultra64.h" +#include #include "global.h" struct BgBdanObjects; diff --git a/soh/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h b/soh/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h index cc0d7cceb..856b0bce4 100644 --- a/soh/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h +++ b/soh/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h @@ -1,7 +1,7 @@ #ifndef Z_BG_BDAN_SWITCH_H #define Z_BG_BDAN_SWITCH_H -#include "ultra64.h" +#include #include "global.h" // BgBdanSwitch.actor.params & 0xFF diff --git a/soh/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h b/soh/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h index 9df9ab267..2b5571631 100644 --- a/soh/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h +++ b/soh/src/overlays/actors/ovl_Bg_Bom_Guard/z_bg_bom_guard.h @@ -1,7 +1,7 @@ #ifndef Z_BG_BOM_GUARD_H #define Z_BG_BOM_GUARD_H -#include "ultra64.h" +#include #include "global.h" struct BgBomGuard; diff --git a/soh/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h b/soh/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h index f5c9cd2b5..ea87aa72a 100644 --- a/soh/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h +++ b/soh/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.h @@ -1,7 +1,7 @@ #ifndef Z_BG_BOMBWALL_H #define Z_BG_BOMBWALL_H -#include "ultra64.h" +#include #include "global.h" struct BgBombwall; diff --git a/soh/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.h b/soh/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.h index 12a4bdf3a..6ccd9ed52 100644 --- a/soh/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.h +++ b/soh/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.h @@ -1,7 +1,7 @@ #ifndef Z_BG_BOWL_WALL_H #define Z_BG_BOWL_WALL_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h" 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 8870ec5a8..5015c87da 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 @@ -106,7 +106,7 @@ void BgBreakwall_Init(Actor* thisx, PlayState* play) { s32 wallType = ((this->dyna.actor.params >> 13) & 3) & 0xFF; // Initialize this with the mud wall, so it can't be affected by toggling while the actor is loaded - blueFireArrowsEnabledOnMudwallLoad = CVar_GetS32("gBlueFireArrows", 0) || (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_BLUE_FIRE_ARROWS)); + blueFireArrowsEnabledOnMudwallLoad = CVarGetInteger("gBlueFireArrows", 0) || (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_BLUE_FIRE_ARROWS)); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_UNK); diff --git a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h index 022a439f2..fc1eb5b16 100644 --- a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h +++ b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h @@ -1,7 +1,7 @@ #ifndef Z_BG_BREAKWALL_H #define Z_BG_BREAKWALL_H -#include "ultra64.h" +#include #include "global.h" struct BgBreakwall; diff --git a/soh/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h b/soh/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h index 649765794..6aa8ff18d 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h +++ b/soh/src/overlays/actors/ovl_Bg_Ddan_Jd/z_bg_ddan_jd.h @@ -1,7 +1,7 @@ #ifndef Z_BG_DDAN_JD_H #define Z_BG_DDAN_JD_H -#include "ultra64.h" +#include #include "global.h" struct BgDdanJd; diff --git a/soh/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h b/soh/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h index 2e80b64cb..77f594e84 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h +++ b/soh/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h @@ -1,7 +1,7 @@ #ifndef Z_BG_DDAN_KD_H #define Z_BG_DDAN_KD_H -#include "ultra64.h" +#include #include "global.h" struct BgDdanKd; diff --git a/soh/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h b/soh/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h index 02603c6d0..22eca6704 100644 --- a/soh/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h +++ b/soh/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.h @@ -1,7 +1,7 @@ #ifndef Z_BG_DODOAGO_H #define Z_BG_DODOAGO_H -#include "ultra64.h" +#include #include "global.h" typedef enum { diff --git a/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h b/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h index 7e71c9090..4b78bc6c2 100644 --- a/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h +++ b/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.h @@ -1,7 +1,7 @@ #ifndef Z_BG_DY_YOSEIZO_H #define Z_BG_DY_YOSEIZO_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h" #include "overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h" diff --git a/soh/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h b/soh/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h index 376130ae5..8d8790a22 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h +++ b/soh/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.h @@ -1,7 +1,7 @@ #ifndef Z_BG_GANON_OTYUKA_H #define Z_BG_GANON_OTYUKA_H -#include "ultra64.h" +#include #include "global.h" #define OTYUKA_SIDE_EAST (1 << 0) diff --git a/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h b/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h index cad165121..3b198ce5d 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h +++ b/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.h @@ -1,7 +1,7 @@ #ifndef Z_BG_GATE_SHUTTER_H #define Z_BG_GATE_SHUTTER_H -#include "ultra64.h" +#include #include "global.h" struct BgGateShutter; diff --git a/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.h b/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.h index 0ca02453b..78b9fe610 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.h +++ b/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.h @@ -1,7 +1,7 @@ #ifndef Z_BG_GJYO_BRIDGE_H #define Z_BG_GJYO_BRIDGE_H -#include "ultra64.h" +#include #include "global.h" struct BgGjyoBridge; diff --git a/soh/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h b/soh/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h index 64d6f50ba..443c5ad60 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h +++ b/soh/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.h @@ -1,7 +1,7 @@ #ifndef Z_BG_GND_DARKMEIRO_H #define Z_BG_GND_DARKMEIRO_H -#include "ultra64.h" +#include #include "global.h" struct BgGndDarkmeiro; diff --git a/soh/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h b/soh/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h index 60a2254cf..9b5bf09b1 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h +++ b/soh/src/overlays/actors/ovl_Bg_Gnd_Firemeiro/z_bg_gnd_firemeiro.h @@ -1,7 +1,7 @@ #ifndef Z_BG_GND_FIREMEIRO_H #define Z_BG_GND_FIREMEIRO_H -#include "ultra64.h" +#include #include "global.h" struct BgGndFiremeiro; diff --git a/soh/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h b/soh/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h index 1d9da28f7..a4087580a 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h +++ b/soh/src/overlays/actors/ovl_Bg_Gnd_Iceblock/z_bg_gnd_iceblock.h @@ -1,7 +1,7 @@ #ifndef Z_BG_GND_ICEBLOCK_H #define Z_BG_GND_ICEBLOCK_H -#include "ultra64.h" +#include #include "global.h" struct BgGndIceblock; diff --git a/soh/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.h b/soh/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.h index 32da8fa08..f259cb7da 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.h +++ b/soh/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.h @@ -1,7 +1,7 @@ #ifndef Z_BG_GND_NISEKABE_H #define Z_BG_GND_NISEKABE_H -#include "ultra64.h" +#include #include "global.h" struct BgGndNisekabe; diff --git a/soh/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h b/soh/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h index cbf9b854d..f86bf4f51 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h +++ b/soh/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.h @@ -1,7 +1,7 @@ #ifndef Z_BG_GND_SOULMEIRO_H #define Z_BG_GND_SOULMEIRO_H -#include "ultra64.h" +#include #include "global.h" struct BgGndSoulmeiro; diff --git a/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c b/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c index eefb5b21c..f7b38fa92 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c @@ -69,7 +69,7 @@ void func_8087B7E8(BgHaka* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->dyna.unk_150 != 0.0f) { - if (play->sceneNum == SCENE_SPOT02 && !LINK_IS_ADULT && IS_DAY && !gSaveContext.n64ddFlag && !CVar_GetS32("gDayGravePull", 0)) { + if (play->sceneNum == SCENE_SPOT02 && !LINK_IS_ADULT && IS_DAY && !gSaveContext.n64ddFlag && !CVarGetInteger("gDayGravePull", 0)) { this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~0x10; if (!Play_InCsMode(play)) { diff --git a/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h b/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h index 16d81f5ad..fc086035f 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h +++ b/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HAKA_H #define Z_BG_HAKA_H -#include "ultra64.h" +#include #include "global.h" struct BgHaka; diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c index eb19096e8..e413a9156 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c @@ -211,9 +211,9 @@ void BgHakaGate_StatueTurn(BgHakaGate* this, PlayState* play) { if (turnFinished) { player->stateFlags2 &= ~0x10; this->vRotYDeg10 = (this->vRotYDeg10 + turnAngle) % 3600; - this->vTurnRateDeg10 = CVar_GetS32("gFasterBlockPush", 0) * 2; + this->vTurnRateDeg10 = CVarGetInteger("gFasterBlockPush", 0) * 2; this->vTurnAngleDeg10 = 0; - this->vTimer = 5 - ((CVar_GetS32("gFasterBlockPush", 0) * 3) / 5); + this->vTimer = 5 - ((CVarGetInteger("gFasterBlockPush", 0) * 3) / 5); this->actionFunc = BgHakaGate_StatueIdle; this->dyna.unk_150 = 0.0f; } diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h b/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h index d111c64b7..0a6d34cb9 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HAKA_GATE_H #define Z_BG_HAKA_GATE_H -#include "ultra64.h" +#include #include "global.h" struct BgHakaGate; diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h b/soh/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h index 8897772b0..1a93624fd 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HAKA_HUTA_H #define Z_BG_HAKA_HUTA_H -#include "ultra64.h" +#include #include "global.h" struct BgHakaHuta; diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h b/soh/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h index 9de05508f..76eb8ed04 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Megane/z_bg_haka_megane.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HAKA_MEGANE_H #define Z_BG_HAKA_MEGANE_H -#include "ultra64.h" +#include #include "global.h" struct BgHakaMegane; diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h b/soh/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h index 933c49fbb..999926a08 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h +++ b/soh/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HAKA_MEGANEBG_H #define Z_BG_HAKA_MEGANEBG_H -#include "ultra64.h" +#include #include "global.h" struct BgHakaMeganeBG; diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h b/soh/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h index 6f140a39c..f4f2de237 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HAKA_SGAMI_H #define Z_BG_HAKA_SGAMI_H -#include "ultra64.h" +#include #include "global.h" struct BgHakaSgami; diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h b/soh/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h index 80f35d084..c98251b45 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HAKA_SHIP_H #define Z_BG_HAKA_SHIP_H -#include "ultra64.h" +#include #include "global.h" struct BgHakaShip; diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h b/soh/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h index 111e08e24..97371df4a 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HAKA_TRAP_H #define Z_BG_HAKA_TRAP_H -#include "ultra64.h" +#include #include "global.h" typedef enum { diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c b/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c index dff136422..c4d3ae11e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c @@ -181,7 +181,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, PlayState* play) { func_80078884(NA_SE_SY_ERROR); } else { // Random rewards - if (CVar_GetS32("gNoRandomDrops", 0)) { + if (CVarGetInteger("gNoRandomDrops", 0)) { collectibleParams = -1; } else if(rnd < 0.4f) { collectibleParams = ITEM00_BOMBS_A; @@ -196,7 +196,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, PlayState* play) { } } else if (Flags_GetCollectible(play, this->dyna.actor.params) != 0) { // If small key already collected, drop recovery heart instead - if (CVar_GetS32("gNoHeartDrops", 0)) { + if (CVarGetInteger("gNoHeartDrops", 0)) { collectibleParams = -1; } else { diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.h b/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.h index fbed37aa2..aa775401b 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.h +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HAKA_TUBO_H #define Z_BG_HAKA_TUBO_H -#include "ultra64.h" +#include #include "global.h" struct BgHakaTubo; diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.h b/soh/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.h index b89d0fa52..428da7e7d 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.h +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Water/z_bg_haka_water.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HAKA_WATER_H #define Z_BG_HAKA_WATER_H -#include "ultra64.h" +#include #include "global.h" struct BgHakaWater; diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h b/soh/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h index b5fe2a2fd..016d1e5c6 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HAKA_ZOU_H #define Z_BG_HAKA_ZOU_H -#include "ultra64.h" +#include #include "global.h" struct BgHakaZou; diff --git a/soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c index 2bdf3f406..d18a21c58 100644 --- a/soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c +++ b/soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c @@ -320,7 +320,7 @@ void BgHeavyBlock_Wait(BgHeavyBlock* this, PlayState* play) { if (Actor_HasParent(&this->dyna.actor, play)) { this->timer = 0; - if (!CVar_GetS32("gFasterHeavyBlockLift", 0)) { + if (!CVarGetInteger("gFasterHeavyBlockLift", 0)) { switch (this->dyna.actor.params & 0xFF) { case HEAVYBLOCK_BREAKABLE: OnePointCutscene_Init(play, 4020, 270, &this->dyna.actor, MAIN_CAM); @@ -369,7 +369,7 @@ void BgHeavyBlock_LiftedUp(BgHeavyBlock* this, PlayState* play) { this->timer++; - if (!CVar_GetS32("gFasterHeavyBlockLift", 0)) { + if (!CVarGetInteger("gFasterHeavyBlockLift", 0)) { func_8002DF54(play, &player->actor, 8); } @@ -409,7 +409,7 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) { Quake_SetCountdown(quakeIndex, 30); // We don't want this arbitrarily long quake with the enhancement enabled - if (!CVar_GetS32("gFasterHeavyBlockLift", 0)) { + if (!CVarGetInteger("gFasterHeavyBlockLift", 0)) { quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 2); Quake_SetSpeed(quakeIndex, 12000); Quake_SetQuakeValues(quakeIndex, 5, 0, 0, 0); diff --git a/soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h b/soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h index c6c21d2df..bb60700db 100644 --- a/soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h +++ b/soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HEAVY_BLOCK_H #define Z_BG_HEAVY_BLOCK_H -#include "ultra64.h" +#include #include "global.h" struct BgHeavyBlock; diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h b/soh/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h index 54a99a796..0f0e0a16e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HIDAN_CURTAIN_H #define Z_BG_HIDAN_CURTAIN_H -#include "ultra64.h" +#include #include "global.h" struct BgHidanCurtain; diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h b/soh/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h index 1ded5bdcb..ad5da032a 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HIDAN_DALM_H #define Z_BG_HIDAN_DALM_H -#include "ultra64.h" +#include #include "global.h" struct BgHidanDalm; diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h b/soh/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h index ab60763f7..104e4218e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Firewall/z_bg_hidan_firewall.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HIDAN_FIREWALL_H #define Z_BG_HIDAN_FIREWALL_H -#include "ultra64.h" +#include #include "global.h" struct BgHidanFirewall; diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h b/soh/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h index 731a8e2ce..caaaacf1d 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HIDAN_FSLIFT_H #define Z_BG_HIDAN_FSLIFT_H -#include "ultra64.h" +#include #include "global.h" struct BgHidanFslift; diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.h b/soh/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.h index 9bf96e22d..03e0e65ea 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.h +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HIDAN_FWBIG_H #define Z_BG_HIDAN_FWBIG_H -#include "ultra64.h" +#include #include "global.h" struct BgHidanFwbig; diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h b/soh/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h index eca062fa9..5ce4b764c 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HIDAN_HAMSTEP_H #define Z_BG_HIDAN_HAMSTEP_H -#include "ultra64.h" +#include #include "global.h" struct BgHidanHamstep; diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h b/soh/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h index 9835f6887..9ed52ed14 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HIDAN_HROCK_H #define Z_BG_HIDAN_HROCK_H -#include "ultra64.h" +#include #include "global.h" struct BgHidanHrock; diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h b/soh/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h index 94a5aad2a..fff8c4c53 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HIDAN_KOUSI_H #define Z_BG_HIDAN_KOUSI_H -#include "ultra64.h" +#include #include "global.h" struct BgHidanKousi; diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h b/soh/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h index 5b59c09eb..2a26aa3bc 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HIDAN_KOWARERUKABE_H #define Z_BG_HIDAN_KOWARERUKABE_H -#include "ultra64.h" +#include #include "global.h" struct BgHidanKowarerukabe; diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index b452d9cfd..83154fd5d 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -137,7 +137,7 @@ void func_8088B268(BgHidanRock* this, PlayState* play) { } } - this->dyna.actor.speedXZ = this->dyna.actor.speedXZ + (CVar_GetS32("gFasterBlockPush", 0) * 0.3) + 0.5f; + this->dyna.actor.speedXZ = this->dyna.actor.speedXZ + (CVarGetInteger("gFasterBlockPush", 0) * 0.3) + 0.5f; this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f); if (D_8088BFC0 > 0.0f) { @@ -156,7 +156,7 @@ void func_8088B268(BgHidanRock* this, PlayState* play) { this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; D_8088BFC0 = 0.0f; this->dyna.actor.speedXZ = 0.0f; - this->timer = 5 - ((CVar_GetS32("gFasterBlockPush", 0) * 3) / 5); + this->timer = 5 - ((CVarGetInteger("gFasterBlockPush", 0) * 3) / 5); } func_8002F974(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h b/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h index 35ba9ef62..466943ce2 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HIDAN_ROCK_H #define Z_BG_HIDAN_ROCK_H -#include "ultra64.h" +#include #include "global.h" struct BgHidanRock; diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h b/soh/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h index cfbd5d3e5..c9bb83988 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HIDAN_RSEKIZOU_H #define Z_BG_HIDAN_RSEKIZOU_H -#include "ultra64.h" +#include #include "global.h" struct BgHidanRsekizou; diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h b/soh/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h index 86b9427df..385b53528 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HIDAN_SEKIZOU_H #define Z_BG_HIDAN_SEKIZOU_H -#include "ultra64.h" +#include #include "global.h" struct BgHidanSekizou; diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h b/soh/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h index 927391110..3059be638 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Sima/z_bg_hidan_sima.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HIDAN_SIMA_H #define Z_BG_HIDAN_SIMA_H -#include "ultra64.h" +#include #include "global.h" struct BgHidanSima; diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.h b/soh/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.h index 61e3520b7..a785a2e2d 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.h +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Syoku/z_bg_hidan_syoku.h @@ -1,7 +1,7 @@ #ifndef Z_BG_HIDAN_SYOKU_H #define Z_BG_HIDAN_SYOKU_H -#include "ultra64.h" +#include #include "global.h" struct BgHidanSyoku; diff --git a/soh/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.h b/soh/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.h index 13a2334c3..546b9c11e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.h +++ b/soh/src/overlays/actors/ovl_Bg_Ice_Objects/z_bg_ice_objects.h @@ -1,7 +1,7 @@ #ifndef Z_BG_ICE_OBJECTS_H #define Z_BG_ICE_OBJECTS_H -#include "ultra64.h" +#include #include "global.h" struct BgIceObjects; 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 582eb0722..847cf1dcf 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 @@ -105,7 +105,7 @@ void func_80890740(BgIceShelter* this, PlayState* play) { s32 type = (this->dyna.actor.params >> 8) & 7; // Initialize this with the red ice, so it can't be affected by toggling while the actor is loaded - blueFireArrowsEnabledOnRedIceLoad = CVar_GetS32("gBlueFireArrows", 0) || (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_BLUE_FIRE_ARROWS)); + blueFireArrowsEnabledOnRedIceLoad = CVarGetInteger("gBlueFireArrows", 0) || (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_BLUE_FIRE_ARROWS)); Collider_InitCylinder(play, &this->cylinder1); // If "Blue Fire Arrows" is enabled, set up a collider on the red ice that responds to them @@ -461,8 +461,8 @@ void BgIceShelter_Draw(Actor* thisx, PlayState* play2) { break; } - if (CVar_GetS32("gCosmetics.World_RedIce.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.World_RedIce.Value", (Color_RGB8){ 255, 0, 0}); + if (CVarGetInteger("gCosmetics.World_RedIce.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.World_RedIce.Value", (Color_RGB8){ 255, 0, 0}); gDPSetEnvColor(POLY_XLU_DISP++, color.r, color.g, color.b, this->alpha); } else { gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, this->alpha); diff --git a/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h b/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h index 40c715f64..df6976c42 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h +++ b/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.h @@ -1,7 +1,7 @@ #ifndef Z_BG_ICE_SHELTER_H #define Z_BG_ICE_SHELTER_H -#include "ultra64.h" +#include #include "global.h" struct BgIceShelter; diff --git a/soh/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h b/soh/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h index db8a7ff61..0c6c76e41 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h +++ b/soh/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.h @@ -1,7 +1,7 @@ #ifndef Z_BG_ICE_SHUTTER_H #define Z_BG_ICE_SHUTTER_H -#include "ultra64.h" +#include #include "global.h" struct BgIceShutter; diff --git a/soh/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h b/soh/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h index a869888a8..be86558f2 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h +++ b/soh/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.h @@ -1,7 +1,7 @@ #ifndef Z_BG_ICE_TURARA_H #define Z_BG_ICE_TURARA_H -#include "ultra64.h" +#include #include "global.h" struct BgIceTurara; diff --git a/soh/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h b/soh/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h index 2137cc646..2d737ec63 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h +++ b/soh/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.h @@ -1,7 +1,7 @@ #ifndef Z_BG_INGATE_H #define Z_BG_INGATE_H -#include "ultra64.h" +#include #include "global.h" struct BgInGate; diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h b/soh/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h index 31ce5a7f4..385113f8f 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h +++ b/soh/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.h @@ -1,7 +1,7 @@ #ifndef Z_BG_JYA_1FLIFT_H #define Z_BG_JYA_1FLIFT_H -#include "ultra64.h" +#include #include "global.h" struct BgJya1flift; diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.h b/soh/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.h index e15a42fe8..bc0cdf0bd 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.h +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.h @@ -1,7 +1,7 @@ #ifndef Z_BG_JYA_AMISHUTTER_H #define Z_BG_JYA_AMISHUTTER_H -#include "ultra64.h" +#include #include "global.h" struct BgJyaAmishutter; diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h b/soh/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h index 298d95692..5837a3435 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.h @@ -1,7 +1,7 @@ #ifndef Z_BG_JYA_BIGMIRROR_H #define Z_BG_JYA_BIGMIRROR_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h" diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.h b/soh/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.h index 2d58de5c1..d382ce945 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.h +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.h @@ -1,7 +1,7 @@ #ifndef Z_BG_JYA_BLOCK_H #define Z_BG_JYA_BLOCK_H -#include "ultra64.h" +#include #include "global.h" struct BgJyaBlock; diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h b/soh/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h index e93616710..886ff1505 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.h @@ -1,7 +1,7 @@ #ifndef Z_BG_JYA_BOMBCHUIWA_H #define Z_BG_JYA_BOMBCHUIWA_H -#include "ultra64.h" +#include #include "global.h" struct BgJyaBombchuiwa; diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h b/soh/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h index 879291f87..82e71b302 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.h @@ -1,7 +1,7 @@ #ifndef Z_BG_JYA_BOMBIWA_H #define Z_BG_JYA_BOMBIWA_H -#include "ultra64.h" +#include #include "global.h" diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index 414036a94..4df085747 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -443,7 +443,7 @@ void func_80896950(BgJyaCobra* this, PlayState* play) { if (this->dyna.unk_150 > 0.001f) { this->unk_168++; - if (this->unk_168 >= (15 - CVar_GetS32("gFasterBlockPush", 0) * 2)) { + if (this->unk_168 >= (15 - CVarGetInteger("gFasterBlockPush", 0) * 2)) { func_808969F8(this, play); } } else { @@ -478,7 +478,7 @@ void func_808969F8(BgJyaCobra* this, PlayState* play) { this->unk_174.z = player->actor.world.pos.z - this->dyna.actor.world.pos.z; this->unk_170 = 0; this->unk_172 = true; - this->unk_16E = CVar_GetS32("gFasterBlockPush", 0) * 20; + this->unk_16E = CVarGetInteger("gFasterBlockPush", 0) * 20; } void func_80896ABC(BgJyaCobra* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h b/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h index 48dfed51b..8cc7ed0f9 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.h @@ -1,7 +1,7 @@ #ifndef Z_BG_JYA_COBRA_H #define Z_BG_JYA_COBRA_H -#include "ultra64.h" +#include #include "global.h" struct BgJyaCobra; diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h b/soh/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h index 272247548..275279b0e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.h @@ -1,7 +1,7 @@ #ifndef Z_BG_JYA_GOROIWA_H #define Z_BG_JYA_GOROIWA_H -#include "ultra64.h" +#include #include "global.h" struct BgJyaGoroiwa; diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h b/soh/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h index 60f9c6ef9..ca93c4f90 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Haheniron/z_bg_jya_haheniron.h @@ -1,7 +1,7 @@ #ifndef Z_BG_JYA_HAHENIRON_H #define Z_BG_JYA_HAHENIRON_H -#include "ultra64.h" +#include #include "global.h" struct BgJyaHaheniron; diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h b/soh/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h index a8189049a..c2c84534d 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.h @@ -1,7 +1,7 @@ #ifndef Z_BG_JYA_IRONOBJ_H #define Z_BG_JYA_IRONOBJ_H -#include "ultra64.h" +#include #include "global.h" struct BgJyaIronobj; diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.h b/soh/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.h index 6e5d670fd..16e2030be 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.h +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.h @@ -1,7 +1,7 @@ #ifndef Z_BG_JYA_KANAAMI_H #define Z_BG_JYA_KANAAMI_H -#include "ultra64.h" +#include #include "global.h" struct BgJyaKanaami; 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 2ca35dc04..7b9772cb0 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 @@ -99,7 +99,7 @@ void BgJyaLift_DelayMove(BgJyaLift* this, PlayState* play) { // The cutscene of the platform lowering will show the central room in an unloaded state if // Link is not standing on the platform as it lowers. Therefore check for the Sunlight arrows // enhancement and if it's enabled, check that Link is on the platform. Otherwise skip it. - if (!(CVar_GetS32("gSunlightArrows", 0) || Randomizer_GetSettingValue(RSK_SUNLIGHT_ARROWS)) || + if (!(CVarGetInteger("gSunlightArrows", 0) || Randomizer_GetSettingValue(RSK_SUNLIGHT_ARROWS)) || (GET_PLAYER(play)->actor.world.pos.x > -19.0f && GET_PLAYER(play)->actor.world.pos.x < 139.0f && GET_PLAYER(play)->actor.world.pos.z > -1172.0f && diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h b/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h index b6c951dc1..72cd0909e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.h @@ -1,7 +1,7 @@ #ifndef Z_BG_JYA_LIFT_H #define Z_BG_JYA_LIFT_H -#include "ultra64.h" +#include #include "global.h" struct BgJyaLift; diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h b/soh/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h index 467444c74..d0c873bcd 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.h @@ -1,7 +1,7 @@ #ifndef Z_BG_JYA_MEGAMI_H #define Z_BG_JYA_MEGAMI_H -#include "ultra64.h" +#include #include "global.h" struct BgJyaMegami; diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.h b/soh/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.h index 683f68199..a5139f84f 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.h +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.h @@ -1,7 +1,7 @@ #ifndef Z_BG_JYA_ZURERUKABE_H #define Z_BG_JYA_ZURERUKABE_H -#include "ultra64.h" +#include #include "global.h" struct BgJyaZurerukabe; diff --git a/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h b/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h index cf27ca182..83b835380 100644 --- a/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h +++ b/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MENKURI_EYE_H #define Z_BG_MENKURI_EYE_H -#include "ultra64.h" +#include #include "global.h" struct BgMenkuriEye; diff --git a/soh/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.h b/soh/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.h index c65b08d6e..8e3b584df 100644 --- a/soh/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.h +++ b/soh/src/overlays/actors/ovl_Bg_Menkuri_Kaiten/z_bg_menkuri_kaiten.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MENKURI_KAITEN_H #define Z_BG_MENKURI_KAITEN_H -#include "ultra64.h" +#include #include "global.h" struct BgMenkuriKaiten; diff --git a/soh/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.h b/soh/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.h index f7cb56a5b..eb6d1bf7f 100644 --- a/soh/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.h +++ b/soh/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MENKURI_NISEKABE_H #define Z_BG_MENKURI_NISEKABE_H -#include "ultra64.h" +#include #include "global.h" struct BgMenkuriNisekabe; diff --git a/soh/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h b/soh/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h index 37c0fe2b3..3ab2c5ca3 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h +++ b/soh/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MIZU_BWALL_H #define Z_BG_MIZU_BWALL_H -#include "ultra64.h" +#include #include "global.h" struct BgMizuBwall; diff --git a/soh/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h b/soh/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h index 8b5218e4b..42a6042e0 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h +++ b/soh/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MIZU_MOVEBG_H #define Z_BG_MIZU_MOVEBG_H -#include "ultra64.h" +#include #include "global.h" struct BgMizuMovebg; diff --git a/soh/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h b/soh/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h index af4d34035..1864b0639 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h +++ b/soh/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MIZU_SHUTTER_H #define Z_BG_MIZU_SHUTTER_H -#include "ultra64.h" +#include #include "global.h" #define BGMIZUSHUTTER_PARAM(size, timer, switchFlag) (size << 0xC) | (timer << 0x6) | switchFlag diff --git a/soh/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.h b/soh/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.h index 94e6b3c9d..f91c2175a 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.h +++ b/soh/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MIZU_UZU_H #define Z_BG_MIZU_UZU_H -#include "ultra64.h" +#include #include "global.h" struct BgMizuUzu; diff --git a/soh/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h b/soh/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h index 21196022f..30d429df6 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h +++ b/soh/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MIZU_WATER_H #define Z_BG_MIZU_WATER_H -#include "ultra64.h" +#include #include "global.h" struct BgMizuWater; diff --git a/soh/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h b/soh/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h index 415625574..142b92e0f 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h +++ b/soh/src/overlays/actors/ovl_Bg_Mjin/z_bg_mjin.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MJIN_H #define Z_BG_MJIN_H -#include "ultra64.h" +#include #include "global.h" struct BgMjin; diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index eb5716009..82e6e50c3 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -216,7 +216,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, PlayState* play) { void BgMoriBigst_StalfosPairFight(BgMoriBigst* this, PlayState* play) { if ((this->dyna.actor.home.rot.z == 0 || // Check if all enemies are defeated instead of the regular stalfos when enemy randomizer or crowd control is on. - (Flags_GetTempClear(play, this->dyna.actor.room) && (CVar_GetS32("gRandomizedEnemies", 0) || (CVar_GetS32("gCrowdControl", 0))))) && + (Flags_GetTempClear(play, this->dyna.actor.room) && (CVarGetInteger("gRandomizedEnemies", 0) || (CVarGetInteger("gCrowdControl", 0))))) && !Player_InCsMode(play)) { Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); BgMoriBigst_SetupDone(this, play); diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h b/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h index c2a97444e..8b2cc446b 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MORI_BIGST_H #define Z_BG_MORI_BIGST_H -#include "ultra64.h" +#include #include "global.h" struct BgMoriBigst; diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h b/soh/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h index a981c71dd..aa29444e9 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MORI_ELEVATOR_H #define Z_BG_MORI_ELEVATOR_H -#include "ultra64.h" +#include #include "global.h" struct BgMoriElevator; diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h b/soh/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h index 35281d5c7..ea53bdf01 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MORI_HASHIGO_H #define Z_BG_MORI_HASHIGO_H -#include "ultra64.h" +#include #include "global.h" struct BgMoriHashigo; diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h b/soh/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h index 797688bdb..a4b3ea4c1 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MORI_HASHIRA4_H #define Z_BG_MORI_HASHIRA4_H -#include "ultra64.h" +#include #include "global.h" struct BgMoriHashira4; diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h b/soh/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h index e42c23a43..9da801cba 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MORI_HINERI_H #define Z_BG_MORI_HINERI_H -#include "ultra64.h" +#include #include "global.h" struct BgMoriHineri; diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h b/soh/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h index d2e6f173a..ac984c7b2 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MORI_IDOMIZU_H #define Z_BG_MORI_IDOMIZU_H -#include "ultra64.h" +#include #include "global.h" struct BgMoriIdomizu; diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c b/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c index 2a2cfc004..645d5cc56 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c @@ -94,7 +94,7 @@ void BgMoriKaitenkabe_Wait(BgMoriKaitenkabe* this, PlayState* play) { if (this->dyna.unk_150 > 0.001f) { this->timer++; - if ((this->timer > (28 - CVar_GetS32("gFasterBlockPush", 0) * 4)) && !Player_InCsMode(play)) { + if ((this->timer > (28 - CVarGetInteger("gFasterBlockPush", 0) * 4)) && !Player_InCsMode(play)) { BgMoriKaitenkabe_SetupRotate(this); func_8002DF54(play, &this->dyna.actor, 8); Math_Vec3f_Copy(&this->lockedPlayerPos, &player->actor.world.pos); @@ -118,7 +118,7 @@ void BgMoriKaitenkabe_Wait(BgMoriKaitenkabe* this, PlayState* play) { void BgMoriKaitenkabe_SetupRotate(BgMoriKaitenkabe* this) { this->actionFunc = BgMoriKaitenkabe_Rotate; - this->rotSpeed = CVar_GetS32("gFasterBlockPush", 0) * 0.1f; + this->rotSpeed = CVarGetInteger("gFasterBlockPush", 0) * 0.1f; this->rotYdeg = 0.0f; } diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h b/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h index 05272c6f2..e51910fc8 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MORI_KAITENKABE_H #define Z_BG_MORI_KAITENKABE_H -#include "ultra64.h" +#include #include "global.h" struct BgMoriKaitenkabe; diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h b/soh/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h index b263892f0..559064ffa 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.h @@ -1,7 +1,7 @@ #ifndef Z_BG_MORI_RAKKATENJO_H #define Z_BG_MORI_RAKKATENJO_H -#include "ultra64.h" +#include #include "global.h" struct BgMoriRakkatenjo; diff --git a/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index 823fdd55e..ae6b789ac 100644 --- a/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -387,7 +387,7 @@ void BgPoEvent_BlockPush(BgPoEvent* this, PlayState* play) { s32 blockStop; Player* player = GET_PLAYER(play); - this->dyna.actor.speedXZ = this->dyna.actor.speedXZ + (CVar_GetS32("gFasterBlockPush", 0) * 0.3) + 0.5f; + this->dyna.actor.speedXZ = this->dyna.actor.speedXZ + (CVarGetInteger("gFasterBlockPush", 0) * 0.3) + 0.5f; this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f); blockStop = Math_StepToF(&sBgPoEventblockPushDist, 20.0f, this->dyna.actor.speedXZ); displacement = this->direction * sBgPoEventblockPushDist; @@ -403,7 +403,7 @@ void BgPoEvent_BlockPush(BgPoEvent* this, PlayState* play) { this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; sBgPoEventblockPushDist = 0.0f; this->dyna.actor.speedXZ = 0.0f; - this->direction = 5 - ((CVar_GetS32("gFasterBlockPush", 0) * 3) / 5); + this->direction = 5 - ((CVarGetInteger("gFasterBlockPush", 0) * 3) / 5); sBgPoEventBlocksAtRest++; this->actionFunc = BgPoEvent_BlockIdle; if (this->type == 1) { diff --git a/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h b/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h index 412c18722..d5d6226ec 100644 --- a/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h +++ b/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.h @@ -1,7 +1,7 @@ #ifndef Z_BG_PO_EVENT_H #define Z_BG_PO_EVENT_H -#include "ultra64.h" +#include #include "global.h" struct BgPoEvent; diff --git a/soh/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h b/soh/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h index 8bb84f0fe..4dd0bfa91 100644 --- a/soh/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h +++ b/soh/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.h @@ -1,7 +1,7 @@ #ifndef Z_BG_PO_SYOKUDAI_H #define Z_BG_PO_SYOKUDAI_H -#include "ultra64.h" +#include #include "global.h" struct BgPoSyokudai; diff --git a/soh/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h b/soh/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h index 577ebaabb..213fc9121 100644 --- a/soh/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h +++ b/soh/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.h @@ -1,7 +1,7 @@ #ifndef Z_BG_PUSHBOX_H #define Z_BG_PUSHBOX_H -#include "ultra64.h" +#include #include "global.h" struct BgPushbox; diff --git a/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.h b/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.h index 802d84064..e9bfdfe75 100644 --- a/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.h +++ b/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.h @@ -1,7 +1,7 @@ #ifndef Z_BG_RELAY_OBJECTS_H #define Z_BG_RELAY_OBJECTS_H -#include "ultra64.h" +#include #include "global.h" struct BgRelayObjects; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.h b/soh/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.h index de282476d..cd76da79e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT00_BREAK_H #define Z_BG_SPOT00_BREAK_H -#include "ultra64.h" +#include #include "global.h" diff --git a/soh/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.h b/soh/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.h index fc6427ae8..6bc63b5d9 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT00_HANEBASI_H #define Z_BG_SPOT00_HANEBASI_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot00Hanebasi; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c b/soh/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c index c51c19d37..311945dff 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.c @@ -60,8 +60,8 @@ void func_808AAA50(BgSpot01Fusya* this, PlayState* play) { f32 temp; Actor* thisx = &this->actor; - if (CVar_GetS32("gCosmetics.Kak_Windmill_Speed.Changed", 0)) { - this->unk_158 = CVar_GetFloat("gCosmetics.Kak_Windmill_Speed.Value", 100.0f); + if (CVarGetInteger("gCosmetics.Kak_Windmill_Speed.Changed", 0)) { + this->unk_158 = CVarGetFloat("gCosmetics.Kak_Windmill_Speed.Value", 100.0f); } else { this->unk_158 = 100.0f; } diff --git a/soh/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.h b/soh/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.h index 1e7a83131..f9b350318 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot01_Fusya/z_bg_spot01_fusya.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT01_FUSYA_H #define Z_BG_SPOT01_FUSYA_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot01Fusya; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.h b/soh/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.h index 216008321..919a7d1e9 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT01_IDOHASHIRA_H #define Z_BG_SPOT01_IDOHASHIRA_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot01Idohashira; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.h b/soh/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.h index 3c5929714..571b0a8aa 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot01_Idomizu/z_bg_spot01_idomizu.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT01_IDOMIZU_H #define Z_BG_SPOT01_IDOMIZU_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot01Idomizu; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.h b/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.h index c17b0a43e..b6e45525e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT01_IDOSOKO_H #define Z_BG_SPOT01_IDOSOKO_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot01Idosoko; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h b/soh/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h index 1da5f4f3f..5b4c3b1ae 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT01_OBJECTS2_H #define Z_BG_SPOT01_OBJECTS2_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot01Objects2; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h b/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h index 873fe15a5..0b54fa617 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT02_OBJECTS_H #define Z_BG_SPOT02_OBJECTS_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot02Objects; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h b/soh/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h index 3055fb7f8..60d820bdb 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT03_TAKI_H #define Z_BG_SPOT03_TAKI_H -#include "ultra64.h" +#include #include "global.h" typedef enum { diff --git a/soh/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h b/soh/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h index 849e5b226..27f2bdd18 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT05_SOKO_H #define Z_BG_SPOT05_SOKO_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot05Soko; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index c9e37943e..7f5a40f3e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -244,7 +244,7 @@ void BgSpot06Objects_GateSpawnBubbles(BgSpot06Objects* this, PlayState* play) { void BgSpot06Objects_GateWaitForSwitch(BgSpot06Objects* this, PlayState* play) { s32 i; - if ((CVar_GetS32("gWaterTempleGateFix", 0) == 0 || LINK_IS_ADULT) && Flags_GetSwitch(play, this->switchFlag)) { + if ((CVarGetInteger("gWaterTempleGateFix", 0) == 0 || LINK_IS_ADULT) && Flags_GetSwitch(play, this->switchFlag)) { this->timer = 100; this->dyna.actor.world.pos.y += 3.0f; this->actionFunc = BgSpot06Objects_GateWaitToOpen; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h b/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h index 08fdf1e9a..061f751a1 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT06_OBJECTS_H #define Z_BG_SPOT06_OBJECTS_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot06Objects; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h b/soh/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h index dcf6ef8ed..8f1e055b7 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT07_TAKI_H #define Z_BG_SPOT07_TAKI_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot07Taki; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h b/soh/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h index 3be139505..4fad67651 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT08_BAKUDANKABE_H #define Z_BG_SPOT08_BAKUDANKABE_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot08Bakudankabe; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.h b/soh/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.h index a59e3a356..65b102030 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT08_ICEBLOCK_H #define Z_BG_SPOT08_ICEBLOCK_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot08Iceblock; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h b/soh/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h index a09ce32ed..4fa2d40af 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT09_OBJ_H #define Z_BG_SPOT09_OBJ_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot09Obj; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.h b/soh/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.h index b18f5c084..8b6976f4b 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT11_BAKUDANKABE_H #define Z_BG_SPOT11_BAKUDANKABE_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot11Bakudankabe; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h b/soh/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h index cae716a00..b8dedcd54 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT11_OASIS_H #define Z_BG_SPOT11_OASIS_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot11Oasis; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h b/soh/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h index 2e9989fc2..205758893 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT12_GATE_H #define Z_BG_SPOT12_GATE_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot12Gate; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h b/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h index d96967300..ac5ea18dc 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT12_SAKU_H #define Z_BG_SPOT12_SAKU_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot12Saku; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index 3b90939aa..efb9350c3 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -260,7 +260,7 @@ void func_808B4194(BgSpot15Rrbox* this, PlayState* play) { s32 approxFResult; Actor* actor = &this->dyna.actor; - this->unk_174 = this->unk_174 + ((CVar_GetS32("gFasterBlockPush", 0) / 2) * 0.5) + 0.5f; + this->unk_174 = this->unk_174 + ((CVarGetInteger("gFasterBlockPush", 0) / 2) * 0.5) + 0.5f; this->unk_174 = CLAMP_MAX(this->unk_174, 2.0f); @@ -294,7 +294,7 @@ void func_808B4194(BgSpot15Rrbox* this, PlayState* play) { this->dyna.unk_150 = 0.0f; this->unk_178 = 0.0f; this->unk_174 = 0.0f; - this->unk_168 = 10 - ((CVar_GetS32("gFasterBlockPush", 0) * 3) / 2); + this->unk_168 = 10 - ((CVarGetInteger("gFasterBlockPush", 0) * 3) / 2); func_808B4084(this, play); } Audio_PlayActorSound2(actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); diff --git a/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h b/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h index d0178e7d0..4b00bd91b 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT15_RRBOX_H #define Z_BG_SPOT15_RRBOX_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot15Rrbox; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h b/soh/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h index f7ac8d09c..e10b8e5d3 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT15_SAKU_H #define Z_BG_SPOT15_SAKU_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot15Saku; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h b/soh/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h index 499b01031..7c5b3654b 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT16_BOMBSTONE_H #define Z_BG_SPOT16_BOMBSTONE_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot16Bombstone; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h b/soh/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h index 051e45cf5..42f74cf16 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT16_DOUGHNUT_H #define Z_BG_SPOT16_DOUGHNUT_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot16Doughnut; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.h b/soh/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.h index 892843540..3c5d8dc82 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT17_BAKUDANKABE_H #define Z_BG_SPOT17_BAKUDANKABE_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot17Bakudankabe; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h b/soh/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h index 6a44fa14c..8f4b314ec 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot17_Funen/z_bg_spot17_funen.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT17_FUNEN_H #define Z_BG_SPOT17_FUNEN_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot17Funen; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index 7185ae110..30e63391a 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -297,7 +297,7 @@ void func_808B7F74(BgSpot18Basket* this) { shapeRotY = this->dyna.actor.shape.rot.y; this->actionFunc = func_808B7FC0; - if ((shapeRotY < -0x2E93) || (shapeRotY >= 0x7C19) || CVar_GetS32("gGoronPot", 0)) { + if ((shapeRotY < -0x2E93) || (shapeRotY >= 0x7C19) || CVarGetInteger("gGoronPot", 0)) { this->unk_218 = 2; } else if (shapeRotY < 0x26C2) { this->unk_218 = 1; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h b/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h index 21f4bc4f2..e218fc7b1 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT18_BASKET_H #define Z_BG_SPOT18_BASKET_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot18Basket; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.h b/soh/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.h index 1150611cd..6e93a7aef 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot18_Futa/z_bg_spot18_futa.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT18_FUTA_H #define Z_BG_SPOT18_FUTA_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot18Futa; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h b/soh/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h index 5e000f646..6befc5792 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT18_OBJ_H #define Z_BG_SPOT18_OBJ_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot18Obj; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.h b/soh/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.h index 161fa9bc9..cd65a3c06 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.h +++ b/soh/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SPOT18_SHUTTER_H #define Z_BG_SPOT18_SHUTTER_H -#include "ultra64.h" +#include #include "global.h" struct BgSpot18Shutter; diff --git a/soh/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h b/soh/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h index 04c9dcab6..98d9fb38c 100644 --- a/soh/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h +++ b/soh/src/overlays/actors/ovl_Bg_Sst_Floor/z_bg_sst_floor.h @@ -1,7 +1,7 @@ #ifndef Z_BG_SST_FLOOR_H #define Z_BG_SST_FLOOR_H -#include "ultra64.h" +#include #include "global.h" struct BgSstFloor; diff --git a/soh/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h b/soh/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h index d55aacc60..a6659bcae 100644 --- a/soh/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h +++ b/soh/src/overlays/actors/ovl_Bg_Toki_Hikari/z_bg_toki_hikari.h @@ -1,7 +1,7 @@ #ifndef Z_BG_TOKI_HIKARI_H #define Z_BG_TOKI_HIKARI_H -#include "ultra64.h" +#include #include "global.h" struct BgTokiHikari; diff --git a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h index 0a16201e6..b4e51a1fc 100644 --- a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h +++ b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.h @@ -1,7 +1,7 @@ #ifndef Z_BG_TOKI_SWD_H #define Z_BG_TOKI_SWD_H -#include "ultra64.h" +#include #include "global.h" struct BgTokiSwd; diff --git a/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h b/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h index dc5a5f545..7fe96cfa1 100644 --- a/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h +++ b/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h @@ -1,7 +1,7 @@ #ifndef Z_BG_TREEMOUTH_H #define Z_BG_TREEMOUTH_H -#include "ultra64.h" +#include #include "global.h" struct BgTreemouth; diff --git a/soh/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.h b/soh/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.h index 19142ec4c..565a03983 100644 --- a/soh/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.h +++ b/soh/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.h @@ -1,7 +1,7 @@ #ifndef Z_BG_UMAJUMP_H #define Z_BG_UMAJUMP_H -#include "ultra64.h" +#include #include "global.h" struct BgUmaJump; diff --git a/soh/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h b/soh/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h index 42fdf5cfb..f04fd6b6d 100644 --- a/soh/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h +++ b/soh/src/overlays/actors/ovl_Bg_Vb_Sima/z_bg_vb_sima.h @@ -1,7 +1,7 @@ #ifndef Z_BG_VB_SIMA_H #define Z_BG_VB_SIMA_H -#include "ultra64.h" +#include #include "global.h" struct BgVbSima; diff --git a/soh/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h b/soh/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h index 63105ab48..a11aeb9f0 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h +++ b/soh/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.h @@ -1,7 +1,7 @@ #ifndef Z_BG_YDAN_HASI_H #define Z_BG_YDAN_HASI_H -#include "ultra64.h" +#include #include "global.h" struct BgYdanHasi; diff --git a/soh/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h b/soh/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h index 72b753b83..d5be8c7df 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h +++ b/soh/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.h @@ -1,7 +1,7 @@ #ifndef Z_BG_YDAN_MARUTA_H #define Z_BG_YDAN_MARUTA_H -#include "ultra64.h" +#include #include "global.h" struct BgYdanMaruta; diff --git a/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h b/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h index e134ac6f2..58eae344c 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h +++ b/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.h @@ -1,7 +1,7 @@ #ifndef Z_BG_YDAN_SP_H #define Z_BG_YDAN_SP_H -#include "ultra64.h" +#include #include "global.h" struct BgYdanSp; diff --git a/soh/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h b/soh/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h index a5355defd..8b169336e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h +++ b/soh/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.h @@ -1,7 +1,7 @@ #ifndef Z_BG_ZG_H #define Z_BG_ZG_H -#include "ultra64.h" +#include #include "global.h" struct BgZg; 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 e486e1218..0c3760d63 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 @@ -57,7 +57,7 @@ static InitChainEntry sInitChain[] = { }; void func_808C1190(s16* arg0, u8* arg1, s16 arg2) { - arg0 = ResourceMgr_LoadTexByName(arg0); + arg0 = GetResourceDataByName(arg0, false); if (arg2[arg1] != 0) { arg0[arg2 / 2] = 0; @@ -65,7 +65,7 @@ void func_808C1190(s16* arg0, u8* arg1, s16 arg2) { } void func_808C11D0(s16* arg0, u8* arg1, s16 arg2) { - arg0 = ResourceMgr_LoadTexByName(arg0); + arg0 = GetResourceDataByName(arg0, false); if (arg1[arg2] != 0) { arg0[arg2] = 0; @@ -73,7 +73,7 @@ void func_808C11D0(s16* arg0, u8* arg1, s16 arg2) { } void func_808C1200(s16* arg0, u8* arg1, s16 arg2) { - arg0 = ResourceMgr_LoadTexByName(arg0); + arg0 = GetResourceDataByName(arg0, false); if (arg1[arg2] != 0) { arg0[arg2] = 0; @@ -83,7 +83,7 @@ void func_808C1200(s16* arg0, u8* arg1, s16 arg2) { void func_808C1230(s16* arg0, u8* arg1, s16 arg2) { s16 index; - arg0 = ResourceMgr_LoadTexByName(arg0); + arg0 = GetResourceDataByName(arg0, false); if (arg1[arg2] != 0) { index = ((arg2 & 0xF) + ((arg2 & 0xF0) * 2)); @@ -95,7 +95,7 @@ void func_808C1230(s16* arg0, u8* arg1, s16 arg2) { void func_808C1278(s16* arg0, u8* arg1, s16 arg2) { s16 index; - arg0 = ResourceMgr_LoadTexByName(arg0); + arg0 = GetResourceDataByName(arg0, false); if (arg1[arg2] != 0) { index = ((arg2 & 0xF) * 2) + ((arg2 & 0xF0) * 2); @@ -120,9 +120,9 @@ void func_808C12C4(u8* arg1, s16 arg2) { void func_808C1554(void* arg0, void* floorTex, s32 arg2, f32 arg3) { // Entering the King Dodongo boss battle was crashing when using only an mq otr // because it was trying to load a texture from a non-mq path - // HACK: LoadTexByName doesn't account for mq vs non-mq paths, LoadTexOrDListByName does. + // HACK: GetResourceDataByName doesn't account for mq vs non-mq paths, LoadTexOrDListByName does. arg0 = ResourceMgr_LoadTexOrDListByName(arg0); - floorTex = ResourceMgr_LoadTexByName(floorTex); + floorTex = GetResourceDataByName(floorTex, false); u16* temp_s3 = SEGMENTED_TO_VIRTUAL(arg0); u16* temp_s1 = SEGMENTED_TO_VIRTUAL(floorTex); @@ -221,8 +221,8 @@ void BossDodongo_Init(Actor* thisx, PlayState* play) { Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->items); if (Flags_GetClear(play, play->roomCtx.curRoom.num)) { // KD is dead - u16* LavaFloorTex = ResourceMgr_LoadTexByName(gDodongosCavernBossLavaFloorTex); - u16* LavaFloorRockTex = ResourceMgr_LoadTexByName(sLavaFloorRockTex); + u16* LavaFloorTex = GetResourceDataByName(gDodongosCavernBossLavaFloorTex, false); + u16* LavaFloorRockTex = GetResourceDataByName(sLavaFloorRockTex, false); temp_s1_3 = SEGMENTED_TO_VIRTUAL(LavaFloorTex); temp_s2 = SEGMENTED_TO_VIRTUAL(LavaFloorRockTex); Actor_Kill(&this->actor); @@ -1018,8 +1018,8 @@ void BossDodongo_Update(Actor* thisx, PlayState* play2) { } if (this->unk_1C6 != 0) { - u16* ptr1 = ResourceMgr_LoadTexByName(sLavaFloorLavaTex); - u16* ptr2 = ResourceMgr_LoadTexByName(sLavaFloorRockTex); + u16* ptr1 = GetResourceDataByName(sLavaFloorLavaTex, false); + u16* ptr2 = GetResourceDataByName(sLavaFloorRockTex, false); s16 i2; for (i2 = 0; i2 < 20; i2++) { diff --git a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h index e38cd2339..2a546540e 100644 --- a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h +++ b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h @@ -1,7 +1,7 @@ #ifndef Z_BOSS_DODONGO_H #define Z_BOSS_DODONGO_H -#include "ultra64.h" +#include #include "global.h" struct BossDodongo; diff --git a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h index 890b846dd..60d7ae152 100644 --- a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h +++ b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h @@ -1,7 +1,7 @@ #ifndef Z_BOSS_FD_H #define Z_BOSS_FD_H -#include "ultra64.h" +#include #include "global.h" struct BossFd; diff --git a/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h b/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h index cd7f82998..abea186fe 100644 --- a/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h +++ b/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.h @@ -1,7 +1,7 @@ #ifndef Z_BOSS_FD2_H #define Z_BOSS_FD2_H -#include "ultra64.h" +#include #include "global.h" struct BossFd2; 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 6fa26bab2..2e9f67752 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 @@ -1201,7 +1201,7 @@ void BossGanon_ShatterWindows(u8 windowShatterState) { // based on mq/nonmq. This will be handled properly with LUS 1.0 u8* tex1 = ResourceMgr_LoadTexOrDListByName(SEGMENTED_TO_VIRTUAL(ganon_boss_sceneTex_006C18)); u8* tex2 = ResourceMgr_LoadTexOrDListByName(SEGMENTED_TO_VIRTUAL(ganon_boss_sceneTex_007418)); - u8* templateTex = ResourceMgr_LoadTexByName(SEGMENTED_TO_VIRTUAL(gGanondorfWindowShatterTemplateTex)); + u8* templateTex = GetResourceDataByName(SEGMENTED_TO_VIRTUAL(gGanondorfWindowShatterTemplateTex), false); for (i = 0; i < 2048; i++) { if ((tex1[i] != 0) && (Rand_ZeroOne() < 0.03f)) { @@ -1216,7 +1216,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { static Color_RGBA8 bloodPrimColor = { 0, 120, 0, 255 }; static Color_RGBA8 bloodEnvColor = { 0, 120, 0, 255 }; - if(CVar_GetS32("gRedGanonBlood", 0)) { + if(CVarGetInteger("gRedGanonBlood", 0)) { bloodPrimColor.r = 120; bloodPrimColor.g = 0; @@ -5078,4 +5078,4 @@ void BossGanon_Reset(void) { sBossGanonZelda = NULL; sBossGanonCape = NULL; memset(sBossGanonEffectBuf, 0, sizeof(sBossGanonEffectBuf)); -} \ No newline at end of file +} diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h index 0e4b3e447..c92c07a3f 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h +++ b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h @@ -1,7 +1,7 @@ #ifndef Z_BOSS_GANON_H #define Z_BOSS_GANON_H -#include "ultra64.h" +#include #include "global.h" struct BossGanon; 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 7e8548800..96ecbefc4 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 @@ -1468,7 +1468,7 @@ void func_8090109C(BossGanon2* this, PlayState* play) { static Color_RGBA8 sPrimColor = { 0, 120, 0, 255 }; static Color_RGBA8 sEnvColor = { 0, 120, 0, 255 }; - if(CVar_GetS32("gRedGanonBlood", 0)) { + if(CVarGetInteger("gRedGanonBlood", 0)) { sPrimColor.r = 120; sPrimColor.g = 0; diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h index 667bb3712..06edeae9f 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h +++ b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h @@ -1,7 +1,7 @@ #ifndef Z_BOSS_GANON2_H #define Z_BOSS_GANON2_H -#include "ultra64.h" +#include #include "global.h" 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 f3d920c6b..3d28dd16d 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 @@ -211,20 +211,20 @@ static Vec3f sAudioVec = { 0.0f, 0.0f, 50.0f }; void BossGanondrof_ClearPixels8x8(s16* texture, u8* mask, s16 index) { if (mask[index]) { - ResourceMgr_WriteTexS16ByName(texture, index / 4, 0); + WriteTextureDataInt16ByName(texture, index / 4, 0, true); } } void BossGanondrof_ClearPixels16x8(s16* texture, u8* mask, s16 index) { if (mask[index]) { - ResourceMgr_WriteTexS16ByName(texture, index / 2, 0); + WriteTextureDataInt16ByName(texture, index / 2, 0, false); } } void BossGanondrof_ClearPixels16x16(s16* texture, u8* mask, s16 index, s16 bpp) { if (mask[index]) { - ResourceMgr_WriteTexS16ByName(texture, index, 0); + WriteTextureDataInt16ByName(texture, index, 0, false); } } @@ -232,8 +232,8 @@ void BossGanondrof_ClearPixels32x16(s16* texture, u8* mask, s16 index) { if (mask[index]) { s16 i = (index & 0xF) + ((index & 0xF0) << 1); - ResourceMgr_WriteTexS16ByName(texture, i + 0x10, 0); - ResourceMgr_WriteTexS16ByName(texture, i, 0); + WriteTextureDataInt16ByName(texture, i + 0x10, 0, false); + WriteTextureDataInt16ByName(texture, i, 0, false); } } @@ -241,8 +241,8 @@ void BossGanondrof_ClearPixels16x32(s16* texture, u8* mask, s16 index) { if (mask[index]) { s16 i = ((index & 0xF) * 2) + ((index & 0xF0) * 2); - ResourceMgr_WriteTexS16ByName(texture, i + 1, 0); - ResourceMgr_WriteTexS16ByName(texture, i, 0); + WriteTextureDataInt16ByName(texture, i + 1, 0, false); + WriteTextureDataInt16ByName(texture, i, 0, false); } } diff --git a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h index 2dad6b343..ff4a841d6 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h +++ b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.h @@ -1,7 +1,7 @@ #ifndef Z_BOSS_GANONDROF_H #define Z_BOSS_GANONDROF_H -#include "ultra64.h" +#include #include "global.h" struct BossGanondrof; 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 bb4f2dcc6..bcd29cf41 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 @@ -323,13 +323,13 @@ void BossGoma_ClearPixels32x32Rgba16(s16* rgba16image, u8* clearPixelTable, s16 * Clear pixels from Gohma's textures */ void BossGoma_ClearPixels(u8* clearPixelTable, s16 i) { - BossGoma_ClearPixels16x16Rgba16(ResourceMgr_LoadTexByName(SEGMENTED_TO_VIRTUAL(gGohmaBodyTex)), clearPixelTable, i); - BossGoma_ClearPixels16x16Rgba16(ResourceMgr_LoadTexByName(SEGMENTED_TO_VIRTUAL(gGohmaShellUndersideTex)), clearPixelTable, i); - BossGoma_ClearPixels16x16Rgba16(ResourceMgr_LoadTexByName(SEGMENTED_TO_VIRTUAL(gGohmaDarkShellTex)), clearPixelTable, i); - BossGoma_ClearPixels16x16Rgba16(ResourceMgr_LoadTexByName(SEGMENTED_TO_VIRTUAL(gGohmaEyeTex)), clearPixelTable, i); + BossGoma_ClearPixels16x16Rgba16(GetResourceDataByName(SEGMENTED_TO_VIRTUAL(gGohmaBodyTex), false), clearPixelTable, i); + BossGoma_ClearPixels16x16Rgba16(GetResourceDataByName(SEGMENTED_TO_VIRTUAL(gGohmaShellUndersideTex), false), clearPixelTable, i); + BossGoma_ClearPixels16x16Rgba16(GetResourceDataByName(SEGMENTED_TO_VIRTUAL(gGohmaDarkShellTex), false), clearPixelTable, i); + BossGoma_ClearPixels16x16Rgba16(GetResourceDataByName(SEGMENTED_TO_VIRTUAL(gGohmaEyeTex), false), clearPixelTable, i); - BossGoma_ClearPixels32x32Rgba16(ResourceMgr_LoadTexByName(SEGMENTED_TO_VIRTUAL(gGohmaShellTex)), clearPixelTable, i); - BossGoma_ClearPixels32x32Rgba16(ResourceMgr_LoadTexByName(SEGMENTED_TO_VIRTUAL(gGohmaIrisTex)), clearPixelTable, i); + BossGoma_ClearPixels32x32Rgba16(GetResourceDataByName(SEGMENTED_TO_VIRTUAL(gGohmaShellTex), false), clearPixelTable, i); + BossGoma_ClearPixels32x32Rgba16(GetResourceDataByName(SEGMENTED_TO_VIRTUAL(gGohmaIrisTex), false), clearPixelTable, i); } static InitChainEntry sInitChain[] = { @@ -452,7 +452,7 @@ void BossGoma_SetupCeilingIdle(BossGoma* this) { void BossGoma_SetupFallJump(BossGoma* this) { // When in Enemy Randomizer, reset the state of the spawned Gohma Larva because it's not done // by the (non-existent) Larva themselves. - if (CVar_GetS32("gRandomizedEnemies", 0)) { + if (CVarGetInteger("gRandomizedEnemies", 0)) { this->childrenGohmaState[0] = this->childrenGohmaState[1] = this->childrenGohmaState[2] = 0; } Animation_Change(&this->skelanime, &gGohmaLandAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -5.0f); @@ -1559,14 +1559,14 @@ void BossGoma_CeilingIdle(BossGoma* this, PlayState* play) { if (this->framesUntilNextAction == 0) { Actor* nearbyEnTest = NULL; - if (CVar_GetS32("gRandomizedEnemies", 0)) { + if (CVarGetInteger("gRandomizedEnemies", 0)) { nearbyEnTest = Actor_FindNearby(play, &this->actor, -1, ACTORCAT_ENEMY, 8000.0f); } if (this->childrenGohmaState[0] == 0 && this->childrenGohmaState[1] == 0 && this->childrenGohmaState[2] == 0) { // if no child gohma has been spawned BossGoma_SetupCeilingPrepareSpawnGohmas(this); } else if ((this->childrenGohmaState[0] < 0 && this->childrenGohmaState[1] < 0 && this->childrenGohmaState[2] < 0) || - (nearbyEnTest == NULL && CVar_GetS32("gRandomizedEnemies", 0))) { + (nearbyEnTest == NULL && CVarGetInteger("gRandomizedEnemies", 0))) { // In authentic gameplay, check if all baby Ghomas are dead. In Enemy Randomizer, check if there's no enemies alive. BossGoma_SetupFallJump(this); } else { diff --git a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h index d3a28858c..c342e0b88 100644 --- a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h +++ b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.h @@ -1,7 +1,7 @@ #ifndef Z_BOSS_GOMA_H #define Z_BOSS_GOMA_H -#include "ultra64.h" +#include #include "global.h" struct BossGoma; diff --git a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h index ae0c2c8e1..3a1e65330 100644 --- a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h +++ b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.h @@ -1,7 +1,7 @@ #ifndef Z_BOSS_MO_H #define Z_BOSS_MO_H -#include "ultra64.h" +#include #include "global.h" struct BossMo; diff --git a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h index 71a53c9f7..eb773cf75 100644 --- a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h +++ b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.h @@ -1,7 +1,7 @@ #ifndef Z_BOSS_SST_H #define Z_BOSS_SST_H -#include "ultra64.h" +#include #include "global.h" struct BossSst; diff --git a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h index df604bfb2..c49d4563d 100644 --- a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h +++ b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h @@ -1,7 +1,7 @@ #ifndef Z_BOSS_TW_H #define Z_BOSS_TW_H -#include "ultra64.h" +#include #include "global.h" typedef enum { diff --git a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.h b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.h index 3b5a1ab82..cb00261b8 100644 --- a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.h +++ b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.h @@ -1,7 +1,7 @@ #ifndef Z_BOSS_VA_H #define Z_BOSS_VA_H -#include "ultra64.h" +#include #include "global.h" struct BossVa; diff --git a/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h b/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h index 5d6a5367a..fccadd647 100644 --- a/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h +++ b/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.h @@ -1,7 +1,7 @@ #ifndef Z_DEMO_6K_H #define Z_DEMO_6K_H -#include "ultra64.h" +#include #include "global.h" struct Demo6K; diff --git a/soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.h b/soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.h index 12e509ff7..b8c50026e 100644 --- a/soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.h +++ b/soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.h @@ -1,7 +1,7 @@ #ifndef Z_DEMO_DU_H #define Z_DEMO_DU_H -#include "ultra64.h" +#include #include "global.h" struct DemoDu; diff --git a/soh/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h b/soh/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h index e39e0addc..f6af5a126 100644 --- a/soh/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h +++ b/soh/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.h @@ -1,7 +1,7 @@ #ifndef Z_DEMO_EC_H #define Z_DEMO_EC_H -#include "ultra64.h" +#include #include "global.h" struct DemoEc; diff --git a/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h b/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h index 7e89d8132..3511f662c 100644 --- a/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h +++ b/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.h @@ -1,7 +1,7 @@ #ifndef Z_DEMO_EFFECT_H #define Z_DEMO_EFFECT_H -#include "ultra64.h" +#include #include "global.h" struct DemoEffect; diff --git a/soh/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h b/soh/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h index 2805c474f..795998111 100644 --- a/soh/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h +++ b/soh/src/overlays/actors/ovl_Demo_Ext/z_demo_ext.h @@ -1,7 +1,7 @@ #ifndef Z_DEMO_EXT_H #define Z_DEMO_EXT_H -#include "ultra64.h" +#include #include "global.h" struct DemoExt; diff --git a/soh/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h b/soh/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h index a21eb64a2..bdc786395 100644 --- a/soh/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h +++ b/soh/src/overlays/actors/ovl_Demo_Geff/z_demo_geff.h @@ -1,7 +1,7 @@ #ifndef Z_DEMO_GEFF_H #define Z_DEMO_GEFF_H -#include "ultra64.h" +#include #include "global.h" #include "../ovl_Demo_Gt/z_demo_gt.h" diff --git a/soh/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h b/soh/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h index 0ff2f1bfb..1db8d63b4 100644 --- a/soh/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h +++ b/soh/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.h @@ -1,7 +1,7 @@ #ifndef Z_DEMO_GJ_H #define Z_DEMO_GJ_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h" diff --git a/soh/src/overlays/actors/ovl_Demo_Go/z_demo_go.h b/soh/src/overlays/actors/ovl_Demo_Go/z_demo_go.h index 969fdd8e0..d572e2f97 100644 --- a/soh/src/overlays/actors/ovl_Demo_Go/z_demo_go.h +++ b/soh/src/overlays/actors/ovl_Demo_Go/z_demo_go.h @@ -1,7 +1,7 @@ #ifndef Z_DEMO_GO_H #define Z_DEMO_GO_H -#include "ultra64.h" +#include #include "global.h" struct DemoGo; diff --git a/soh/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h b/soh/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h index 83cae1cc1..abbe4db7b 100644 --- a/soh/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h +++ b/soh/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.h @@ -1,7 +1,7 @@ #ifndef Z_DEMO_GT_H #define Z_DEMO_GT_H -#include "ultra64.h" +#include #include "global.h" struct DemoGt; diff --git a/soh/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h b/soh/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h index caae15f7b..0a99a2c34 100644 --- a/soh/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h +++ b/soh/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.h @@ -1,7 +1,7 @@ #ifndef Z_DEMO_IK_H #define Z_DEMO_IK_H -#include "ultra64.h" +#include #include "global.h" struct DemoIk; diff --git a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.h b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.h index 97192b39a..810909fab 100644 --- a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.h +++ b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.h @@ -1,7 +1,7 @@ #ifndef Z_DEMO_IM_H #define Z_DEMO_IM_H -#include "ultra64.h" +#include #include "global.h" struct DemoIm; diff --git a/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h b/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h index 89ad474b3..f4f626e8a 100644 --- a/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h +++ b/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.h @@ -1,7 +1,7 @@ #ifndef Z_DEMO_KANKYO_H #define Z_DEMO_KANKYO_H -#include "ultra64.h" +#include #include "global.h" struct DemoKankyo; diff --git a/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h b/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h index c6711097e..4e4a06c18 100644 --- a/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h +++ b/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h @@ -1,7 +1,7 @@ #ifndef Z_DEMO_KEKKAI_H #define Z_DEMO_KEKKAI_H -#include "ultra64.h" +#include #include "global.h" struct DemoKekkai; diff --git a/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h b/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h index 7801aca27..538cacbbb 100644 --- a/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h +++ b/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.h @@ -1,7 +1,7 @@ #ifndef Z_DEMO_SA_H #define Z_DEMO_SA_H -#include "ultra64.h" +#include #include "global.h" struct DemoSa; diff --git a/soh/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h b/soh/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h index fe9198f62..ecdfc7399 100644 --- a/soh/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h +++ b/soh/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.h @@ -1,7 +1,7 @@ #ifndef Z_DEMO_SHD_H #define Z_DEMO_SHD_H -#include "ultra64.h" +#include #include "global.h" struct DemoShd; diff --git a/soh/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h b/soh/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h index 7f03d6f1d..c3daa2404 100644 --- a/soh/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h +++ b/soh/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.h @@ -1,7 +1,7 @@ #ifndef Z_DEMO_TRE_LGT_H #define Z_DEMO_TRE_LGT_H -#include "ultra64.h" +#include #include "global.h" struct DemoTreLgt; diff --git a/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.h b/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.h index 51c24b84a..689fdc0b3 100644 --- a/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.h +++ b/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.h @@ -1,7 +1,7 @@ #ifndef Z_DOOR_ANA_H #define Z_DOOR_ANA_H -#include "ultra64.h" +#include #include "global.h" struct DoorAna; diff --git a/soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h b/soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h index fc545e0e0..b87b40807 100644 --- a/soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h +++ b/soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h @@ -1,7 +1,7 @@ #ifndef Z_DOOR_GERUDO_H #define Z_DOOR_GERUDO_H -#include "ultra64.h" +#include #include "global.h" struct DoorGerudo; diff --git a/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.h b/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.h index 2fe74808b..ea99f1b8f 100644 --- a/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.h +++ b/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.h @@ -1,7 +1,7 @@ #ifndef Z_DOOR_KILLER_H #define Z_DOOR_KILLER_H -#include "ultra64.h" +#include #include "global.h" /* diff --git a/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h b/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h index 029132210..6916f8832 100644 --- a/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h +++ b/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h @@ -1,7 +1,7 @@ #ifndef Z_DOOR_SHUTTER_H #define Z_DOOR_SHUTTER_H -#include "ultra64.h" +#include #include "global.h" /** diff --git a/soh/src/overlays/actors/ovl_Door_Toki/z_door_toki.h b/soh/src/overlays/actors/ovl_Door_Toki/z_door_toki.h index 35d4d4f91..36de15353 100644 --- a/soh/src/overlays/actors/ovl_Door_Toki/z_door_toki.h +++ b/soh/src/overlays/actors/ovl_Door_Toki/z_door_toki.h @@ -1,7 +1,7 @@ #ifndef Z_DOOR_TOKI_H #define Z_DOOR_TOKI_H -#include "ultra64.h" +#include #include "global.h" struct DoorToki; diff --git a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h index 09e00fbfd..f1cd146f1 100644 --- a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h +++ b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.h @@ -1,7 +1,7 @@ #ifndef Z_DOOR_WARP1_H #define Z_DOOR_WARP1_H -#include "ultra64.h" +#include #include "global.h" struct DoorWarp1; diff --git a/soh/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h b/soh/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h index ab0b7f0b3..b4a2b328f 100644 --- a/soh/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h +++ b/soh/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.h @@ -1,7 +1,7 @@ #ifndef Z_EFC_ERUPC_H #define Z_EFC_ERUPC_H -#include "ultra64.h" +#include #include "global.h" struct EfcErupc; diff --git a/soh/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h b/soh/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h index d5eeaffed..5dc112978 100644 --- a/soh/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h +++ b/soh/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_DUST_H #define Z_EFF_DUST_H -#include "ultra64.h" +#include #include "global.h" struct EffDust; diff --git a/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index cd1a7822a..2433343e5 100644 --- a/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -110,7 +110,7 @@ void ElfMsg_Destroy(Actor* thisx, PlayState* play) { s32 ElfMsg_GetMessageId(ElfMsg* this) { // Negative message ID forces link to talk to Navi - if (this->actor.params & 0x8000 || CVar_GetS32("gNoForcedNavi", 0) != 0) { + if (this->actor.params & 0x8000 || CVarGetInteger("gNoForcedNavi", 0) != 0) { return (this->actor.params & 0xFF) + 0x100; } else { return -((this->actor.params & 0xFF) + 0x100); diff --git a/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h b/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h index ba523060f..ce661efeb 100644 --- a/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h +++ b/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.h @@ -1,7 +1,7 @@ #ifndef Z_ELF_MSG_H #define Z_ELF_MSG_H -#include "ultra64.h" +#include #include "global.h" struct ElfMsg; diff --git a/soh/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h b/soh/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h index 802769f2b..7aa3c702d 100644 --- a/soh/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h +++ b/soh/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.h @@ -1,7 +1,7 @@ #ifndef Z_ELF_MSG2_H #define Z_ELF_MSG2_H -#include "ultra64.h" +#include #include "global.h" struct ElfMsg2; 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 15c75bf63..44d6f036c 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 @@ -667,7 +667,7 @@ void EnAm_Statue(EnAm* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 temp158f = this->dyna.unk_158; s16 moveDir = 0; - s32 blockSpeed = CVar_GetS32("gFasterBlockPush", 0); + s32 blockSpeed = CVarGetInteger("gFasterBlockPush", 0); if (this->unk_258 == 0) { if (this->dyna.unk_150 != 0.0f) { diff --git a/soh/src/overlays/actors/ovl_En_Am/z_en_am.h b/soh/src/overlays/actors/ovl_En_Am/z_en_am.h index 61e9042f9..22c40f36c 100644 --- a/soh/src/overlays/actors/ovl_En_Am/z_en_am.h +++ b/soh/src/overlays/actors/ovl_En_Am/z_en_am.h @@ -1,7 +1,7 @@ #ifndef Z_EN_AM_H #define Z_EN_AM_H -#include "ultra64.h" +#include #include "global.h" struct EnAm; diff --git a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.h b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.h index 99bad6e1c..193363e24 100644 --- a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.h +++ b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ANI_H #define Z_EN_ANI_H -#include "ultra64.h" +#include #include "global.h" struct EnAni; diff --git a/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h b/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h index cea8a86de..3c1de8923 100644 --- a/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h +++ b/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ANUBICE_H #define Z_EN_ANUBICE_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h" diff --git a/soh/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c b/soh/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c index e262d1cdb..eb440f411 100644 --- a/soh/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c +++ b/soh/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c @@ -116,7 +116,7 @@ void func_809B27D8(EnAnubiceFire* this, PlayState* play) { Audio_PlayActorSound2(&this->actor, NA_SE_IT_SHIELD_REFLECT_SW); this->cylinder.base.atFlags &= 0xFFE9; this->cylinder.base.atFlags |= 8; - this->cylinder.info.toucher.dmgFlags = CVar_GetS32("gAnubisFix", 0) ? 0x800 : 2; + this->cylinder.info.toucher.dmgFlags = CVarGetInteger("gAnubisFix", 0) ? 0x800 : 2; this->unk_15A = 30; this->actor.params = 1; this->actor.velocity.x *= -1.0f; diff --git a/soh/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.h b/soh/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.h index 1039066bc..92c7135ef 100644 --- a/soh/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.h +++ b/soh/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ANUBICE_FIRE_H #define Z_EN_ANUBICE_FIRE_H -#include "ultra64.h" +#include #include "global.h" struct EnAnubiceFire; diff --git a/soh/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h b/soh/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h index 4aebaa0a6..9d9535e84 100644 --- a/soh/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h +++ b/soh/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ANUBICE_TAG_H #define Z_EN_ANUBICE_TAG_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_En_Anubice/z_en_anubice.h" diff --git a/soh/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.h b/soh/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.h index e29f84d2b..cbbb696d4 100644 --- a/soh/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.h +++ b/soh/src/overlays/actors/ovl_En_Arow_Trap/z_en_arow_trap.h @@ -1,7 +1,7 @@ #ifndef Z_EN_AROW_TRAP_H #define Z_EN_AROW_TRAP_H -#include "ultra64.h" +#include #include "global.h" #include "z64.h" diff --git a/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index 96900dd82..fb33ed6a0 100644 --- a/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -84,46 +84,46 @@ void EnArrow_Init(Actor* thisx, PlayState* play) { }; EnArrow* this = (EnArrow*)thisx; - if (CVar_GetS32("gCosmetics.Arrows_NormalPrimary.Changed", 0)) { - blureNormal.altEnvColor = CVar_GetRGBA("gCosmetics.Arrows_NormalPrimary.Value", (Color_RGBA8){ 0, 150, 0, 0 }); + if (CVarGetInteger("gCosmetics.Arrows_NormalPrimary.Changed", 0)) { + blureNormal.altEnvColor = CVarGetColor("gCosmetics.Arrows_NormalPrimary.Value", (Color_RGBA8){ 0, 150, 0, 0 }); } else { blureNormal.altEnvColor = (Color_RGBA8){ 0, 150, 0, 0 }; } - if (CVar_GetS32("gCosmetics.Arrows_NormalSecondary.Changed", 0)) { - blureNormal.altPrimColor = CVar_GetRGBA("gCosmetics.Arrows_NormalSecondary.Value", (Color_RGBA8){ 255, 255, 170, 255 }); + if (CVarGetInteger("gCosmetics.Arrows_NormalSecondary.Changed", 0)) { + blureNormal.altPrimColor = CVarGetColor("gCosmetics.Arrows_NormalSecondary.Value", (Color_RGBA8){ 255, 255, 170, 255 }); } else { blureNormal.altPrimColor = (Color_RGBA8){ 255, 255, 170, 255 }; } - if (CVar_GetS32("gCosmetics.Arrows_FirePrimary.Changed", 0)) { - blureFire.altEnvColor = CVar_GetRGBA("gCosmetics.Arrows_FirePrimary.Value", (Color_RGBA8){ 255, 200, 0, 0 }); + if (CVarGetInteger("gCosmetics.Arrows_FirePrimary.Changed", 0)) { + blureFire.altEnvColor = CVarGetColor("gCosmetics.Arrows_FirePrimary.Value", (Color_RGBA8){ 255, 200, 0, 0 }); } else { blureFire.altEnvColor = (Color_RGBA8){ 255, 200, 0, 0 }; } - if (CVar_GetS32("gCosmetics.Arrows_FireSecondary.Changed", 0)) { - blureFire.altPrimColor = CVar_GetRGBA("gCosmetics.Arrows_FireSecondary.Value", (Color_RGBA8){ 255, 0, 0, 255 }); + if (CVarGetInteger("gCosmetics.Arrows_FireSecondary.Changed", 0)) { + blureFire.altPrimColor = CVarGetColor("gCosmetics.Arrows_FireSecondary.Value", (Color_RGBA8){ 255, 0, 0, 255 }); } else { blureFire.altPrimColor = (Color_RGBA8){ 255, 0, 0, 255 }; } - if (CVar_GetS32("gCosmetics.Arrows_IcePrimary.Changed", 0)) { - blureIce.altEnvColor = CVar_GetRGBA("gCosmetics.Arrows_IcePrimary.Value", (Color_RGBA8){ 0, 0, 255, 255 }); + if (CVarGetInteger("gCosmetics.Arrows_IcePrimary.Changed", 0)) { + blureIce.altEnvColor = CVarGetColor("gCosmetics.Arrows_IcePrimary.Value", (Color_RGBA8){ 0, 0, 255, 255 }); } else { blureIce.altEnvColor = (Color_RGBA8){ 0, 0, 255, 255 }; } - if (CVar_GetS32("gCosmetics.Arrows_IceSecondary.Changed", 0)) { - blureIce.altPrimColor = CVar_GetRGBA("gCosmetics.Arrows_IceSecondary.Value", (Color_RGBA8){ 170, 255, 255, 0 }); + if (CVarGetInteger("gCosmetics.Arrows_IceSecondary.Changed", 0)) { + blureIce.altPrimColor = CVarGetColor("gCosmetics.Arrows_IceSecondary.Value", (Color_RGBA8){ 170, 255, 255, 0 }); } else { blureIce.altPrimColor = (Color_RGBA8){ 170, 255, 255, 0 }; } - if (CVar_GetS32("gCosmetics.Arrows_LightPrimary.Changed", 0)) { - blureLight.altEnvColor = CVar_GetRGBA("gCosmetics.Arrows_LightPrimary.Value", (Color_RGBA8){ 255, 255, 0, 255 }); + if (CVarGetInteger("gCosmetics.Arrows_LightPrimary.Changed", 0)) { + blureLight.altEnvColor = CVarGetColor("gCosmetics.Arrows_LightPrimary.Value", (Color_RGBA8){ 255, 255, 0, 255 }); } else { blureLight.altEnvColor = (Color_RGBA8){ 255, 255, 0, 255 }; } - if (CVar_GetS32("gCosmetics.Arrows_LightSecondary.Changed", 0)) { - blureLight.altPrimColor = CVar_GetRGBA("gCosmetics.Arrows_LightSecondary.Value", (Color_RGBA8){ 255, 255, 170, 0 }); + if (CVarGetInteger("gCosmetics.Arrows_LightSecondary.Changed", 0)) { + blureLight.altPrimColor = CVarGetColor("gCosmetics.Arrows_LightSecondary.Value", (Color_RGBA8){ 255, 255, 170, 0 }); } else { blureLight.altPrimColor = (Color_RGBA8){ 255, 255, 170, 0 }; } diff --git a/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h b/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h index f250cafe3..4ee84d331 100644 --- a/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h +++ b/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ARROW_H #define Z_EN_ARROW_H -#include "ultra64.h" +#include #include "global.h" struct EnArrow; diff --git a/soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h b/soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h index 381b6a2aa..8b18f6b47 100644 --- a/soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h +++ b/soh/src/overlays/actors/ovl_En_Attack_Niw/z_en_attack_niw.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ATTACK_NIW_H #define Z_EN_ATTACK_NIW_H -#include "ultra64.h" +#include #include "global.h" struct EnAttackNiw; diff --git a/soh/src/overlays/actors/ovl_En_Ba/z_en_ba.h b/soh/src/overlays/actors/ovl_En_Ba/z_en_ba.h index 6d5acc902..80902fa9d 100644 --- a/soh/src/overlays/actors/ovl_En_Ba/z_en_ba.h +++ b/soh/src/overlays/actors/ovl_En_Ba/z_en_ba.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BA_H #define Z_EN_BA_H -#include "ultra64.h" +#include #include "global.h" struct EnBa; diff --git a/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.h b/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.h index 693ff8284..a91021c1b 100644 --- a/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.h +++ b/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BB_H #define Z_EN_BB_H -#include "ultra64.h" +#include #include "global.h" struct EnBb; diff --git a/soh/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h b/soh/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h index 93b37e3b1..5f85fa11c 100644 --- a/soh/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h +++ b/soh/src/overlays/actors/ovl_En_Bdfire/z_en_bdfire.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BDFIRE_H #define Z_EN_BDFIRE_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.h" diff --git a/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h b/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h index fc6ca9ac7..83e0d12e9 100644 --- a/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h +++ b/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BIGOKUTA_H #define Z_EN_BIGOKUTA_H -#include "ultra64.h" +#include #include "global.h" struct EnBigokuta; diff --git a/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.h b/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.h index 782412af8..f8f79af60 100644 --- a/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.h +++ b/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BILI_H #define Z_EN_BILI_H -#include "ultra64.h" +#include #include "global.h" struct EnBili; diff --git a/soh/src/overlays/actors/ovl_En_Bird/z_en_bird.h b/soh/src/overlays/actors/ovl_En_Bird/z_en_bird.h index a8a745f2d..a3966986b 100644 --- a/soh/src/overlays/actors/ovl_En_Bird/z_en_bird.h +++ b/soh/src/overlays/actors/ovl_En_Bird/z_en_bird.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BIRD_H #define Z_EN_BIRD_H -#include "ultra64.h" +#include #include "global.h" struct EnBird; diff --git a/soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c b/soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c index 3cfe62e96..825bc57c1 100644 --- a/soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c +++ b/soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c @@ -104,8 +104,8 @@ void EnBlkobj_DarkLinkFight(EnBlkobj* this, PlayState* play) { // Check for if Dark Link is defeated in authentic gameplay. // Check for if all enemies are defeated with enemy randomizer or crowd control on. uint8_t roomCleared = - (!CVar_GetS32("gRandomizedEnemies", 0) && !CVar_GetS32("gCrowdControl", 0) && Actor_Find(&play->actorCtx, ACTOR_EN_TORCH2, ACTORCAT_BOSS) == NULL) || - ((CVar_GetS32("gRandomizedEnemies", 0) || CVar_GetS32("gCrowdControl", 0)) && Flags_GetTempClear(play, this->dyna.actor.room)); + (!CVarGetInteger("gRandomizedEnemies", 0) && !CVarGetInteger("gCrowdControl", 0) && Actor_Find(&play->actorCtx, ACTOR_EN_TORCH2, ACTORCAT_BOSS) == NULL) || + ((CVarGetInteger("gRandomizedEnemies", 0) || CVarGetInteger("gCrowdControl", 0)) && Flags_GetTempClear(play, this->dyna.actor.room)); if (roomCleared) { Flags_SetClear(play, this->dyna.actor.room); this->timer++; diff --git a/soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h b/soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h index 4218c6466..98e43cfb0 100644 --- a/soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h +++ b/soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BLKOBJ_H #define Z_EN_BLKOBJ_H -#include "ultra64.h" +#include #include "global.h" struct EnBlkobj; diff --git a/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c index d71433a35..482001e00 100644 --- a/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -103,7 +103,7 @@ void EnBom_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->bombCollider, thisx, &sCylinderInit); Collider_SetJntSph(play, &this->explosionCollider, thisx, &sJntSphInit, &this->explosionColliderItems[0]); this->explosionColliderItems[0].info.toucher.damage += (thisx->shape.rot.z & 0xFF00) >> 8; - if (CVar_GetS32("gNutsExplodeBombs", 0)) { + if (CVarGetInteger("gNutsExplodeBombs", 0)) { this->bombCollider.info.bumper.dmgFlags |= 1; } diff --git a/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.h b/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.h index 7399d6edd..15e391226 100644 --- a/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.h +++ b/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BOM_H #define Z_EN_BOM_H -#include "ultra64.h" +#include #include "global.h" struct EnBom; 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 9dcffc37b..db092c862 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 @@ -69,7 +69,7 @@ void EnBomBowlMan_Init(Actor* thisx, PlayState* play2) { Actor_SetScale(&this->actor, 0.013f); for (i = 0; i < 2; i++) { - if(CVar_GetS32("gCustomizeBombchuBowling", 0) && CVar_GetS32(i == 0 ? "gBombchuBowlingNoSmallCucco" : "gBombchuBowlingNoBigCucco", 0)) { + if(CVarGetInteger("gCustomizeBombchuBowling", 0) && CVarGetInteger(i == 0 ? "gBombchuBowlingNoSmallCucco" : "gBombchuBowlingNoBigCucco", 0)) { continue; } @@ -324,8 +324,8 @@ void EnBomBowlMan_HandlePlayChoice(EnBomBowlMan* this, PlayState* play) { Rupees_ChangeBy(-30); this->minigamePlayStatus = 1; this->wallStatus[0] = this->wallStatus[1] = 0; - if(CVar_GetS32("gCustomizeBombchuBowling", 0)) { - play->bombchuBowlingStatus = CVar_GetS32("gBombchuBowlingAmmunition", 10); + if(CVarGetInteger("gCustomizeBombchuBowling", 0)) { + play->bombchuBowlingStatus = CVarGetInteger("gBombchuBowlingAmmunition", 10); } else { play->bombchuBowlingStatus = 10; diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h index fada65b55..37fb0c7db 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BOM_BOWL_MAN_H #define Z_EN_BOM_BOWL_MAN_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h" #include "overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h" diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h index 892fc472d..97ff39ac8 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BOM_BOWL_PIT_H #define Z_EN_BOM_BOWL_PIT_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h" diff --git a/soh/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/soh/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c index 5188a9d51..7cf493115 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c @@ -139,7 +139,7 @@ void EnBomChu_UpdateFloorPoly(EnBomChu* this, CollisionPoly* floorPoly, PlayStat f32 normDotUp; MtxF mf; - if (CVar_GetS32("gBombchusOOB", 0) && floorPoly == NULL) { + if (CVarGetInteger("gBombchusOOB", 0) && floorPoly == NULL) { EnBomChu_Explode(this, play); return; } @@ -491,7 +491,7 @@ void EnBomChu_Draw(Actor* thisx, PlayState* play) { f32 colorIntensity; s32 blinkHalfPeriod; s32 blinkTime; - Color_RGB8 BombchuCol = CVar_GetRGB("gBombTrailCol", BombchuColorOriginal); + Color_RGB8 BombchuCol = CVarGetColor24("gBombTrailCol", BombchuColorOriginal); OPEN_DISPS(play->state.gfxCtx); @@ -515,8 +515,8 @@ void EnBomChu_Draw(Actor* thisx, PlayState* play) { colorIntensity = blinkTime / (f32)blinkHalfPeriod; - if (CVar_GetS32("gCosmetics.Equipment_ChuBody.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.Equipment_ChuBody.Value", (Color_RGB8){ 209.0f, 34.0f, -35.0f }); + if (CVarGetInteger("gCosmetics.Equipment_ChuBody.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.Equipment_ChuBody.Value", (Color_RGB8){ 209.0f, 34.0f, -35.0f }); gDPSetEnvColor(POLY_OPA_DISP++, (colorIntensity * color.r), (colorIntensity * color.g), (colorIntensity * color.b), 255); } else { diff --git a/soh/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h b/soh/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h index 7e2154a0a..c9585354f 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h +++ b/soh/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BOM_CHU_H #define Z_EN_BOM_CHU_H -#include "ultra64.h" +#include #include "global.h" struct EnBomChu; diff --git a/soh/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h b/soh/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h index 7822098d0..33b6f3cc3 100644 --- a/soh/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h +++ b/soh/src/overlays/actors/ovl_En_Bombf/z_en_bombf.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BOMBF_H #define Z_EN_BOMBF_H -#include "ultra64.h" +#include #include "global.h" struct EnBombf; diff --git a/soh/src/overlays/actors/ovl_En_Boom/z_en_boom.h b/soh/src/overlays/actors/ovl_En_Boom/z_en_boom.h index 428406372..3e11c20db 100644 --- a/soh/src/overlays/actors/ovl_En_Boom/z_en_boom.h +++ b/soh/src/overlays/actors/ovl_En_Boom/z_en_boom.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BOOM_H #define Z_EN_BOOM_H -#include "ultra64.h" +#include #include "global.h" struct EnBoom; 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 7813987de..e23911958 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 @@ -624,8 +624,8 @@ void EnBox_Update(Actor* thisx, PlayState* play) { void EnBox_UpdateSizeAndTexture(EnBox* this, PlayState* play) { EnBox_CreateExtraChestTextures(); - int cvar = CVar_GetS32("gChestSizeAndTextureMatchesContents", 0); - int agonyCVar = CVar_GetS32("gChestSizeDependsStoneOfAgony", 0); + int cvar = CVarGetInteger("gChestSizeAndTextureMatchesContents", 0); + int agonyCVar = CVarGetInteger("gChestSizeDependsStoneOfAgony", 0); int stoneCheck = CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY); GetItemCategory getItemCategory; @@ -708,7 +708,7 @@ void EnBox_UpdateSizeAndTexture(EnBox* this, PlayState* play) { } } - if (CVar_GetS32("gLetItSnow", 0) && hasChristmasChestTexturesAvailable) { + if (CVarGetInteger("gLetItSnow", 0) && hasChristmasChestTexturesAvailable) { if (this->dyna.actor.scale.x == 0.01f) { this->boxBodyDL = gChristmasRedTreasureChestChestFrontDL; this->boxLidDL = gChristmasRedTreasureChestChestSideAndLidDL; diff --git a/soh/src/overlays/actors/ovl_En_Box/z_en_box.h b/soh/src/overlays/actors/ovl_En_Box/z_en_box.h index 2437ddd74..765779367 100644 --- a/soh/src/overlays/actors/ovl_En_Box/z_en_box.h +++ b/soh/src/overlays/actors/ovl_En_Box/z_en_box.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BOX_H #define Z_EN_BOX_H -#include "ultra64.h" +#include #include "global.h" #define ENBOX_TREASURE_FLAG_UNK_MIN 20 diff --git a/soh/src/overlays/actors/ovl_En_Brob/z_en_brob.h b/soh/src/overlays/actors/ovl_En_Brob/z_en_brob.h index 2e54a46d8..c4e256576 100644 --- a/soh/src/overlays/actors/ovl_En_Brob/z_en_brob.h +++ b/soh/src/overlays/actors/ovl_En_Brob/z_en_brob.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BROB_H #define Z_EN_BROB_H -#include "ultra64.h" +#include #include "global.h" struct EnBrob; diff --git a/soh/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h b/soh/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h index 938d1b2fd..47114190f 100644 --- a/soh/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h +++ b/soh/src/overlays/actors/ovl_En_Bubble/z_en_bubble.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BUBBLE_H #define Z_EN_BUBBLE_H -#include "ultra64.h" +#include #include "global.h" struct EnBubble; diff --git a/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.h b/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.h index 1a34747db..011d4f6bc 100644 --- a/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.h +++ b/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BUTTE_H #define Z_EN_BUTTE_H -#include "ultra64.h" +#include #include "global.h" struct EnButte; diff --git a/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.h b/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.h index ffdc3bba4..66b5835e4 100644 --- a/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.h +++ b/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BW_H #define Z_EN_BW_H -#include "ultra64.h" +#include #include "global.h" struct EnBw; diff --git a/soh/src/overlays/actors/ovl_En_Bx/z_en_bx.h b/soh/src/overlays/actors/ovl_En_Bx/z_en_bx.h index 87f9370d6..97b220022 100644 --- a/soh/src/overlays/actors/ovl_En_Bx/z_en_bx.h +++ b/soh/src/overlays/actors/ovl_En_Bx/z_en_bx.h @@ -1,7 +1,7 @@ #ifndef Z_EN_BX_H #define Z_EN_BX_H -#include "ultra64.h" +#include #include "global.h" struct EnBx; diff --git a/soh/src/overlays/actors/ovl_En_Changer/z_en_changer.h b/soh/src/overlays/actors/ovl_En_Changer/z_en_changer.h index b5209109e..b814d46aa 100644 --- a/soh/src/overlays/actors/ovl_En_Changer/z_en_changer.h +++ b/soh/src/overlays/actors/ovl_En_Changer/z_en_changer.h @@ -1,7 +1,7 @@ #ifndef Z_EN_CHANGER_H #define Z_EN_CHANGER_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_En_Box/z_en_box.h" diff --git a/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index 317174e99..a095ae500 100644 --- a/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -261,7 +261,7 @@ void EnClearTag_Init(Actor* thisx, PlayState* play) { // Change Arwing to regular enemy instead of boss with enemy randomizer and crowd control. // This way Arwings will be considered for "clear enemy" rooms properly. - if (CVar_GetS32("gRandomizedEnemies", 0) || CVar_GetS32("gCrowdControl", 0)) { + if (CVarGetInteger("gRandomizedEnemies", 0) || CVarGetInteger("gCrowdControl", 0)) { Actor_ChangeCategory(play, &play->actorCtx, thisx, ACTORCAT_ENEMY); } diff --git a/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h b/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h index f6328ea8d..7be1fd2a0 100644 --- a/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h +++ b/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h @@ -1,7 +1,7 @@ #ifndef Z_EN_CLEAR_TAG_H #define Z_EN_CLEAR_TAG_H -#include "ultra64.h" +#include #include "global.h" struct EnClearTag; 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 d31864502..1c9df2c7c 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 @@ -123,7 +123,7 @@ void EnCow_Init(Actor* thisx, PlayState* play) { func_809DEE9C(this); this->actionFunc = func_809DF96C; if (play->sceneNum == SCENE_LINK_HOME) { - if (!LINK_IS_ADULT && !CVar_GetS32("gCowOfTime", 0)) { + if (!LINK_IS_ADULT && !CVarGetInteger("gCowOfTime", 0)) { Actor_Kill(&this->actor); return; } diff --git a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.h b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.h index 9fcc67c79..63dbbddd3 100644 --- a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.h +++ b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.h @@ -1,7 +1,7 @@ #ifndef Z_EN_COW_H #define Z_EN_COW_H -#include "ultra64.h" +#include #include "global.h" struct EnCow; 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 bb6330ca6..40af76a4d 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 @@ -359,7 +359,7 @@ void EnCrow_Die(EnCrow* this, PlayState* play) { } else { Item_DropCollectible(play, &this->actor.world.pos, ITEM00_RUPEE_RED); } - if (!CVar_GetS32("gRandomizedEnemies", 0)) { + if (!CVarGetInteger("gRandomizedEnemies", 0)) { EnCrow_SetupRespawn(this); } else { Actor_Kill(this); diff --git a/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.h b/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.h index 87e9ae054..ed5bd62a9 100644 --- a/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.h +++ b/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.h @@ -1,7 +1,7 @@ #ifndef Z_EN_CROW_H #define Z_EN_CROW_H -#include "ultra64.h" +#include #include "global.h" struct EnCrow; diff --git a/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.h b/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.h index 0bc667652..26f19a0a9 100644 --- a/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.h +++ b/soh/src/overlays/actors/ovl_En_Cs/z_en_cs.h @@ -1,7 +1,7 @@ #ifndef Z_EN_CS_H #define Z_EN_CS_H -#include "ultra64.h" +#include #include "global.h" struct EnCs; diff --git a/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h b/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h index 697376277..479eb1b34 100644 --- a/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h +++ b/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DAIKU_H #define Z_EN_DAIKU_H -#include "ultra64.h" +#include #include "global.h" struct EnDaiku; diff --git a/soh/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.h b/soh/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.h index ad87945ca..36bae49de 100644 --- a/soh/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.h +++ b/soh/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DAIKU_KAKARIKO_H #define Z_EN_DAIKU_KAKARIKO_H -#include "ultra64.h" +#include #include "global.h" struct EnDaikuKakariko; diff --git a/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h b/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h index b6e5243e9..049d812dd 100644 --- a/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h +++ b/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DEKUBABA_H #define Z_EN_DEKUBABA_H -#include "ultra64.h" +#include #include "global.h" struct EnDekubaba; diff --git a/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h b/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h index 900305597..0418d169c 100644 --- a/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h +++ b/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DEKUNUTS_H #define Z_EN_DEKUNUTS_H -#include "ultra64.h" +#include #include "global.h" struct EnDekunuts; diff --git a/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.h b/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.h index 21db0fd38..607b1a945 100644 --- a/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.h +++ b/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DH_H #define Z_EN_DH_H -#include "ultra64.h" +#include #include "global.h" struct EnDh; diff --git a/soh/src/overlays/actors/ovl_En_Dha/z_en_dha.h b/soh/src/overlays/actors/ovl_En_Dha/z_en_dha.h index 2ef37c54c..b12190101 100644 --- a/soh/src/overlays/actors/ovl_En_Dha/z_en_dha.h +++ b/soh/src/overlays/actors/ovl_En_Dha/z_en_dha.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DHA_H #define Z_EN_DHA_H -#include "ultra64.h" +#include #include "global.h" struct EnDha; diff --git a/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h b/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h index 5cabd5428..ff49a1f6d 100644 --- a/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h +++ b/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DIVING_GAME_H #define Z_EN_DIVING_GAME_H -#include "ultra64.h" +#include #include "global.h" struct EnDivingGame; diff --git a/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.h b/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.h index b24c41f0c..bf0a3a167 100644 --- a/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.h +++ b/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DNS_H #define Z_EN_DNS_H -#include "ultra64.h" +#include #include "global.h" struct EnDns; diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h b/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h index 14da13acc..9093d451c 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h +++ b/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DNT_DEMO_H #define Z_EN_DNT_DEMO_H -#include "ultra64.h" +#include #include "global.h" struct EnDntDemo; diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h b/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h index 20199a7c2..2ecb83008 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h +++ b/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DNT_JIJI_H #define Z_EN_DNT_JIJI_H -#include "ultra64.h" +#include #include "global.h" struct EnDntJiji; diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h b/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h index 0b5c6f12e..b7b8cdd01 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h +++ b/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DNT_NOMAL_H #define Z_EN_DNT_NOMAL_H -#include "ultra64.h" +#include #include "global.h" struct EnDntNomal; diff --git a/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h b/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h index e20209598..098001772 100644 --- a/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h +++ b/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DODOJR_H #define Z_EN_DODOJR_H -#include "ultra64.h" +#include #include "global.h" struct EnDodojr; diff --git a/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h b/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h index a5436d627..ea9e03fb5 100644 --- a/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h +++ b/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DODONGO_H #define Z_EN_DODONGO_H -#include "ultra64.h" +#include #include "global.h" struct EnDodongo; 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 ea4eb8369..130cdc32e 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 @@ -473,11 +473,11 @@ void EnDog_Draw(Actor* thisx, PlayState* play) { EnDog* this = (EnDog*)thisx; Color_RGB8 colors[] = { { 255, 255, 200 }, { 150, 100, 50 } }; - if (CVar_GetS32("gCosmetics.NPC_Dog1.Changed", 0)) { - colors[0] = CVar_GetRGB("gCosmetics.NPC_Dog1.Value", colors[0]); + if (CVarGetInteger("gCosmetics.NPC_Dog1.Changed", 0)) { + colors[0] = CVarGetColor24("gCosmetics.NPC_Dog1.Value", colors[0]); } - if (CVar_GetS32("gCosmetics.NPC_Dog2.Changed", 0)) { - colors[1] = CVar_GetRGB("gCosmetics.NPC_Dog2.Value", colors[1]); + if (CVarGetInteger("gCosmetics.NPC_Dog2.Changed", 0)) { + colors[1] = CVarGetColor24("gCosmetics.NPC_Dog2.Value", colors[1]); } OPEN_DISPS(play->state.gfxCtx); diff --git a/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.h b/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.h index b8da73258..9ba459412 100644 --- a/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.h +++ b/soh/src/overlays/actors/ovl_En_Dog/z_en_dog.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DOG_H #define Z_EN_DOG_H -#include "ultra64.h" +#include #include "global.h" struct EnDog; diff --git a/soh/src/overlays/actors/ovl_En_Door/z_en_door.h b/soh/src/overlays/actors/ovl_En_Door/z_en_door.h index b7e3d5d2f..5cb5a7f1c 100644 --- a/soh/src/overlays/actors/ovl_En_Door/z_en_door.h +++ b/soh/src/overlays/actors/ovl_En_Door/z_en_door.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DOOR_H #define Z_EN_DOOR_H -#include "ultra64.h" +#include #include "global.h" /** diff --git a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.h b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.h index 8f10ce828..fb3c62aa2 100644 --- a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.h +++ b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DS_H #define Z_EN_DS_H -#include "ultra64.h" +#include #include "global.h" struct EnDs; diff --git a/soh/src/overlays/actors/ovl_En_Du/z_en_du.h b/soh/src/overlays/actors/ovl_En_Du/z_en_du.h index c7a3ec69c..141bc634b 100644 --- a/soh/src/overlays/actors/ovl_En_Du/z_en_du.h +++ b/soh/src/overlays/actors/ovl_En_Du/z_en_du.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DU_H #define Z_EN_DU_H -#include "ultra64.h" +#include #include "global.h" struct EnDu; diff --git a/soh/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h b/soh/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h index 0a6ce3c3a..71291ad02 100644 --- a/soh/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h +++ b/soh/src/overlays/actors/ovl_En_Dy_Extra/z_en_dy_extra.h @@ -1,7 +1,7 @@ #ifndef Z_EN_DY_EXTRA_H #define Z_EN_DY_EXTRA_H -#include "ultra64.h" +#include #include "global.h" struct EnDyExtra; diff --git a/soh/src/overlays/actors/ovl_En_Eg/z_en_eg.h b/soh/src/overlays/actors/ovl_En_Eg/z_en_eg.h index ad02d8a6b..00d14f079 100644 --- a/soh/src/overlays/actors/ovl_En_Eg/z_en_eg.h +++ b/soh/src/overlays/actors/ovl_En_Eg/z_en_eg.h @@ -1,7 +1,7 @@ #ifndef Z_EN_EG_H #define Z_EN_EG_H -#include "ultra64.h" +#include #include "global.h" struct EnEg; diff --git a/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h b/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h index 7f756596a..bc9541f11 100644 --- a/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h +++ b/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.h @@ -1,7 +1,7 @@ #ifndef Z_EN_EIYER_H #define Z_EN_EIYER_H -#include "ultra64.h" +#include #include "global.h" struct EnEiyer; 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 5b6c9449b..fe39cea99 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 @@ -628,15 +628,15 @@ void func_80A0329C(EnElf* this, PlayState* play) { if ((heightDiff > 0.0f) && (heightDiff < 60.0f)) { if (!func_80A01F90(&this->actor.world.pos, &refActor->actor.world.pos, 10.0f)) { - if (CVar_GetS32("gFairyEffect", 0) && !(this->fairyFlags & FAIRY_FLAG_BIG)) + if (CVarGetInteger("gFairyEffect", 0) && !(this->fairyFlags & FAIRY_FLAG_BIG)) { - if (CVar_GetS32("gFairyPercentRestore", 0)) + if (CVarGetInteger("gFairyPercentRestore", 0)) { - Health_ChangeBy(play, (gSaveContext.healthCapacity * CVar_GetS32("gFairyHealth", 100) / 100 + 15) / 16 * 16); + Health_ChangeBy(play, (gSaveContext.healthCapacity * CVarGetInteger("gFairyHealth", 100) / 100 + 15) / 16 * 16); } else { - Health_ChangeBy(play, CVar_GetS32("gFairyHealth", 8) * 16); + Health_ChangeBy(play, CVarGetInteger("gFairyHealth", 8) * 16); } } else @@ -1483,7 +1483,7 @@ s32 EnElf_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p if (this->fairyFlags & FAIRY_FLAG_BIG) { scale *= 2.0f; } - scale *= CVar_GetFloat("gCosmetics.Fairies_Size", 1.0f); + scale *= CVarGetFloat("gCosmetics.Fairies_Size", 1.0f); scale *= (this->actor.scale.x * 124.99999f); Matrix_MultVec3f(&zeroVec, &mtxMult); diff --git a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.h b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.h index cc2bfd396..7f8e4c84e 100644 --- a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.h +++ b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ELF_H #define Z_EN_ELF_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_Elf_Msg/z_elf_msg.h" diff --git a/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index f5b677466..263f9d80f 100644 --- a/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -244,9 +244,9 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, PlayState* play) { // been spawned and/or killed. int8_t enemyCount = play->actorCtx.actorLists[ACTORCAT_ENEMY].length; if ((this->curNumSpawn < this->maxCurSpawns && this->totalNumSpawn < this->maxTotalSpawns) || - (CVar_GetS32("gRandomizedEnemies", 0) && enemyCount < 15)) { + (CVarGetInteger("gRandomizedEnemies", 0) && enemyCount < 15)) { while ((this->curNumSpawn < this->maxCurSpawns && this->totalNumSpawn < this->maxTotalSpawns) || - (CVar_GetS32("gRandomizedEnemies", 0) && enemyCount < 15)) { + (CVarGetInteger("gRandomizedEnemies", 0) && enemyCount < 15)) { if (play->sceneNum == SCENE_SPOT00) { if ((player->unk_89E == 0) || (player->actor.floorBgId != BGCHECK_SCENE) || !(player->actor.bgCheckFlags & 1) || (player->stateFlags1 & 0x08000000)) { diff --git a/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h b/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h index efd770f26..529bb5209 100644 --- a/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h +++ b/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ENCOUNT1_H #define Z_EN_ENCOUNT1_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_En_Reeba/z_en_reeba.h" diff --git a/soh/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h b/soh/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h index d6f56c1e6..365d4428c 100644 --- a/soh/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h +++ b/soh/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ENCOUNT2_H #define Z_EN_ENCOUNT2_H -#include "ultra64.h" +#include #include "global.h" struct EnEncount2; diff --git a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h index b8e4d2712..34a880c22 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h +++ b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h @@ -1,7 +1,7 @@ #ifndef Z_EN_EX_ITEM_H #define Z_EN_EX_ITEM_H -#include "ultra64.h" +#include #include "global.h" struct EnExItem; diff --git a/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c b/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c index 9a9e71615..6c921a17a 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c +++ b/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c @@ -56,7 +56,7 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) { switch (this->type) { case 0: - if (CVar_GetS32("gNewDrops", 0) !=0) { + if (CVarGetInteger("gNewDrops", 0) !=0) { this->unk_160 = 0.3f; } else { this->unk_160 = 0.01f; @@ -105,7 +105,7 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) { } } } - if (CVar_GetS32("gNewDrops", 0) !=0) { + if (CVarGetInteger("gNewDrops", 0) !=0) { this->actor.shape.shadowScale = 0.3f; this->actor.shape.yOffset = 35.0f; } else { @@ -123,14 +123,14 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) { case 2: // Giant pink ruppe that explodes when you touch it if (this->type == 1) { this->colorIdx = 4; - if (CVar_GetS32("gNewDrops", 0) !=0) { + if (CVarGetInteger("gNewDrops", 0) !=0) { Actor_SetScale(&this->actor, 2.0f); } else { Actor_SetScale(&this->actor, 0.1f); } } else { this->colorIdx = (s16)Rand_ZeroFloat(3.99f) + 1; - if (CVar_GetS32("gNewDrops", 0) !=0) { + if (CVarGetInteger("gNewDrops", 0) !=0) { Actor_SetScale(thisx, 0.4f); } else { Actor_SetScale(thisx, 0.02f); @@ -139,7 +139,7 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) { this->actor.gravity = -3.0f; // "Wow Coin" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ わーなーコイン ☆☆☆☆☆ \n" VT_RST); - if (CVar_GetS32("gNewDrops", 0) !=0) { + if (CVarGetInteger("gNewDrops", 0) !=0) { this->actor.shape.shadowScale = 0.3f; this->actor.shape.yOffset = 35.0f; } else { @@ -151,7 +151,7 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) { break; case 3: // Spawned by the guard in Hyrule courtyard - if (CVar_GetS32("gNewDrops", 0) !=0) { + if (CVarGetInteger("gNewDrops", 0) !=0) { Actor_SetScale(&this->actor, 0.4f); } else { Actor_SetScale(&this->actor, 0.02f); @@ -170,7 +170,7 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) { this->actor.gravity = -3.0f; // "Normal rupee" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ ノーマルルピー ☆☆☆☆☆ \n" VT_RST); - if (CVar_GetS32("gNewDrops", 0) !=0) { + if (CVarGetInteger("gNewDrops", 0) !=0) { this->actor.shape.shadowScale = 0.3f; this->actor.shape.yOffset = 35.0f; } else { @@ -184,7 +184,7 @@ void EnExRuppy_Init(Actor* thisx, PlayState* play) { case 4: // Progress markers in the shooting gallery this->actor.gravity = -3.0f; this->actor.flags &= ~ACTOR_FLAG_0; - if (CVar_GetS32("gNewDrops", 0) !=0) { + if (CVarGetInteger("gNewDrops", 0) !=0) { Actor_SetScale(&this->actor, 0.3f); this->actor.shape.shadowScale = 0.3f; this->actor.shape.yOffset = -1365.0f; @@ -393,7 +393,7 @@ void EnExRuppy_WaitAsCollectible(EnExRuppy* this, PlayState* play) { } void EnExRuppy_GalleryTarget(EnExRuppy* this, PlayState* play) { - if (CVar_GetS32("gNewDrops", 0) !=0) { + if (CVarGetInteger("gNewDrops", 0) !=0) { if (this->galleryFlag) { Math_ApproachF(&this->actor.shape.yOffset, 35.0f, 0.5f, 200.0f); } else { @@ -436,7 +436,7 @@ void EnExRuppy_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); func_8002EBCC(thisx, play, 0); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - if (CVar_GetS32("gNewDrops", 0) !=0) { + if (CVarGetInteger("gNewDrops", 0) !=0) { if (this->type == 4 && this->colorIdx >= 3) { //For some reason the red rupee target become purple. //when using new drops it will show as Gold and that wrong it need to be red. diff --git a/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h b/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h index 07bd80fa9..73277e6df 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h +++ b/soh/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h @@ -1,7 +1,7 @@ #ifndef Z_EN_EX_RUPPY_H #define Z_EN_EX_RUPPY_H -#include "ultra64.h" +#include #include "global.h" struct EnExRuppy; diff --git a/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.h b/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.h index c141df42e..28904d018 100644 --- a/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.h +++ b/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.h @@ -1,7 +1,7 @@ #ifndef Z_EN_FD_H #define Z_EN_FD_H -#include "ultra64.h" +#include #include "global.h" struct EnFd; diff --git a/soh/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.h b/soh/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.h index 414fdf997..3ecf70ea2 100644 --- a/soh/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.h +++ b/soh/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.h @@ -1,7 +1,7 @@ #ifndef Z_EN_FD_FIRE_H #define Z_EN_FD_FIRE_H -#include "ultra64.h" +#include #include "global.h" struct EnFdFire; diff --git a/soh/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h b/soh/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h index 2f4377077..037e973fb 100644 --- a/soh/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h +++ b/soh/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.h @@ -1,7 +1,7 @@ #ifndef Z_EN_FHG_FIRE_H #define Z_EN_FHG_FIRE_H -#include "ultra64.h" +#include #include "global.h" struct EnFhgFire; diff --git a/soh/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h b/soh/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h index 3530cecb7..475151db4 100644 --- a/soh/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h +++ b/soh/src/overlays/actors/ovl_En_Fire_Rock/z_en_fire_rock.h @@ -1,7 +1,7 @@ #ifndef Z_EN_FIRE_ROCK_H #define Z_EN_FIRE_ROCK_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_En_Encount2/z_en_encount2.h" 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 472e6a181..a62dc583c 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 @@ -744,10 +744,10 @@ void EnFirefly_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* static Color_RGBA8 fireAuraEnvColor = { 255, 50, 0, 0 }; static Color_RGBA8 iceAuraPrimColor = { 100, 200, 255, 255 }; static Color_RGBA8 iceAuraEnvColor = { 0, 0, 255, 0 }; - Color_RGBA8 customFireAuraPrimColor = CVar_GetRGBA("gCosmetics.NPC_FireKeesePrimary.Value", fireAuraPrimColor); - Color_RGBA8 customFireAuraEnvColor = CVar_GetRGBA("gCosmetics.NPC_FireKeeseSecondary.Value", fireAuraEnvColor); - Color_RGBA8 customIceAuraPrimColor = CVar_GetRGBA("gCosmetics.NPC_IceKeesePrimary.Value", iceAuraPrimColor); - Color_RGBA8 customIceAuraEnvColor = CVar_GetRGBA("gCosmetics.NPC_IceKeeseSecondary.Value", iceAuraEnvColor); + Color_RGBA8 customFireAuraPrimColor = CVarGetColor("gCosmetics.NPC_FireKeesePrimary.Value", fireAuraPrimColor); + Color_RGBA8 customFireAuraEnvColor = CVarGetColor("gCosmetics.NPC_FireKeeseSecondary.Value", fireAuraEnvColor); + Color_RGBA8 customIceAuraPrimColor = CVarGetColor("gCosmetics.NPC_IceKeesePrimary.Value", iceAuraPrimColor); + Color_RGBA8 customIceAuraEnvColor = CVarGetColor("gCosmetics.NPC_IceKeeseSecondary.Value", iceAuraEnvColor); static Vec3f effVelocity = { 0.0f, 0.5f, 0.0f }; static Vec3f effAccel = { 0.0f, 0.5f, 0.0f }; static Vec3f limbSrc = { 0.0f, 0.0f, 0.0f }; @@ -787,23 +787,23 @@ void EnFirefly_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* } if (this->auraType == KEESE_AURA_FIRE) { - if (CVar_GetS32("gCosmetics.NPC_FireKeesePrimary.Changed", 0)) { + if (CVarGetInteger("gCosmetics.NPC_FireKeesePrimary.Changed", 0)) { effPrimColor = &customFireAuraPrimColor; } else { effPrimColor = &fireAuraPrimColor; } - if (CVar_GetS32("gCosmetics.NPC_FireKeeseSecondary.Changed", 0)) { + if (CVarGetInteger("gCosmetics.NPC_FireKeeseSecondary.Changed", 0)) { effEnvColor = &customFireAuraEnvColor; } else { effEnvColor = &fireAuraEnvColor; } } else { - if (CVar_GetS32("gCosmetics.NPC_IceKeesePrimary.Changed", 0)) { + if (CVarGetInteger("gCosmetics.NPC_IceKeesePrimary.Changed", 0)) { effPrimColor = &customIceAuraPrimColor; } else { effPrimColor = &iceAuraPrimColor; } - if (CVar_GetS32("gCosmetics.NPC_IceKeeseSecondary.Changed", 0)) { + if (CVarGetInteger("gCosmetics.NPC_IceKeeseSecondary.Changed", 0)) { effEnvColor = &customIceAuraEnvColor; } else { effEnvColor = &iceAuraEnvColor; diff --git a/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h b/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h index 862779e18..13bc3a894 100644 --- a/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h +++ b/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.h @@ -1,7 +1,7 @@ #ifndef Z_EN_FIREFLY_H #define Z_EN_FIREFLY_H -#include "ultra64.h" +#include #include "global.h" struct EnFirefly; diff --git a/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.h b/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.h index 7169077b5..f926d1b69 100644 --- a/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.h +++ b/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.h @@ -1,7 +1,7 @@ #ifndef Z_EN_FISH_H #define Z_EN_FISH_H -#include "ultra64.h" +#include #include "global.h" struct EnFish; diff --git a/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h b/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h index c4233bf2a..da874f20e 100644 --- a/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h +++ b/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.h @@ -1,7 +1,7 @@ #ifndef Z_EN_FLOORMAS_H #define Z_EN_FLOORMAS_H -#include "ultra64.h" +#include #include "global.h" typedef struct EnFloormas EnFloormas; diff --git a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.h b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.h index 789b5e453..19d612fdd 100644 --- a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.h +++ b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.h @@ -1,7 +1,7 @@ #ifndef Z_EN_FR_H #define Z_EN_FR_H -#include "ultra64.h" +#include #include "global.h" struct EnFr; diff --git a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.h b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.h index 3c27e82d3..7fddd6543 100644 --- a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.h +++ b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.h @@ -1,7 +1,7 @@ #ifndef Z_EN_FU_H #define Z_EN_FU_H -#include "ultra64.h" +#include #include "global.h" struct EnFu; diff --git a/soh/src/overlays/actors/ovl_En_Fw/z_en_fw.h b/soh/src/overlays/actors/ovl_En_Fw/z_en_fw.h index 47f213ea3..bea5e874e 100644 --- a/soh/src/overlays/actors/ovl_En_Fw/z_en_fw.h +++ b/soh/src/overlays/actors/ovl_En_Fw/z_en_fw.h @@ -1,7 +1,7 @@ #ifndef Z_EN_FW_H #define Z_EN_FW_H -#include "ultra64.h" +#include #include "global.h" struct EnFw; diff --git a/soh/src/overlays/actors/ovl_En_Fz/z_en_fz.h b/soh/src/overlays/actors/ovl_En_Fz/z_en_fz.h index f2374c316..e502c0a57 100644 --- a/soh/src/overlays/actors/ovl_En_Fz/z_en_fz.h +++ b/soh/src/overlays/actors/ovl_En_Fz/z_en_fz.h @@ -1,7 +1,7 @@ #ifndef Z_EN_FZ_H #define Z_EN_FZ_H -#include "ultra64.h" +#include #include "global.h" struct EnFz; diff --git a/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index 3986ac26e..e152da4f3 100644 --- a/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -120,7 +120,7 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { this->actor.draw = EnGSwitch_DrawRupee; this->actor.shape.yOffset = 700.0f; - if (CVar_GetS32("gNewDrops", 0) !=0) { + if (CVarGetInteger("gNewDrops", 0) !=0) { this->actor.shape.yOffset = 35.0f; } else { this->actor.shape.yOffset = 700.0f; @@ -130,7 +130,7 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ You are Shock! ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag); Actor_Kill(&this->actor); } else { - if (CVar_GetS32("gNewDrops", 0) !=0) { + if (CVarGetInteger("gNewDrops", 0) !=0) { Actor_SetScale(&this->actor, 0.6f); } else { Actor_SetScale(&this->actor, 0.03f); @@ -165,7 +165,7 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnGSwitch_WaitForObject; break; case ENGSWITCH_TARGET_RUPEE: - if (CVar_GetS32("gNewDrops", 0) !=0) { + if (CVarGetInteger("gNewDrops", 0) !=0) { this->actor.shape.yOffset = 35.0f; Actor_SetScale(&this->actor, 0.9f); } else { @@ -498,12 +498,12 @@ void EnGSwitch_DrawRupee(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); func_8002EBCC(&this->actor, play, 0); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - if (CVar_GetS32("gNewDrops", 0) !=0) { + if (CVarGetInteger("gNewDrops", 0) !=0) { gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); if (this->type == ENGSWITCH_TARGET_RUPEE) { GetItem_Draw(play, sRupeeTexturesNew[this->colorIdx]); } else { - Color_RGB8 silverRupeeColor = CVar_GetRGB("gCosmetics.Consumable_SilverRupee.Value", (Color_RGB8){ 255, 255, 255 }); + Color_RGB8 silverRupeeColor = CVarGetColor24("gCosmetics.Consumable_SilverRupee.Value", (Color_RGB8){ 255, 255, 255 }); Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD); @@ -522,28 +522,28 @@ void EnGSwitch_DrawRupee(Actor* thisx, PlayState* play) { u8 shouldColor = 0; switch (this->colorIdx) { case 0: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_GreenRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_GreenRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_GreenRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_GreenRupee.Changed", 0); break; case 1: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_BlueRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_BlueRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_BlueRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_BlueRupee.Changed", 0); break; case 2: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_RedRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_RedRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_RedRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_RedRupee.Changed", 0); break; case 3: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_PurpleRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_PurpleRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_PurpleRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_PurpleRupee.Changed", 0); break; case 4: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_GoldRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_GoldRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_GoldRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_GoldRupee.Changed", 0); break; case 5: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_SilverRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_SilverRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_SilverRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_SilverRupee.Changed", 0); break; } @@ -646,28 +646,28 @@ void EnGSwitch_DrawEffects(EnGSwitch* this, PlayState* play) { u8 shouldColor = 0; switch (effect->colorIdx) { case 0: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_GreenRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_GreenRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_GreenRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_GreenRupee.Changed", 0); break; case 1: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_BlueRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_BlueRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_BlueRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_BlueRupee.Changed", 0); break; case 2: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_RedRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_RedRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_RedRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_RedRupee.Changed", 0); break; case 3: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_PurpleRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_PurpleRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_PurpleRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_PurpleRupee.Changed", 0); break; case 4: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_GoldRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_GoldRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_GoldRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_GoldRupee.Changed", 0); break; case 5: - rupeeColor = CVar_GetRGB("gCosmetics.Consumable_SilverRupee.Value", (Color_RGB8){ 255, 255, 255 }); - shouldColor = CVar_GetS32("gCosmetics.Consumable_SilverRupee.Changed", 0); + rupeeColor = CVarGetColor24("gCosmetics.Consumable_SilverRupee.Value", (Color_RGB8){ 255, 255, 255 }); + shouldColor = CVarGetInteger("gCosmetics.Consumable_SilverRupee.Changed", 0); break; } diff --git a/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h b/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h index d2fb4b38d..77a19c873 100644 --- a/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h +++ b/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.h @@ -1,7 +1,7 @@ #ifndef Z_EN_G_SWITCH_H #define Z_EN_G_SWITCH_H -#include "ultra64.h" +#include #include "global.h" struct EnGSwitch; 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 2ae39f4d6..457d689f1 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 @@ -127,7 +127,7 @@ void EnGanonMant_Tear(EnGanonMant* this) { s16 count = shape->count; s16* tearAreaSizes = shape->tearAreaSizes; - u8* gMantTexProper = ResourceMgr_LoadTexByName(gMantTex); + u8* gMantTexProper = GetResourceDataByName(gMantTex, false); for (i = 0; i < count; i++) { if ((0 <= tx && tx < MANT_TEX_WIDTH) && (0 <= ty && ty < MANT_TEX_HEIGHT)) { diff --git a/soh/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h b/soh/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h index 3b416e59e..ac169433b 100644 --- a/soh/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h +++ b/soh/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.h @@ -1,7 +1,7 @@ #ifndef Z_EN_GANON_MANT_H #define Z_EN_GANON_MANT_H -#include "ultra64.h" +#include #include "global.h" struct EnGanonMant; diff --git a/soh/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.h b/soh/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.h index 0c301bddc..44677b5eb 100644 --- a/soh/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.h +++ b/soh/src/overlays/actors/ovl_En_Ganon_Organ/z_en_ganon_organ.h @@ -1,7 +1,7 @@ #ifndef Z_EN_GANON_ORGAN_H #define Z_EN_GANON_ORGAN_H -#include "ultra64.h" +#include #include "global.h" struct EnGanonOrgan; diff --git a/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.h b/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.h index 7552aba8e..261b51797 100644 --- a/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.h +++ b/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.h @@ -1,7 +1,7 @@ #ifndef Z_EN_GB_H #define Z_EN_GB_H -#include "ultra64.h" +#include #include "global.h" struct EnGb; diff --git a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h index c3c79d7e4..1851fdbce 100644 --- a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h +++ b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.h @@ -1,7 +1,7 @@ #ifndef Z_EN_GE1_H #define Z_EN_GE1_H -#include "ultra64.h" +#include #include "global.h" struct EnGe1; diff --git a/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h b/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h index 7c78ad91a..b11e9d5af 100644 --- a/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h +++ b/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.h @@ -1,7 +1,7 @@ #ifndef Z_EN_GE2_H #define Z_EN_GE2_H -#include "ultra64.h" +#include #include "global.h" struct EnGe2; 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 3d174fe14..fecf3e9ea 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 @@ -250,7 +250,7 @@ s32 EnGe3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p rot->x += this->headRot.y; default: - if (CVar_GetS32("gGerudoWarriorClothingFix", 0)) { + if (CVarGetInteger("gGerudoWarriorClothingFix", 0)) { // This is a hack to fix the color-changing clothes this Gerudo has on N64 versions OPEN_DISPS(play->state.gfxCtx); switch (limbIndex) { diff --git a/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h b/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h index 4bb5c7b3f..b4ecff20c 100644 --- a/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h +++ b/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.h @@ -1,7 +1,7 @@ #ifndef Z_EN_GE3_H #define Z_EN_GE3_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_En_GeldB/z_en_geldb.h" diff --git a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h index 149f8ac0a..46e09f0e1 100644 --- a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h +++ b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.h @@ -1,7 +1,7 @@ #ifndef Z_EN_GELDB_H #define Z_EN_GELDB_H -#include "ultra64.h" +#include #include "global.h" struct EnGeldB; diff --git a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 1ceb58e36..d37dc3af1 100644 --- a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -492,7 +492,7 @@ s32 EnGirlA_CanBuy_DekuNuts(PlayState* play, EnGirlA* this) { if (gSaveContext.rupees < this->basePrice) { return CANBUY_RESULT_NEED_RUPEES; } - if ((Item_CheckObtainability(ITEM_NUT) == ITEM_NONE) && !CVar_GetS32("gFastDrops", 0)) { + if ((Item_CheckObtainability(ITEM_NUT) == ITEM_NONE) && !CVarGetInteger("gFastDrops", 0)) { return CANBUY_RESULT_SUCCESS_FANFARE; } return CANBUY_RESULT_SUCCESS; @@ -505,7 +505,7 @@ s32 EnGirlA_CanBuy_DekuSticks(PlayState* play, EnGirlA* this) { if (gSaveContext.rupees < this->basePrice) { return CANBUY_RESULT_NEED_RUPEES; } - if ((Item_CheckObtainability(ITEM_STICK) == ITEM_NONE) && !CVar_GetS32("gFastDrops", 0)) { + if ((Item_CheckObtainability(ITEM_STICK) == ITEM_NONE) && !CVarGetInteger("gFastDrops", 0)) { return CANBUY_RESULT_SUCCESS_FANFARE; } return CANBUY_RESULT_SUCCESS; @@ -703,7 +703,7 @@ s32 EnGirlA_CanBuy_DekuSeeds(PlayState* play, EnGirlA* this) { if (gSaveContext.rupees < this->basePrice) { return CANBUY_RESULT_NEED_RUPEES; } - if ((Item_CheckObtainability(ITEM_SEEDS) == ITEM_NONE) && !CVar_GetS32("gFastDrops", 0)) { + if ((Item_CheckObtainability(ITEM_SEEDS) == ITEM_NONE) && !CVarGetInteger("gFastDrops", 0)) { return CANBUY_RESULT_SUCCESS_FANFARE; } return CANBUY_RESULT_SUCCESS; diff --git a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.h b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.h index dc430d500..11b90a0d5 100644 --- a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.h +++ b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.h @@ -1,7 +1,7 @@ #ifndef Z_EN_GIRLA_H #define Z_EN_GIRLA_H -#include "ultra64.h" +#include #include "global.h" struct EnGirlA; diff --git a/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.h b/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.h index fd699d518..3652fc43a 100644 --- a/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.h +++ b/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.h @@ -1,7 +1,7 @@ #ifndef Z_EN_GM_H #define Z_EN_GM_H -#include "ultra64.h" +#include #include "global.h" struct EnGm; 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 e67949d45..127a844dc 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 @@ -98,7 +98,7 @@ u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { if (!gSaveContext.n64ddFlag && gSaveContext.bgsFlag) { return 0x305E; } else if (INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_CLAIM_CHECK) { - if (Environment_GetBgsDayCount() >= CVar_GetS32("gForgeTime", 3)) { + if (Environment_GetBgsDayCount() >= CVarGetInteger("gForgeTime", 3)) { return 0x305E; } else { return 0x305D; diff --git a/soh/src/overlays/actors/ovl_En_Go/z_en_go.h b/soh/src/overlays/actors/ovl_En_Go/z_en_go.h index 1d5d58813..5100522eb 100644 --- a/soh/src/overlays/actors/ovl_En_Go/z_en_go.h +++ b/soh/src/overlays/actors/ovl_En_Go/z_en_go.h @@ -1,7 +1,7 @@ #ifndef Z_EN_GO_H #define Z_EN_GO_H -#include "ultra64.h" +#include #include "global.h" struct EnGo; 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 787ee36de..08ffeda93 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 @@ -1073,7 +1073,7 @@ void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) { if (func_8002F368(play) == EXCH_ITEM_CLAIM_CHECK) { if (gSaveContext.n64ddFlag && Flags_GetTreasure(play, 0x1F)) { textId = 0x3003; - } else if (Environment_GetBgsDayCount() >= CVar_GetS32("gForgeTime", 3)) { + } else if (Environment_GetBgsDayCount() >= CVarGetInteger("gForgeTime", 3)) { textId = 0x305E; } else { textId = 0x305D; @@ -1082,7 +1082,7 @@ void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) { } else { if (gSaveContext.n64ddFlag && Flags_GetTreasure(play, 0x1F)) { textId = 0x305E; - } else if (Environment_GetBgsDayCount() >= CVar_GetS32("gForgeTime", 3)) { + } else if (Environment_GetBgsDayCount() >= CVarGetInteger("gForgeTime", 3)) { textId = 0x3002; } else { textId = 0x305D; @@ -1350,7 +1350,7 @@ void EnGo2_RollingAnimation(EnGo2* this, PlayState* play) { } void EnGo2_WakeUp(EnGo2* this, PlayState* play) { - if (CVar_GetS32("gUnfixGoronSpin", 0)) { + if (CVarGetInteger("gUnfixGoronSpin", 0)) { // Trick SkelAnime into thinking the current animation is changing so that it morphs between the same position, // making the goron do a spin this->skelAnime.animation = NULL; @@ -1371,14 +1371,14 @@ void EnGo2_WakeUp(EnGo2* this, PlayState* play) { // which uses the same frame data as ANIM_1/10 but no morph frames, but only when the // current animation frame is at 0, meaning no morphing is necessary anyway. // ANIM_13 is ANIM_0 but with the startFrame and mode adjusted for biggoron. - if (this->skelAnime.curFrame == 0.0f && !CVar_GetS32("gUnfixGoronSpin", 0)) { + if (this->skelAnime.curFrame == 0.0f && !CVarGetInteger("gUnfixGoronSpin", 0)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_13); } else { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_10); } this->skelAnime.playSpeed = 0.5f; } else { - if (this->skelAnime.curFrame == 0.0f && !CVar_GetS32("gUnfixGoronSpin", 0)) { + if (this->skelAnime.curFrame == 0.0f && !CVarGetInteger("gUnfixGoronSpin", 0)) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_0); } else { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_1); @@ -2101,13 +2101,13 @@ s32 EnGo2_OverrideLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3f* pos, V f32 float1; if (limb == 17) { - Matrix_Translate(2800.0f + CVar_GetFloat("gCosmetics.Goron_NeckLength", 0.0f), 0.0f, 0.0f, MTXMODE_APPLY); + Matrix_Translate(2800.0f + CVarGetFloat("gCosmetics.Goron_NeckLength", 0.0f), 0.0f, 0.0f, MTXMODE_APPLY); vec1 = this->unk_194.unk_08; float1 = (vec1.y / (f32)0x8000) * M_PI; Matrix_RotateX(float1, MTXMODE_APPLY); float1 = (vec1.x / (f32)0x8000) * M_PI; Matrix_RotateZ(float1, MTXMODE_APPLY); - Matrix_Translate(-2800.0f + CVar_GetFloat("gCosmetics.Goron_NeckLength", 0.0f), 0.0f, 0.0f, MTXMODE_APPLY); + Matrix_Translate(-2800.0f + CVarGetFloat("gCosmetics.Goron_NeckLength", 0.0f), 0.0f, 0.0f, MTXMODE_APPLY); } if (limb == 10) { vec1 = this->unk_194.unk_0E; diff --git a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.h b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.h index 82bd54781..bc9e5b5ec 100644 --- a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.h +++ b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.h @@ -1,7 +1,7 @@ #ifndef Z_EN_GO2_H #define Z_EN_GO2_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_En_Go/z_en_go.h" diff --git a/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.h b/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.h index b04162aca..27917d3cd 100644 --- a/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.h +++ b/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.h @@ -1,7 +1,7 @@ #ifndef Z_EN_GOMA_H #define Z_EN_GOMA_H -#include "ultra64.h" +#include #include "global.h" typedef enum { diff --git a/soh/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h b/soh/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h index 628543293..73f68cd2c 100644 --- a/soh/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h +++ b/soh/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.h @@ -1,7 +1,7 @@ #ifndef Z_EN_GOROIWA_H #define Z_EN_GOROIWA_H -#include "ultra64.h" +#include #include "global.h" struct EnGoroiwa; diff --git a/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c index ca10fc8df..12dea8b22 100644 --- a/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -594,8 +594,8 @@ void EnGs_Draw(Actor* thisx, PlayState* play) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->flashColor.r, this->flashColor.g, this->flashColor.b, this->flashColor.a); } else { - if (CVar_GetS32("gCosmetics.World_GossipStone.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.World_GossipStone.Value", (Color_RGB8){255, 255, 255}); + if (CVarGetInteger("gCosmetics.World_GossipStone.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.World_GossipStone.Value", (Color_RGB8){255, 255, 255}); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, color.r, color.g, color.b, 255); } else { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); diff --git a/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.h b/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.h index 47edd278d..5a303680f 100644 --- a/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.h +++ b/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.h @@ -1,7 +1,7 @@ #ifndef Z_EN_GS_H #define Z_EN_GS_H -#include "ultra64.h" +#include #include "global.h" struct EnGs; diff --git a/soh/src/overlays/actors/ovl_En_Guest/z_en_guest.h b/soh/src/overlays/actors/ovl_En_Guest/z_en_guest.h index d99514686..7be3b5852 100644 --- a/soh/src/overlays/actors/ovl_En_Guest/z_en_guest.h +++ b/soh/src/overlays/actors/ovl_En_Guest/z_en_guest.h @@ -1,7 +1,7 @@ #ifndef Z_EN_GUEST_H #define Z_EN_GUEST_H -#include "ultra64.h" +#include #include "global.h" struct EnGuest; diff --git a/soh/src/overlays/actors/ovl_En_Hata/z_en_hata.h b/soh/src/overlays/actors/ovl_En_Hata/z_en_hata.h index f208b1e01..d7c66f68b 100644 --- a/soh/src/overlays/actors/ovl_En_Hata/z_en_hata.h +++ b/soh/src/overlays/actors/ovl_En_Hata/z_en_hata.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HATA_H #define Z_EN_HATA_H -#include "ultra64.h" +#include #include "global.h" diff --git a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h index 274570109..d4a068ac9 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h +++ b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HEISHI1_H #define Z_EN_HEISHI1_H -#include "ultra64.h" +#include #include "global.h" struct EnHeishi1; diff --git a/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h b/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h index 2016b5547..f88c67314 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h +++ b/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HEISHI2_H #define Z_EN_HEISHI2_H -#include "ultra64.h" +#include #include "global.h" diff --git a/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h b/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h index 63b431139..492efb7bd 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h +++ b/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HEISHI3_H #define Z_EN_HEISHI3_H -#include "ultra64.h" +#include #include "global.h" struct EnHeishi3; 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 6cd8936fa..214e56e97 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 @@ -332,7 +332,7 @@ void func_80A56B40(EnHeishi4* this, PlayState* play) { return; } if (this->type == HEISHI4_AT_MARKET_NIGHT) { - if (CVar_GetS32("gMarketSneak", 0)) { + if (CVarGetInteger("gMarketSneak", 0)) { this->actionFunc = EnHeishi4_MarketSneak; } else { this->actionFunc = func_80A56614; diff --git a/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h b/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h index 0d254f432..c69a139bd 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h +++ b/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HEISHI4_H #define Z_EN_HEISHI4_H -#include "ultra64.h" +#include #include "global.h" typedef enum { diff --git a/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h b/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h index fcc020165..7205af018 100644 --- a/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h +++ b/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HINTNUTS_H #define Z_EN_HINTNUTS_H -#include "ultra64.h" +#include #include "global.h" struct EnHintnuts; diff --git a/soh/src/overlays/actors/ovl_En_Holl/z_en_holl.h b/soh/src/overlays/actors/ovl_En_Holl/z_en_holl.h index 452de700a..950f7d094 100644 --- a/soh/src/overlays/actors/ovl_En_Holl/z_en_holl.h +++ b/soh/src/overlays/actors/ovl_En_Holl/z_en_holl.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HOLL_H #define Z_EN_HOLL_H -#include "ultra64.h" +#include #include "global.h" struct EnHoll; diff --git a/soh/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h b/soh/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h index f576377b1..b6d29d994 100644 --- a/soh/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h +++ b/soh/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HONOTRAP_H #define Z_EN_HONOTRAP_H -#include "ultra64.h" +#include #include "global.h" struct EnHonotrap; diff --git a/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 12e0395f5..7b0aa613e 100644 --- a/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -3312,7 +3312,7 @@ void EnHorse_CheckBoost(EnHorse* thisx, PlayState* play2) { this->stateFlags |= ENHORSE_BOOST; this->stateFlags |= ENHORSE_FIRST_BOOST_REGEN; this->stateFlags |= ENHORSE_FLAG_8; - if (!CVar_GetS32("gInfiniteEpona", 0)) { this->numBoosts--; } + if (!CVarGetInteger("gInfiniteEpona", 0)) { this->numBoosts--; } this->boostTimer = 0; if (this->numBoosts == 0) { this->boostRegenTime = 140; diff --git a/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.h b/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.h index fb07caa69..6724faf47 100644 --- a/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.h +++ b/soh/src/overlays/actors/ovl_En_Horse/z_en_horse.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HORSE_H #define Z_EN_HORSE_H -#include "ultra64.h" +#include #include "global.h" typedef enum { diff --git a/soh/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h b/soh/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h index 2ef1d2b9a..3c39cf1ed 100644 --- a/soh/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h +++ b/soh/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HORSE_GAME_CHECK_H #define Z_EN_HORSE_GAME_CHECK_H -#include "ultra64.h" +#include #include "global.h" struct EnHorseGameCheckBase; diff --git a/soh/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h b/soh/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h index 8083adeee..a1c89e933 100644 --- a/soh/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h +++ b/soh/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HORSE_GANON_H #define Z_EN_HORSE_GANON_H -#include "ultra64.h" +#include #include "global.h" struct EnHorseGanon; diff --git a/soh/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h b/soh/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h index a61248c70..4efaa76aa 100644 --- a/soh/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h +++ b/soh/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HORSE_LINK_CHILD_H #define Z_EN_HORSE_LINK_CHILD_H -#include "ultra64.h" +#include #include "global.h" struct EnHorseLinkChild; diff --git a/soh/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h b/soh/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h index f9445eb18..24c475d24 100644 --- a/soh/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h +++ b/soh/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HORSE_NORMAL_H #define Z_EN_HORSE_NORMAL_H -#include "ultra64.h" +#include #include "global.h" struct EnHorseNormal; diff --git a/soh/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h b/soh/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h index afac221da..1db5a54e5 100644 --- a/soh/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h +++ b/soh/src/overlays/actors/ovl_En_Horse_Zelda/z_en_horse_zelda.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HORSE_ZELDA_H #define Z_EN_HORSE_ZELDA_H -#include "ultra64.h" +#include #include "global.h" struct EnHorseZelda; diff --git a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.h b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.h index f4b89ce15..20eb7b50c 100644 --- a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.h +++ b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HS_H #define Z_EN_HS_H -#include "ultra64.h" +#include #include "global.h" struct EnHs; diff --git a/soh/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h b/soh/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h index e2f66f79c..7b4255458 100644 --- a/soh/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h +++ b/soh/src/overlays/actors/ovl_En_Hs2/z_en_hs2.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HS2_H #define Z_EN_HS2_H -#include "ultra64.h" +#include #include "global.h" struct EnHs2; diff --git a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.h b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.h index 1318305e9..98a5e0d0e 100644 --- a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.h +++ b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.h @@ -1,7 +1,7 @@ #ifndef Z_EN_HY_H #define Z_EN_HY_H -#include "ultra64.h" +#include #include "global.h" typedef enum { diff --git a/soh/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h b/soh/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h index e5ad5fd1c..8392e549d 100644 --- a/soh/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h +++ b/soh/src/overlays/actors/ovl_En_Ice_Hono/z_en_ice_hono.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ICE_HONO_H #define Z_EN_ICE_HONO_H -#include "ultra64.h" +#include #include "global.h" struct EnIceHono; 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 4f9a898f5..82242f7ec 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 @@ -234,8 +234,8 @@ void func_80A74398(Actor* thisx, PlayState* play) { // In vanilla gameplay, Iron Knuckles are despawned based on specific flags in specific scenarios. // In Enemy Randomizer, this made the Iron Knuckles despawn when the same flag was set by other objects. // Instead, rely on the "Clear enemy room" flag when in Enemy Randomizer for Iron Knuckles that aren't Nabooru. - if ((Flags_GetSwitch(play, this->switchFlags) && !CVar_GetS32("gRandomizedEnemies", 0)) || - (thisx->params != 0 && Flags_GetClear(play, play->roomCtx.curRoom.num) && CVar_GetS32("gRandomizedEnemies", 0))) { + if ((Flags_GetSwitch(play, this->switchFlags) && !CVarGetInteger("gRandomizedEnemies", 0)) || + (thisx->params != 0 && Flags_GetClear(play, play->roomCtx.curRoom.num) && CVarGetInteger("gRandomizedEnemies", 0))) { Actor_Kill(thisx); } } else if (thisx->params != 0 && Flags_GetClear(play, play->roomCtx.curRoom.num)) { @@ -298,7 +298,7 @@ void func_80A747C0(EnIk* this, PlayState* play) { this->skelAnime.playSpeed = 1.0f; // Disable miniboss music with Enemy Randomizer because the music would keep // playing if the enemy was never defeated, which is common with Enemy Randomizer. - if (!CVar_GetS32("gRandomizedEnemies", 0)) { + if (!CVarGetInteger("gRandomizedEnemies", 0)) { func_800F5ACC(NA_BGM_MINI_BOSS); } } @@ -658,7 +658,7 @@ void func_80A75A38(EnIk* this, PlayState* play) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0); // Don't set flag when Iron Knuckle is spawned by Enemy Rando. // Instead Iron Knuckles rely on the "clear room" flag when Enemy Rando is on. - if (this->switchFlags != 0xFF && !CVar_GetS32("gRandomizedEnemies",0)) { + if (this->switchFlags != 0xFF && !CVarGetInteger("gRandomizedEnemies",0)) { Flags_SetSwitch(play, this->switchFlags); } Actor_Kill(&this->actor); @@ -805,8 +805,8 @@ Gfx* func_80A761B0(GraphicsContext* gfxCtx, u8 primR, u8 primG, u8 primB, u8 env displayListHead = displayList; gDPPipeSync(displayListHead++); - if (CVar_GetS32("gCosmetics.NPC_IronKnuckles.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.NPC_IronKnuckles.Value", (Color_RGB8){primR, primG, primB}); + if (CVarGetInteger("gCosmetics.NPC_IronKnuckles.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.NPC_IronKnuckles.Value", (Color_RGB8){primR, primG, primB}); gDPSetPrimColor(displayListHead++, 0, 0, color.r, color.g, color.b, 255); } else { gDPSetPrimColor(displayListHead++, 0, 0, primR, primG, primB, 255); @@ -1482,7 +1482,7 @@ void EnIk_Init(Actor* thisx, PlayState* play) { } // Immediately trigger Iron Knuckle for enemy randomizer - if (CVar_GetS32("gRandomizedEnemies", 0) && (thisx->params == 2 || thisx->params == 3)) { + if (CVarGetInteger("gRandomizedEnemies", 0) && (thisx->params == 2 || thisx->params == 3)) { this->skelAnime.playSpeed = 1.0f; } } diff --git a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.h b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.h index 418318e60..a77db20b0 100644 --- a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.h +++ b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.h @@ -1,7 +1,7 @@ #ifndef Z_EN_IK_H #define Z_EN_IK_H -#include "ultra64.h" +#include #include "global.h" struct EnIk; diff --git a/soh/src/overlays/actors/ovl_En_In/z_en_in.h b/soh/src/overlays/actors/ovl_En_In/z_en_in.h index 85c4ad9ed..6494f875d 100644 --- a/soh/src/overlays/actors/ovl_En_In/z_en_in.h +++ b/soh/src/overlays/actors/ovl_En_In/z_en_in.h @@ -1,7 +1,7 @@ #ifndef Z_EN_IN_H #define Z_EN_IN_H -#include "ultra64.h" +#include #include "global.h" struct EnIn; diff --git a/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.h b/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.h index 885f13999..c18b5aa26 100644 --- a/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.h +++ b/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.h @@ -1,7 +1,7 @@ #ifndef Z_EN_INSECT_H #define Z_EN_INSECT_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h" diff --git a/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h b/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h index 3ce7c72bf..254ea0987 100644 --- a/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h +++ b/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ISHI_H #define Z_EN_ISHI_H -#include "ultra64.h" +#include #include "global.h" typedef enum { diff --git a/soh/src/overlays/actors/ovl_En_It/z_en_it.h b/soh/src/overlays/actors/ovl_En_It/z_en_it.h index fb150fcb0..74fce9c8e 100644 --- a/soh/src/overlays/actors/ovl_En_It/z_en_it.h +++ b/soh/src/overlays/actors/ovl_En_It/z_en_it.h @@ -1,7 +1,7 @@ #ifndef Z_EN_IT_H #define Z_EN_IT_H -#include "ultra64.h" +#include #include "global.h" struct EnIt; diff --git a/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.h b/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.h index 3d5a9dc15..cbff1e555 100644 --- a/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.h +++ b/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.h @@ -1,7 +1,7 @@ #ifndef Z_EN_JJ_H #define Z_EN_JJ_H -#include "ultra64.h" +#include #include "global.h" struct EnJj; diff --git a/soh/src/overlays/actors/ovl_En_Js/z_en_js.h b/soh/src/overlays/actors/ovl_En_Js/z_en_js.h index f1e356b2c..d496bb4c3 100644 --- a/soh/src/overlays/actors/ovl_En_Js/z_en_js.h +++ b/soh/src/overlays/actors/ovl_En_Js/z_en_js.h @@ -1,7 +1,7 @@ #ifndef Z_EN_JS_H #define Z_EN_JS_H -#include "ultra64.h" +#include #include "global.h" struct EnJs; 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 70131d1b4..b3ca9f13a 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 @@ -397,7 +397,7 @@ void EnJsjutan_Draw(Actor* thisx, PlayState* play2) { if (this->unk_164) { this->unk_164 = false; - u8* carpTex = ResourceMgr_LoadTexByName(sCarpetTex); + u8* carpTex = GetResourceDataByName(sCarpetTex, false); u8* shadTex = sShadowTex; for (i = 0; i < ARRAY_COUNT(sShadowTex); i++) { if (((u16*)carpTex)[i] != 0) { // Hack to bypass ZAPD exporting textures as u64. diff --git a/soh/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h b/soh/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h index f9d85b6d0..4acc2492f 100644 --- a/soh/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h +++ b/soh/src/overlays/actors/ovl_En_Jsjutan/z_en_jsjutan.h @@ -1,7 +1,7 @@ #ifndef Z_EN_JSJUTAN_H #define Z_EN_JSJUTAN_H -#include "ultra64.h" +#include #include "global.h" struct EnJsjutan; diff --git a/soh/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h b/soh/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h index 6b976c5cc..89d05d260 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h +++ b/soh/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.h @@ -1,7 +1,7 @@ #ifndef Z_EN_KAKASI_H #define Z_EN_KAKASI_H -#include "ultra64.h" +#include #include "global.h" struct EnKakasi; 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 618b8d897..efb05975e 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 @@ -119,7 +119,7 @@ void func_80A90264(EnKakasi2* this, PlayState* play) { this->unk_194++; bool skipScarecrow = play->msgCtx.msgMode == MSGMODE_OCARINA_PLAYING && - ((CVar_GetS32("gSkipScarecrow", 0) && gSaveContext.scarecrowSpawnSongSet) || + ((CVarGetInteger("gSkipScarecrow", 0) && gSaveContext.scarecrowSpawnSongSet) || (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_SCARECROWS_SONG))); if ((BREG(1) != 0) || skipScarecrow && (this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && diff --git a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h index 9309c1672..9a0f61cf5 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h +++ b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.h @@ -1,7 +1,7 @@ #ifndef Z_EN_KAKASI2_H #define Z_EN_KAKASI2_H -#include "ultra64.h" +#include #include "global.h" struct EnKakasi2; diff --git a/soh/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h b/soh/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h index 775f97e90..52754e509 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h +++ b/soh/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.h @@ -1,7 +1,7 @@ #ifndef Z_EN_KAKASI3_H #define Z_EN_KAKASI3_H -#include "ultra64.h" +#include #include "global.h" struct EnKakasi3; diff --git a/soh/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h b/soh/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h index 15e878175..31acd9da0 100644 --- a/soh/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h +++ b/soh/src/overlays/actors/ovl_En_Kanban/z_en_kanban.h @@ -1,7 +1,7 @@ #ifndef Z_EN_KANBAN_H #define Z_EN_KANBAN_H -#include "ultra64.h" +#include #include "global.h" struct EnKanban; diff --git a/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h b/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h index 0687ade58..15e262c1d 100644 --- a/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h +++ b/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h @@ -1,7 +1,7 @@ #ifndef Z_EN_KAREBABA_H #define Z_EN_KAREBABA_H -#include "ultra64.h" +#include #include "global.h" struct EnKarebaba; 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 e011b272d..5f5d146fb 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 @@ -1094,7 +1094,7 @@ void func_80A98DB4(EnKo* this, PlayState* play) { dist = this->actor.xzDistToPlayer; } - if (CVar_GetS32("gDisableKokiriDrawDistance", 0) != 0) { + if (CVarGetInteger("gDisableKokiriDrawDistance", 0) != 0) { this->appearDist = 32767.0f; Math_SmoothStepToF(&this->modelAlpha, (this->appearDist < dist) ? 0.0f : 255.0f, 0.3f, 40.0f, 1.0f); f32 test = this->appearDist; @@ -1375,9 +1375,9 @@ void EnKo_Draw(Actor* thisx, PlayState* play) { Color_RGBA8 tunicColor = sModelInfo[ENKO_TYPE].tunicColor; Color_RGBA8 bootsColor = sModelInfo[ENKO_TYPE].bootsColor; - if (CVar_GetS32("gCosmetics.NPC_Kokiri.Changed", 0)) { - tunicColor = CVar_GetRGBA("gCosmetics.NPC_Kokiri.Value", sModelInfo[ENKO_TYPE].tunicColor); - bootsColor = CVar_GetRGBA("gCosmetics.NPC_Kokiri.Value", sModelInfo[ENKO_TYPE].bootsColor); + if (CVarGetInteger("gCosmetics.NPC_Kokiri.Changed", 0)) { + tunicColor = CVarGetColor("gCosmetics.NPC_Kokiri.Value", sModelInfo[ENKO_TYPE].tunicColor); + bootsColor = CVarGetColor("gCosmetics.NPC_Kokiri.Value", sModelInfo[ENKO_TYPE].bootsColor); } this->actor.shape.shadowAlpha = this->modelAlpha; diff --git a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.h b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.h index efce571d0..5f029a9f6 100644 --- a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.h +++ b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.h @@ -1,7 +1,7 @@ #ifndef Z_EN_KO_H #define Z_EN_KO_H -#include "ultra64.h" +#include #include "global.h" struct EnKo; diff --git a/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index ee0cc7f1a..016dae619 100644 --- a/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -137,9 +137,9 @@ void EnKusa_DropCollectible(EnKusa* this, PlayState* play) { Item_DropCollectibleRandom(play, NULL, &this->actor.world.pos, dropParams << 4); break; case ENKUSA_TYPE_1: - if (CVar_GetS32("gNoRandomDrops", 0)) { + if (CVarGetInteger("gNoRandomDrops", 0)) { } - else if (CVar_GetS32("gNoHeartDrops", 0)) { + else if (CVarGetInteger("gNoHeartDrops", 0)) { Item_DropCollectible(play, &this->actor.world.pos, ITEM00_SEEDS); } else if (Rand_ZeroOne() < 0.5f) { diff --git a/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h b/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h index 3a922ebce..f1e9f24d7 100644 --- a/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h +++ b/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.h @@ -1,7 +1,7 @@ #ifndef Z_EN_KUSA_H #define Z_EN_KUSA_H -#include "ultra64.h" +#include #include "global.h" struct EnKusa; 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 4db606f9b..d44e52569 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 @@ -301,7 +301,7 @@ s32 EnKz_FollowPath(EnKz* this, PlayState* play) { pathDiffZ = pointPos->z - this->actor.world.pos.z; Math_SmoothStepToS(&this->actor.world.rot.y, (Math_FAtan2F(pathDiffX, pathDiffZ) * (0x8000 / M_PI)), 0xA, 0x3E8, 1); - if ((SQ(pathDiffX) + SQ(pathDiffZ)) < 10.0f * CVar_GetS32("gMweepSpeed", 1)) { + if ((SQ(pathDiffX) + SQ(pathDiffZ)) < 10.0f * CVarGetInteger("gMweepSpeed", 1)) { this->waypoint++; if (this->waypoint >= path->count) { this->waypoint = 0; @@ -413,7 +413,7 @@ void EnKz_SetupMweep(EnKz* this, PlayState* play) { initPos.z += 260.0f; Play_CameraSetAtEye(play, this->cutsceneCamera, &pos, &initPos); func_8002DF54(play, &this->actor, 8); - this->actor.speedXZ = 0.1f * CVar_GetS32("gMweepSpeed", 1); + this->actor.speedXZ = 0.1f * CVarGetInteger("gMweepSpeed", 1); this->actionFunc = EnKz_Mweep; } diff --git a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.h b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.h index 1f26eba16..0c7eda2f8 100644 --- a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.h +++ b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.h @@ -1,7 +1,7 @@ #ifndef Z_EN_KZ_H #define Z_EN_KZ_H -#include "ultra64.h" +#include #include "global.h" struct EnKz; diff --git a/soh/src/overlays/actors/ovl_En_Light/z_en_light.h b/soh/src/overlays/actors/ovl_En_Light/z_en_light.h index 1cbf786b0..87daf8649 100644 --- a/soh/src/overlays/actors/ovl_En_Light/z_en_light.h +++ b/soh/src/overlays/actors/ovl_En_Light/z_en_light.h @@ -1,7 +1,7 @@ #ifndef Z_EN_LIGHT_H #define Z_EN_LIGHT_H -#include "ultra64.h" +#include #include "global.h" struct EnLight; diff --git a/soh/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h b/soh/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h index e24afd44e..1ceb4b5e9 100644 --- a/soh/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h +++ b/soh/src/overlays/actors/ovl_En_Lightbox/z_en_lightbox.h @@ -1,7 +1,7 @@ #ifndef Z_EN_LIGHTBOX_H #define Z_EN_LIGHTBOX_H -#include "ultra64.h" +#include #include "global.h" struct EnLightbox; diff --git a/soh/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.h b/soh/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.h index 10d3e3fef..49565cf17 100644 --- a/soh/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.h +++ b/soh/src/overlays/actors/ovl_En_M_Fire1/z_en_m_fire1.h @@ -1,7 +1,7 @@ #ifndef Z_EN_M_FIRE1_H #define Z_EN_M_FIRE1_H -#include "ultra64.h" +#include #include "global.h" struct EnMFire1; diff --git a/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index 391086861..e088b9f10 100644 --- a/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -340,8 +340,8 @@ void EnMThunder_Draw(Actor* thisx, PlayState* play2) { switch (this->unk_1C6) { case 0: - if (CVar_GetS32("gCosmetics.SpinAttack_Level2Primary.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.SpinAttack_Level2Primary.Value", (Color_RGB8){255, 255, 170}); + if (CVarGetInteger("gCosmetics.SpinAttack_Level2Primary.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.SpinAttack_Level2Primary.Value", (Color_RGB8){255, 255, 170}); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, color.r, color.g, color.b, (u8)(this->unk_1B0 * 255)); } else { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 170, (u8)(this->unk_1B0 * 255)); @@ -350,8 +350,8 @@ void EnMThunder_Draw(Actor* thisx, PlayState* play2) { gSPDisplayList(POLY_XLU_DISP++, gSpinAttack4DL); break; case 1: - if (CVar_GetS32("gCosmetics.SpinAttack_Level1Primary.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.SpinAttack_Level1Primary.Value", (Color_RGB8){170, 255, 255}); + if (CVarGetInteger("gCosmetics.SpinAttack_Level1Primary.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.SpinAttack_Level1Primary.Value", (Color_RGB8){170, 255, 255}); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, color.r, color.g, color.b, (u8)(this->unk_1B0 * 255)); } else { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, (u8)(this->unk_1B0 * 255)); @@ -383,14 +383,14 @@ void EnMThunder_Draw(Actor* thisx, PlayState* play2) { if (this->unk_1B8 >= 0.85f) { phi_f14 = (D_80AA046C[(play->gameplayFrames & 7)] * 6.0f) + 1.0f; - if (CVar_GetS32("gCosmetics.SpinAttack_Level2Primary.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.SpinAttack_Level2Primary.Value", (Color_RGB8){255, 255, 170}); + if (CVarGetInteger("gCosmetics.SpinAttack_Level2Primary.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.SpinAttack_Level2Primary.Value", (Color_RGB8){255, 255, 170}); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, color.r, color.g, color.b, this->unk_1C8); } else { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 170, this->unk_1C8); } - if (CVar_GetS32("gCosmetics.SpinAttack_Level2Secondary.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.SpinAttack_Level2Secondary.Value", (Color_RGB8){255, 100, 0}); + if (CVarGetInteger("gCosmetics.SpinAttack_Level2Secondary.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.SpinAttack_Level2Secondary.Value", (Color_RGB8){255, 100, 0}); gDPSetEnvColor(POLY_XLU_DISP++, color.r, color.g, color.b, 128); } else { gDPSetEnvColor(POLY_XLU_DISP++, 255, 100, 0, 128); @@ -398,14 +398,14 @@ void EnMThunder_Draw(Actor* thisx, PlayState* play2) { phi_t1 = 0x28; } else { phi_f14 = (D_80AA046C[play->gameplayFrames & 7] * 2.0f) + 1.0f; - if (CVar_GetS32("gCosmetics.SpinAttack_Level1Primary.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.SpinAttack_Level1Primary.Value", (Color_RGB8){170, 255, 255}); + if (CVarGetInteger("gCosmetics.SpinAttack_Level1Primary.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.SpinAttack_Level1Primary.Value", (Color_RGB8){170, 255, 255}); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, color.r, color.g, color.b, this->unk_1C8); } else { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 170, 255, 255, this->unk_1C8); } - if (CVar_GetS32("gCosmetics.SpinAttack_Level1Secondary.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.SpinAttack_Level1Secondary.Value", (Color_RGB8){0, 100, 255}); + if (CVarGetInteger("gCosmetics.SpinAttack_Level1Secondary.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.SpinAttack_Level1Secondary.Value", (Color_RGB8){0, 100, 255}); gDPSetEnvColor(POLY_XLU_DISP++, color.r, color.g, color.b, 128); } else { gDPSetEnvColor(POLY_XLU_DISP++, 0, 100, 255, 128); diff --git a/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h b/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h index 4cb7ad215..5b1caa993 100644 --- a/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h +++ b/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.h @@ -1,7 +1,7 @@ #ifndef Z_EN_M_THUNDER_H #define Z_EN_M_THUNDER_H -#include "ultra64.h" +#include #include "global.h" struct EnMThunder; diff --git a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h index 078a0ed11..2ae4c95ca 100644 --- a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h +++ b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.h @@ -1,7 +1,7 @@ #ifndef Z_EN_MA1_H #define Z_EN_MA1_H -#include "ultra64.h" +#include #include "global.h" struct EnMa1; diff --git a/soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h b/soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h index 249bb5574..ef8a4a996 100644 --- a/soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h +++ b/soh/src/overlays/actors/ovl_En_Ma2/z_en_ma2.h @@ -1,7 +1,7 @@ #ifndef Z_EN_MA2_H #define Z_EN_MA2_H -#include "ultra64.h" +#include #include "global.h" struct EnMa2; diff --git a/soh/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h b/soh/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h index 549d60c97..8f82c00f7 100644 --- a/soh/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h +++ b/soh/src/overlays/actors/ovl_En_Ma3/z_en_ma3.h @@ -1,7 +1,7 @@ #ifndef Z_EN_MA3_H #define Z_EN_MA3_H -#include "ultra64.h" +#include #include "global.h" struct EnMa3; 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 8bfb193ee..052c77f5f 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 @@ -572,7 +572,7 @@ void EnMag_DrawImageRGBA32(Gfx** gfxp, s16 centerX, s16 centerY, const char* sou s32 pad; s32 i; - source = ResourceMgr_LoadTexByName(source); + source = GetResourceDataByName(source, false); Gfx_SetupDL_56Ptr(&gfx); @@ -666,7 +666,7 @@ void EnMag_DrawInnerMq(Actor* thisx, PlayState* play, Gfx** gfxp) { u16 rectTop; u16 length; int lang = LANGUAGE_ENG; - if (CVar_GetS32("gTitleScreenTranslation", 0)) { + if (CVarGetInteger("gTitleScreenTranslation", 0)) { lang = gSaveContext.language; } @@ -861,7 +861,7 @@ void EnMag_DrawInnerVanilla(Actor* thisx, PlayState* play, Gfx** gfxp) { u16 rectTop; u16 length; int lang = LANGUAGE_ENG; - if (CVar_GetS32("gTitleScreenTranslation", 0)) { + if (CVarGetInteger("gTitleScreenTranslation", 0)) { lang = gSaveContext.language; } diff --git a/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.h b/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.h index a9f1b9d14..041a0274c 100644 --- a/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.h +++ b/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.h @@ -1,7 +1,7 @@ #ifndef Z_EN_MAG_H #define Z_EN_MAG_H -#include "ultra64.h" +#include #include "global.h" struct EnMag; 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 97e7e90f6..f932e9aa5 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 @@ -509,7 +509,7 @@ void EnMb_SetupClubAttack(EnMb* this) { // Rotate Club Moblin towards player in Enemy Randomizer because they're // borderline useless otherwise in most scenarios. - if (CVar_GetS32("gRandomizedEnemies", 0)) { + if (CVarGetInteger("gRandomizedEnemies", 0)) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 100.0f, 0); Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 100.0f, 0); } @@ -714,7 +714,7 @@ void EnMb_ClubWaitAfterAttack(EnMb* this, PlayState* play) { // Rotate Club Moblin towards player in Enemy Randomizer because they're // borderline useless otherwise in most scenarios. - if (CVar_GetS32("gRandomizedEnemies", 0)) { + if (CVarGetInteger("gRandomizedEnemies", 0)) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 100.0f, 0); Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 100.0f, 0); } @@ -841,7 +841,7 @@ void EnMb_ClubAttack(EnMb* this, PlayState* play) { // Rotate Club Moblin towards player in Enemy Randomizer because they're // borderline useless otherwise in most scenarios. - if (!CVar_GetS32("gRandomizedEnemies", 0)) { + if (!CVarGetInteger("gRandomizedEnemies", 0)) { Math_SmoothStepToS(&this->actor.shape.rot.y, relYawTarget[this->attack - 1] + this->actor.world.rot.y, 1, 0x2EE, 0); } else { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 100.0f, 0); @@ -888,7 +888,7 @@ void EnMb_ClubAttack(EnMb* this, PlayState* play) { // Disable camera shake when the Moblin attacks with Enemy Randomizer enabled. // This camera shake gets very annoying as these Moblins can spawn in many rooms, // and also often (initially) out of reach for the player. - if (!CVar_GetS32("gRandomizedEnemies", 0)) { + if (!CVarGetInteger("gRandomizedEnemies", 0)) { Camera_AddQuake(&play->mainCamera, 2, 0x19, 5); } func_800358DC(&this->actor, &effSpawnPos, &this->actor.world.rot, flamesParams, 20, flamesUnused, play, @@ -1264,7 +1264,7 @@ void EnMb_ClubWaitPlayerNear(EnMb* this, PlayState* play) { // Rotate Club Moblin towards player in Enemy Randomizer because they're // borderline useless otherwise in most scenarios. - if (CVar_GetS32("gRandomizedEnemies", 0)) { + if (CVarGetInteger("gRandomizedEnemies", 0)) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 100.0f, 0); Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 3, 100.0f, 0); } @@ -1275,7 +1275,7 @@ void EnMb_ClubWaitPlayerNear(EnMb* this, PlayState* play) { // Add a height check to the Moblin's Club attack when Enemy Randomizer is on. // Without the height check, the Moblin will attack (and play the sound effect) a lot even though // the Moblin is very far away from the player in vertical rooms (like the first room in Deku Tree). - s8 enemyRando = CVar_GetS32("gRandomizedEnemies", 0); + s8 enemyRando = CVarGetInteger("gRandomizedEnemies", 0); if (!enemyRando || (enemyRando && this->actor.yDistToPlayer <= 100.0f && this->actor.yDistToPlayer >= -100.0f)) { EnMb_SetupClubAttack(this); } diff --git a/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.h b/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.h index ac20ceede..10c1099ff 100644 --- a/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.h +++ b/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.h @@ -1,7 +1,7 @@ #ifndef Z_EN_MB_H #define Z_EN_MB_H -#include "ultra64.h" +#include #include "global.h" struct EnMb; 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 82d56124a..cf788bf07 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 @@ -624,7 +624,7 @@ void func_80AAB5A4(EnMd* this, PlayState* play) { f32 temp; if (play->sceneNum != SCENE_KOKIRI_HOME4) { - if (CVar_GetS32("gDisableKokiriDrawDistance", 0) != 0) { + if (CVarGetInteger("gDisableKokiriDrawDistance", 0) != 0) { temp = (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !(gSaveContext.eventChkInf[1] & 0x1000) && (play->sceneNum == SCENE_SPOT04)) ? 100.0f diff --git a/soh/src/overlays/actors/ovl_En_Md/z_en_md.h b/soh/src/overlays/actors/ovl_En_Md/z_en_md.h index 415d15e50..c9f38449d 100644 --- a/soh/src/overlays/actors/ovl_En_Md/z_en_md.h +++ b/soh/src/overlays/actors/ovl_En_Md/z_en_md.h @@ -1,7 +1,7 @@ #ifndef Z_EN_MD_H #define Z_EN_MD_H -#include "ultra64.h" +#include #include "global.h" struct EnMd; diff --git a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.h b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.h index 5b8a438a0..8ad4f1469 100644 --- a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.h +++ b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.h @@ -1,7 +1,7 @@ #ifndef Z_EN_MK_H #define Z_EN_MK_H -#include "ultra64.h" +#include #include "global.h" struct EnMk; diff --git a/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.h b/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.h index 7646e1f04..7ae84960d 100644 --- a/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.h +++ b/soh/src/overlays/actors/ovl_En_Mm/z_en_mm.h @@ -1,7 +1,7 @@ #ifndef Z_EN_MM_H #define Z_EN_MM_H -#include "ultra64.h" +#include #include "global.h" struct EnMm; diff --git a/soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h b/soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h index a5edeb9cb..ea66557b7 100644 --- a/soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h +++ b/soh/src/overlays/actors/ovl_En_Mm2/z_en_mm2.h @@ -1,7 +1,7 @@ #ifndef Z_EN_MM2_H #define Z_EN_MM2_H -#include "ultra64.h" +#include #include "global.h" struct EnMm2; diff --git a/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.h b/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.h index 53c6bbeac..70b105073 100644 --- a/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.h +++ b/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.h @@ -1,7 +1,7 @@ #ifndef Z_EN_MS_H #define Z_EN_MS_H -#include "ultra64.h" +#include #include "global.h" struct EnMs; diff --git a/soh/src/overlays/actors/ovl_En_Mu/z_en_mu.h b/soh/src/overlays/actors/ovl_En_Mu/z_en_mu.h index 1f2bf0f32..9514acfac 100644 --- a/soh/src/overlays/actors/ovl_En_Mu/z_en_mu.h +++ b/soh/src/overlays/actors/ovl_En_Mu/z_en_mu.h @@ -1,7 +1,7 @@ #ifndef Z_EN_MU_H #define Z_EN_MU_H -#include "ultra64.h" +#include #include "global.h" struct EnMu; diff --git a/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.h b/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.h index 89f49fc76..e112e2a4c 100644 --- a/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.h +++ b/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.h @@ -1,7 +1,7 @@ #ifndef Z_EN_NB_H #define Z_EN_NB_H -#include "ultra64.h" +#include #include "global.h" struct EnNb; diff --git a/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.h b/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.h index 48f2624a1..b6a6d96bb 100644 --- a/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.h +++ b/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.h @@ -1,7 +1,7 @@ #ifndef Z_EN_NIW_H #define Z_EN_NIW_H -#include "ultra64.h" +#include #include "global.h" struct EnNiw; diff --git a/soh/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.h b/soh/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.h index e9ef3b081..4a2476d14 100644 --- a/soh/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.h +++ b/soh/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.h @@ -1,7 +1,7 @@ #ifndef Z_EN_NIW_GIRL_H #define Z_EN_NIW_GIRL_H -#include "ultra64.h" +#include #include "global.h" #include "../ovl_En_Niw/z_en_niw.h" diff --git a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h index 9ec191338..fa35b78a6 100644 --- a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h +++ b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.h @@ -1,7 +1,7 @@ #ifndef Z_EN_NIW_LADY_H #define Z_EN_NIW_LADY_H -#include "ultra64.h" +#include #include "global.h" struct EnNiwLady; diff --git a/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c b/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c index 7984342c2..be2fd2ec5 100644 --- a/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c +++ b/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c @@ -75,7 +75,7 @@ void EnNutsball_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 400.0f, ActorShadow_DrawCircle, 13.0f); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); - if (CVar_GetS32("gRandomizedEnemies", 0)) { + if (CVarGetInteger("gRandomizedEnemies", 0)) { this->objBankIndex = 0; } else { this->objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIDs[this->actor.params]); @@ -176,7 +176,7 @@ void EnNutsball_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx); - if (CVar_GetS32("gNewDrops", 0) != 0) { + if (CVarGetInteger("gNewDrops", 0) != 0) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 1 * (play->state.frames * 6), diff --git a/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h b/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h index 5a59e27d9..8ab757452 100644 --- a/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h +++ b/soh/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.h @@ -1,7 +1,7 @@ #ifndef Z_EN_NUTSBALL_H #define Z_EN_NUTSBALL_H -#include "ultra64.h" +#include #include "global.h" struct EnNutsball; diff --git a/soh/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h b/soh/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h index 0014a613d..69c7dd0d3 100644 --- a/soh/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h +++ b/soh/src/overlays/actors/ovl_En_Nwc/z_en_nwc.h @@ -1,7 +1,7 @@ #ifndef Z_EN_NWC_H #define Z_EN_NWC_H -#include "ultra64.h" +#include #include "global.h" struct EnNwc; diff --git a/soh/src/overlays/actors/ovl_En_Ny/z_en_ny.h b/soh/src/overlays/actors/ovl_En_Ny/z_en_ny.h index 6ac92a769..85aced76c 100644 --- a/soh/src/overlays/actors/ovl_En_Ny/z_en_ny.h +++ b/soh/src/overlays/actors/ovl_En_Ny/z_en_ny.h @@ -1,7 +1,7 @@ #ifndef Z_EN_NY_H #define Z_EN_NY_H -#include "ultra64.h" +#include #include "global.h" struct EnNy; diff --git a/soh/src/overlays/actors/ovl_En_OE2/z_en_oe2.h b/soh/src/overlays/actors/ovl_En_OE2/z_en_oe2.h index 635495bb7..ee2d301e6 100644 --- a/soh/src/overlays/actors/ovl_En_OE2/z_en_oe2.h +++ b/soh/src/overlays/actors/ovl_En_OE2/z_en_oe2.h @@ -1,7 +1,7 @@ #ifndef Z_EN_OE2_H #define Z_EN_OE2_H -#include "ultra64.h" +#include #include "global.h" struct EnOE2; diff --git a/soh/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.h b/soh/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.h index f45c4a88e..84d2f4394 100644 --- a/soh/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.h +++ b/soh/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.h @@ -1,7 +1,7 @@ #ifndef Z_EN_OKARINA_EFFECT_H #define Z_EN_OKARINA_EFFECT_H -#include "ultra64.h" +#include #include "global.h" struct EnOkarinaEffect; diff --git a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h index 1192d0cfc..8c947c335 100644 --- a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h +++ b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h @@ -1,7 +1,7 @@ #ifndef Z_EN_OKARINA_TAG_H #define Z_EN_OKARINA_TAG_H -#include "ultra64.h" +#include #include "global.h" struct EnOkarinaTag; 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 1112e56c5..92a49fc57 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 @@ -501,7 +501,7 @@ void EnOkuta_ProjectileFly(EnOkuta* this, PlayState* play) { pos.x = this->actor.world.pos.x; pos.y = this->actor.world.pos.y + 11.0f; pos.z = this->actor.world.pos.z; - if (CVar_GetS32("gNewDrops", 0) != 0) { + if (CVarGetInteger("gNewDrops", 0) != 0) { static s16 sEffectScales[] = { 145, 135, 115, 85, 75, 53, 45, 40, 35, }; @@ -758,7 +758,7 @@ void EnOkuta_Draw(Actor* thisx, PlayState* play) { } else { OPEN_DISPS(play->state.gfxCtx); - if (CVar_GetS32("gNewDrops", 0) != 0) { + if (CVarGetInteger("gNewDrops", 0) != 0) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x08, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 1 * (play->state.frames * 6), diff --git a/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h b/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h index 01c2ba114..7bc257b9c 100644 --- a/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h +++ b/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.h @@ -1,7 +1,7 @@ #ifndef Z_EN_OKUTA_H #define Z_EN_OKUTA_H -#include "ultra64.h" +#include #include "global.h" struct EnOkuta; 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 9ec5965ba..1d9ea6608 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 @@ -964,7 +964,7 @@ s32 EnOssan_FacingShopkeeperDialogResult(EnOssan* this, PlayState* play) { void EnOssan_State_FacingShopkeeper(EnOssan* this, PlayState* play, Player* player) { Input* input = &play->state.input[0]; u8 nextIndex; - bool dpad = CVar_GetS32("gDpadText", 0); + bool dpad = CVarGetInteger("gDpadText", 0); if ((Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE) && !EnOssan_TestEndInteraction(this, play, &play->state.input[0])) { @@ -1043,7 +1043,7 @@ void EnOssan_CursorUpDown(EnOssan* this, PlayState* play) { Input* input = &play->state.input[0]; u8 curTemp = this->cursorIndex; u8 curScanTemp; - bool dpad = CVar_GetS32("gDpadText", 0); + bool dpad = CVarGetInteger("gDpadText", 0); if ((this->stickAccumY < 0) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) { curTemp &= 0xFE; @@ -1196,7 +1196,7 @@ void EnOssan_State_BrowseLeftShelf(EnOssan* this, PlayState* play, Player* playe u8 prevIndex = this->cursorIndex; s32 c; s32 d; - bool dpad = CVar_GetS32("gDpadText", 0); + bool dpad = CVarGetInteger("gDpadText", 0); if (!EnOssan_ReturnItemToShelf(this)) { osSyncPrintf("%s[%d]:" VT_FGCOL(GREEN) "ズーム中!!" VT_RST "\n", __FILE__, __LINE__); @@ -1256,7 +1256,7 @@ void EnOssan_State_BrowseRightShelf(EnOssan* this, PlayState* play, Player* play s32 pad[2]; u8 prevIndex; u8 nextIndex; - bool dpad = CVar_GetS32("gDpadText", 0); + bool dpad = CVarGetInteger("gDpadText", 0); prevIndex = this->cursorIndex; if (!EnOssan_ReturnItemToShelf(this)) { @@ -1930,9 +1930,9 @@ void EnOssan_UpdateItemSelectedProperty(EnOssan* this) { void EnOssan_UpdateCursorAnim(EnOssan* this) { Color_RGB8 aButtonColor = { 0, 80, 255 }; - if (CVar_GetS32("gCosmetics.Hud_AButton.Changed", 0)) { - aButtonColor = CVar_GetRGB("gCosmetics.Hud_AButton.Value", aButtonColor); - } else if (CVar_GetS32("gCosmetics.DefaultColorScheme", 0)) { + if (CVarGetInteger("gCosmetics.Hud_AButton.Changed", 0)) { + aButtonColor = CVarGetColor24("gCosmetics.Hud_AButton.Value", aButtonColor); + } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", 0)) { aButtonColor = (Color_RGB8){ 0, 255, 80 }; } f32 t; diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h index 42084f903..08efaf9af 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.h @@ -1,7 +1,7 @@ #ifndef Z_EN_OSSAN_H #define Z_EN_OSSAN_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_En_Tana/z_en_tana.h" #include "overlays/actors/ovl_En_GirlA/z_en_girla.h" 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 b3c21b1f6..20c5373c1 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 @@ -369,7 +369,7 @@ void func_80ACA7E0(EnOwl* this, PlayState* play) { void EnOwl_ConfirmKokiriMessage(EnOwl* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { // swap the order of the responses if better owl is enabled - uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); + uint8_t index = CVarGetInteger("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: Message_ContinueTextbox(play, 0x2065); @@ -398,7 +398,7 @@ void EnOwl_WaitOutsideKokiri(EnOwl* this, PlayState* play) { void func_80ACA998(EnOwl* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { // swap the order of the responses if better owl is enabled - uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); + uint8_t index = CVarGetInteger("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: Message_ContinueTextbox(play, 0x2069); @@ -444,7 +444,7 @@ void EnOwl_WaitHyruleCastle(EnOwl* this, PlayState* play) { void func_80ACAB88(EnOwl* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { // swap the order of the responses if better owl is enabled - uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); + uint8_t index = CVarGetInteger("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: // obtained zelda's letter @@ -487,7 +487,7 @@ void EnOwl_WaitKakariko(EnOwl* this, PlayState* play) { void func_80ACAD34(EnOwl* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { // swap the order of the responses if better owl is enabled - uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); + uint8_t index = CVarGetInteger("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: Message_ContinueTextbox(play, 0x206F); @@ -525,7 +525,7 @@ void EnOwl_WaitGerudo(EnOwl* this, PlayState* play) { void func_80ACAEB8(EnOwl* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { // swap the order of the responses if better owl is enabled - uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); + uint8_t index = CVarGetInteger("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: Message_ContinueTextbox(play, 0x2071); @@ -647,7 +647,7 @@ void EnOwl_WaitDeathMountainShortcut(EnOwl* this, PlayState* play) { void func_80ACB344(EnOwl* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { // swap the order of the responses if better owl is enabled - uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); + uint8_t index = CVarGetInteger("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: Message_ContinueTextbox(play, 0x607A); @@ -672,7 +672,7 @@ void func_80ACB3E0(EnOwl* this, PlayState* play) { void func_80ACB440(EnOwl* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { // swap the order of the responses if better owl is enabled - uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); + uint8_t index = CVarGetInteger("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: Message_ContinueTextbox(play, 0x10C1); @@ -709,7 +709,7 @@ void EnOwl_WaitLWPreSaria(EnOwl* this, PlayState* play) { void func_80ACB5C4(EnOwl* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { // swap the order of the responses if better owl is enabled - uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); + uint8_t index = CVarGetInteger("gBetterOwl", 0) == 0 ? play->msgCtx.choiceIndex : (1 - play->msgCtx.choiceIndex); switch (index) { case OWL_REPEAT: Message_ContinueTextbox(play, 0x10C5); diff --git a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.h b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.h index d34e72283..7a20eaa3a 100644 --- a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.h +++ b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.h @@ -1,7 +1,7 @@ #ifndef Z_EN_OWL_H #define Z_EN_OWL_H -#include "ultra64.h" +#include #include "global.h" struct EnOwl; diff --git a/soh/src/overlays/actors/ovl_En_Part/z_en_part.h b/soh/src/overlays/actors/ovl_En_Part/z_en_part.h index 3502d80a8..030431c06 100644 --- a/soh/src/overlays/actors/ovl_En_Part/z_en_part.h +++ b/soh/src/overlays/actors/ovl_En_Part/z_en_part.h @@ -1,7 +1,7 @@ #ifndef Z_EN_PART_H #define Z_EN_PART_H -#include "ultra64.h" +#include #include "global.h" struct EnPart; 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 df82506c5..318fe2b8b 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 @@ -325,7 +325,7 @@ void EnPeehat_Ground_SetStateGround(EnPeehat* this) { void EnPeehat_Ground_StateGround(EnPeehat* this, PlayState* play) { // Keep the peahat as the version that doesn't spawn extra enemies and can actually be killed // when Enemy Randomizer is on. - if (IS_DAY || CVar_GetS32("gRandomizedEnemies", 0)) { + if (IS_DAY || CVarGetInteger("gRandomizedEnemies", 0)) { this->actor.flags |= ACTOR_FLAG_0; if (this->riseDelayTimer == 0) { if (this->actor.xzDistToPlayer < this->xzDistToRise) { diff --git a/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h b/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h index 706ec34bb..009a2d8f7 100644 --- a/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h +++ b/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.h @@ -1,7 +1,7 @@ #ifndef Z_EN_PEEHAT_H #define Z_EN_PEEHAT_H -#include "ultra64.h" +#include #include "global.h" typedef enum { diff --git a/soh/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.h b/soh/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.h index aeb2503ed..fabe3a65d 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.h +++ b/soh/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.h @@ -1,7 +1,7 @@ #ifndef Z_EN_PO_DESERT_H #define Z_EN_PO_DESERT_H -#include "ultra64.h" +#include #include "global.h" struct EnPoDesert; diff --git a/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h b/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h index 7f5273e74..5b608ad06 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h +++ b/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.h @@ -1,7 +1,7 @@ #ifndef Z_EN_PO_FIELD_H #define Z_EN_PO_FIELD_H -#include "ultra64.h" +#include #include "global.h" struct EnPoField; diff --git a/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h b/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h index 70567ada7..bfc76cef9 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h +++ b/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.h @@ -1,7 +1,7 @@ #ifndef Z_EN_PO_RELAY_H #define Z_EN_PO_RELAY_H -#include "ultra64.h" +#include #include "global.h" struct EnPoRelay; diff --git a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h index 913291551..2bd780983 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h +++ b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.h @@ -1,7 +1,7 @@ #ifndef Z_EN_PO_SISTERS_H #define Z_EN_PO_SISTERS_H -#include "ultra64.h" +#include #include "global.h" struct EnPoSisters; diff --git a/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.h b/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.h index 8c57fd512..e0d2e7a8f 100644 --- a/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.h +++ b/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.h @@ -1,7 +1,7 @@ #ifndef Z_EN_POH_H #define Z_EN_POH_H -#include "ultra64.h" +#include #include "global.h" struct EnPoh; diff --git a/soh/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.h b/soh/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.h index 0aa0aaaf4..fe5c86548 100644 --- a/soh/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.h +++ b/soh/src/overlays/actors/ovl_En_Pu_box/z_en_pu_box.h @@ -1,7 +1,7 @@ #ifndef Z_EN_PU_BOX_H #define Z_EN_PU_BOX_H -#include "ultra64.h" +#include #include "global.h" struct EnPubox; 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 7aa37cedb..5ebf0a697 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 @@ -251,7 +251,7 @@ void func_80AE2744(EnRd* this, PlayState* play) { // Add a height check to redeads/gibdos freeze when Enemy Randomizer is on. // Without the height check, redeads/gibdos can freeze the player from insane distances in // vertical rooms (like the first room in Deku Tree), making these rooms nearly unplayable. - s8 enemyRando = CVar_GetS32("gRandomizedEnemies", 0); + s8 enemyRando = CVarGetInteger("gRandomizedEnemies", 0); if (!enemyRando || (enemyRando && this->actor.yDistToPlayer <= 100.0f && this->actor.yDistToPlayer >= -100.0f)) { if ((this->actor.params != 2) && (this->unk_305 == 0)) { func_80AE37BC(this); @@ -664,7 +664,7 @@ void func_80AE3C98(EnRd* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { if (this->unk_30C == 0) { // Don't set this flag in Enemy Rando as it can overlap with other objects using the same flag. - if (!Flags_GetSwitch(play, this->unk_312 & 0x7F) && !CVar_GetS32("gRandomizedEnemies", 0)) { + if (!Flags_GetSwitch(play, this->unk_312 & 0x7F) && !CVarGetInteger("gRandomizedEnemies", 0)) { Flags_SetSwitch(play, this->unk_312 & 0x7F); } if (this->unk_314 != 0) { diff --git a/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.h b/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.h index 09304f39b..c7518f569 100644 --- a/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.h +++ b/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.h @@ -1,7 +1,7 @@ #ifndef Z_EN_RD_H #define Z_EN_RD_H -#include "ultra64.h" +#include #include "global.h" struct EnRd; diff --git a/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h b/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h index 61ff9666c..6d31a41dc 100644 --- a/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h +++ b/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.h @@ -1,7 +1,7 @@ #ifndef Z_EN_REEBA_H #define Z_EN_REEBA_H -#include "ultra64.h" +#include #include "global.h" struct EnReeba; diff --git a/soh/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h b/soh/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h index 48cdec740..b47c7e523 100644 --- a/soh/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h +++ b/soh/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.h @@ -1,7 +1,7 @@ #ifndef Z_EN_RIVER_SOUND_H #define Z_EN_RIVER_SOUND_H -#include "ultra64.h" +#include #include "global.h" struct EnRiverSound; diff --git a/soh/src/overlays/actors/ovl_En_Rl/z_en_rl.h b/soh/src/overlays/actors/ovl_En_Rl/z_en_rl.h index 9aa6b9ae6..d47e34677 100644 --- a/soh/src/overlays/actors/ovl_En_Rl/z_en_rl.h +++ b/soh/src/overlays/actors/ovl_En_Rl/z_en_rl.h @@ -1,7 +1,7 @@ #ifndef Z_EN_RL_H #define Z_EN_RL_H -#include "ultra64.h" +#include #include "global.h" struct EnRl; diff --git a/soh/src/overlays/actors/ovl_En_Rr/z_en_rr.h b/soh/src/overlays/actors/ovl_En_Rr/z_en_rr.h index aa1f78207..3369bfb77 100644 --- a/soh/src/overlays/actors/ovl_En_Rr/z_en_rr.h +++ b/soh/src/overlays/actors/ovl_En_Rr/z_en_rr.h @@ -1,7 +1,7 @@ #ifndef Z_EN_RR_H #define Z_EN_RR_H -#include "ultra64.h" +#include #include "global.h" struct EnRr; diff --git a/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h b/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h index d5ed7b3a6..a582c62eb 100644 --- a/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h +++ b/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h @@ -1,7 +1,7 @@ #ifndef Z_EN_RU1_H #define Z_EN_RU1_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h" diff --git a/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h b/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h index be13c2095..5334857fc 100644 --- a/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h +++ b/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.h @@ -1,7 +1,7 @@ #ifndef Z_EN_RU2_H #define Z_EN_RU2_H -#include "ultra64.h" +#include #include "global.h" struct EnRu2; 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 5823e3539..60045eaa4 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 @@ -745,7 +745,7 @@ void EnSa_Update(Actor* thisx, PlayState* play) { } if (this->actionFunc != func_80AF68E4) { - if (CVar_GetS32("gDisableKokiriDrawDistance", 0) != 0) { + if (CVarGetInteger("gDisableKokiriDrawDistance", 0) != 0) { this->alpha = func_80034DD4(&this->actor, play, this->alpha, 32767); } else { diff --git a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.h b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.h index 3fc8e3d6d..65e853cac 100644 --- a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.h +++ b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.h @@ -1,7 +1,7 @@ #ifndef Z_EN_SA_H #define Z_EN_SA_H -#include "ultra64.h" +#include #include "global.h" struct EnSa; diff --git a/soh/src/overlays/actors/ovl_En_Sb/z_en_sb.h b/soh/src/overlays/actors/ovl_En_Sb/z_en_sb.h index a6dbd2cdf..1d0272c41 100644 --- a/soh/src/overlays/actors/ovl_En_Sb/z_en_sb.h +++ b/soh/src/overlays/actors/ovl_En_Sb/z_en_sb.h @@ -1,7 +1,7 @@ #ifndef Z_EN_SB_H #define Z_EN_SB_H -#include "ultra64.h" +#include #include "global.h" struct EnSb; diff --git a/soh/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.h b/soh/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.h index 4add7d11e..d8d84755c 100644 --- a/soh/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.h +++ b/soh/src/overlays/actors/ovl_En_Scene_Change/z_en_scene_change.h @@ -1,7 +1,7 @@ #ifndef Z_ITEM_SCENE_CHANGE_H #define Z_ITEM_SCENE_CHANGE_H -#include "ultra64.h" +#include #include "global.h" struct EnSceneChange; diff --git a/soh/src/overlays/actors/ovl_En_Sda/z_en_sda.h b/soh/src/overlays/actors/ovl_En_Sda/z_en_sda.h index 4dd2abd3a..f647ddfc7 100644 --- a/soh/src/overlays/actors/ovl_En_Sda/z_en_sda.h +++ b/soh/src/overlays/actors/ovl_En_Sda/z_en_sda.h @@ -1,7 +1,7 @@ #ifndef Z_EN_SDA_H #define Z_EN_SDA_H -#include "ultra64.h" +#include #include "global.h" struct EnSda; diff --git a/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h b/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h index 6ebfeabf3..df052a26f 100644 --- a/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h +++ b/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.h @@ -1,7 +1,7 @@ #ifndef Z_EN_SHOPNUTS_H #define Z_EN_SHOPNUTS_H -#include "ultra64.h" +#include #include "global.h" struct EnShopnuts; 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 7c0d46a10..4a80a683e 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 @@ -106,7 +106,7 @@ void func_80AFB768(EnSi* this, PlayState* play) { } else { Item_Give(play, giveItemId); } - if ((CVar_GetS32("gSkulltulaFreeze", 0) != 1 || giveItemId != ITEM_SKULL_TOKEN) && getItemId != RG_ICE_TRAP) { + if ((CVarGetInteger("gSkulltulaFreeze", 0) != 1 || giveItemId != ITEM_SKULL_TOKEN) && getItemId != RG_ICE_TRAP) { player->actor.freezeTimer = 20; } @@ -161,7 +161,7 @@ void func_80AFB950(EnSi* this, PlayState* play) { Player* player = GET_PLAYER(play); if (Message_GetState(&play->msgCtx) != TEXT_STATE_CLOSING && - ((CVar_GetS32("gSkulltulaFreeze", 0) != 1 || giveItemId != ITEM_SKULL_TOKEN) && getItemId != RG_ICE_TRAP)) { + ((CVarGetInteger("gSkulltulaFreeze", 0) != 1 || giveItemId != ITEM_SKULL_TOKEN) && getItemId != RG_ICE_TRAP)) { player->actor.freezeTimer = 10; } else { SET_GS_FLAGS((this->actor.params & 0x1F00) >> 8, this->actor.params & 0xFF); diff --git a/soh/src/overlays/actors/ovl_En_Si/z_en_si.h b/soh/src/overlays/actors/ovl_En_Si/z_en_si.h index b52e831a3..dc0a3b400 100644 --- a/soh/src/overlays/actors/ovl_En_Si/z_en_si.h +++ b/soh/src/overlays/actors/ovl_En_Si/z_en_si.h @@ -1,7 +1,7 @@ #ifndef Z_EN_SI_H #define Z_EN_SI_H -#include "ultra64.h" +#include #include "global.h" struct EnSi; diff --git a/soh/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h b/soh/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h index b291c5cd2..95272ec96 100644 --- a/soh/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h +++ b/soh/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.h @@ -1,7 +1,7 @@ #ifndef Z_EN_SIOFUKI_H #define Z_EN_SIOFUKI_H -#include "ultra64.h" +#include #include "global.h" typedef enum { 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 d58c554a9..185eb265f 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 @@ -189,7 +189,7 @@ void EnSkb_Destroy(Actor* thisx, PlayState* play) { void func_80AFCD60(EnSkb* this) { // Don't despawn stallchildren during daytime when enemy randomizer is enabled. - if (IS_DAY && !CVar_GetS32("gRandomizedEnemies", 0)) { + if (IS_DAY && !CVarGetInteger("gRandomizedEnemies", 0)) { func_80AFCF48(this); } else if (Actor_IsFacingPlayer(&this->actor, 0x11C7) && (this->actor.xzDistToPlayer < (60.0f + (this->actor.params * 6.0f)))) { @@ -287,7 +287,7 @@ void EnSkb_Advance(EnSkb* this, PlayState* play) { } } // Don't despawn stallchildren during daytime or when a stalchildren walks too far away from his "home" when enemy randomizer is enabled. - if ((Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) > 800.0f || IS_DAY) && !CVar_GetS32("gRandomizedEnemies", 0)) { + if ((Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) > 800.0f || IS_DAY) && !CVarGetInteger("gRandomizedEnemies", 0)) { func_80AFCF48(this); } else if (Actor_IsFacingPlayer(&this->actor, 0x11C7) && (this->actor.xzDistToPlayer < (60.0f + (this->actor.params * 6.0f)))) { diff --git a/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.h b/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.h index 87d8aa3e5..002ff0a18 100644 --- a/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.h +++ b/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.h @@ -1,7 +1,7 @@ #ifndef Z_EN_SKB_H #define Z_EN_SKB_H -#include "ultra64.h" +#include #include "global.h" struct EnSkb; diff --git a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.h b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.h index dc0f97cc9..bc8febcd4 100644 --- a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.h +++ b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.h @@ -1,7 +1,7 @@ #ifndef Z_EN_SKJ_H #define Z_EN_SKJ_H -#include "ultra64.h" +#include #include "global.h" struct EnSkj; diff --git a/soh/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h b/soh/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h index 1c4f44494..1fe468280 100644 --- a/soh/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h +++ b/soh/src/overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h @@ -1,7 +1,7 @@ #ifndef Z_EN_SKJNEEDLE_H #define Z_EN_SKJNEEDLE_H -#include "ultra64.h" +#include #include "global.h" struct EnSkjneedle; diff --git a/soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h b/soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h index 3060fb6fb..6800de30d 100644 --- a/soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h +++ b/soh/src/overlays/actors/ovl_En_Ssh/z_en_ssh.h @@ -1,7 +1,7 @@ #ifndef Z_EN_SSH_H #define Z_EN_SSH_H -#include "ultra64.h" +#include #include "global.h" struct EnSsh; diff --git a/soh/src/overlays/actors/ovl_En_St/z_en_st.h b/soh/src/overlays/actors/ovl_En_St/z_en_st.h index 5b65c82e4..5ff3d8005 100644 --- a/soh/src/overlays/actors/ovl_En_St/z_en_st.h +++ b/soh/src/overlays/actors/ovl_En_St/z_en_st.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ST_H #define Z_EN_ST_H -#include "ultra64.h" +#include #include "global.h" struct EnSt; diff --git a/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.h b/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.h index dec16c4e1..9391496ae 100644 --- a/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.h +++ b/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.h @@ -1,7 +1,7 @@ #ifndef Z_EN_STH_H #define Z_EN_STH_H -#include "ultra64.h" +#include #include "global.h" struct EnSth; diff --git a/soh/src/overlays/actors/ovl_En_Stream/z_en_stream.h b/soh/src/overlays/actors/ovl_En_Stream/z_en_stream.h index 199d1c679..026f822ed 100644 --- a/soh/src/overlays/actors/ovl_En_Stream/z_en_stream.h +++ b/soh/src/overlays/actors/ovl_En_Stream/z_en_stream.h @@ -1,7 +1,7 @@ #ifndef Z_EN_STREAM_H #define Z_EN_STREAM_H -#include "ultra64.h" +#include #include "global.h" struct EnStream; 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 732cfec51..c26e017cc 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 @@ -333,7 +333,7 @@ s32 func_80B0C9F0(EnSw* this, PlayState* play) { } Enemy_StartFinishingBlow(play, &this->actor); if (((this->actor.params & 0xE000) >> 0xD) != 0) { - if (CVar_GetS32("gGsCutscene", 0)) { + if (CVarGetInteger("gGsCutscene", 0)) { OnePointCutscene_Init(play, 2200, 90, &this->actor, MAIN_CAM); } this->skelAnime.playSpeed = 8.0f; diff --git a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.h b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.h index 0d0ae96a1..0c7445397 100644 --- a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.h +++ b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.h @@ -1,7 +1,7 @@ #ifndef Z_EN_SW_H #define Z_EN_SW_H -#include "ultra64.h" +#include #include "global.h" struct EnSw; diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c b/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c index f45d7ce13..839a6335e 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c +++ b/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c @@ -111,8 +111,8 @@ void EnSyatekiItm_Idle(EnSyatekiItm* this, PlayState* play) { player->actor.world.rot.x = player->actor.shape.rot.x = player->actor.world.rot.z = player->actor.shape.rot.z = 0; s32 ammunition = 15; - if(CVar_GetS32("gCustomizeShootingGallery", 0)) { - ammunition = CVar_GetS32(LINK_IS_ADULT ? "gAdultShootingGalleryAmmunition" : "gChildShootingGalleryAmmunition", 15); + if(CVarGetInteger("gCustomizeShootingGallery", 0)) { + ammunition = CVarGetInteger(LINK_IS_ADULT ? "gAdultShootingGalleryAmmunition" : "gChildShootingGalleryAmmunition", 15); } func_8008EF44(play, ammunition); this->roundNum = this->hitCount = 0; @@ -132,7 +132,7 @@ void EnSyatekiItm_StartRound(EnSyatekiItm* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->unkTimer == 0) { - if (LINK_IS_ADULT && !(CVar_GetS32("gCustomizeShootingGallery", 0) && CVar_GetS32("gConstantAdultGallery", 0))) { + if (LINK_IS_ADULT && !(CVarGetInteger("gCustomizeShootingGallery", 0) && CVarGetInteger("gConstantAdultGallery", 0))) { for (i = 0, j = 0; i < SYATEKI_ROUND_MAX; i++) { if (this->roundFlags[i]) { j++; diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h b/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h index c7e01a776..58f64c368 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h +++ b/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.h @@ -1,7 +1,7 @@ #ifndef Z_EN_SYATEKI_ITM_H #define Z_EN_SYATEKI_ITM_H -#include "ultra64.h" +#include #include "global.h" struct EnSyatekiItm; 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 117abcee8..717782467 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 @@ -289,7 +289,7 @@ void EnSyatekiMan_StartGame(EnSyatekiMan* this, PlayState* play) { Message_CloseTextbox(play); gallery = ((EnSyatekiItm*)this->actor.parent); if (gallery->actor.update != NULL) { - if(CVar_GetS32("gCustomizeShootingGallery", 0) && CVar_GetS32("gInstantShootingGalleryWin", 0)) { + if(CVarGetInteger("gCustomizeShootingGallery", 0) && CVarGetInteger("gInstantShootingGalleryWin", 0)) { gallery->hitCount = 10; gallery->signal = ENSYATEKI_END; } else { @@ -401,8 +401,8 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, PlayState* play) { case SYATEKI_RESULT_ALMOST: this->timer = 20; s32 ammunition = 15; - if(CVar_GetS32("gCustomizeShootingGallery", 0)) { - ammunition = CVar_GetS32(LINK_IS_ADULT ? "gAdultShootingGalleryAmmunition" : "gChildShootingGalleryAmmunition", 15); + if(CVarGetInteger("gCustomizeShootingGallery", 0)) { + ammunition = CVarGetInteger(LINK_IS_ADULT ? "gAdultShootingGalleryAmmunition" : "gChildShootingGalleryAmmunition", 15); } func_8008EF44(play, ammunition); this->actionFunc = EnSyatekiMan_RestartGame; diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h index 363802902..eaeec0429 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h +++ b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h @@ -1,7 +1,7 @@ #ifndef Z_EN_SYATEKI_MAN_H #define Z_EN_SYATEKI_MAN_H -#include "ultra64.h" +#include #include "global.h" struct EnSyatekiMan; diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h b/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h index b512c6cd3..609b89f1c 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h +++ b/soh/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.h @@ -1,7 +1,7 @@ #ifndef Z_EN_SYATEKI_NIW_H #define Z_EN_SYATEKI_NIW_H -#include "ultra64.h" +#include #include "global.h" struct EnSyatekiNiw; diff --git a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.h b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.h index ec4f2766a..1d07dbd96 100644 --- a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.h +++ b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.h @@ -1,7 +1,7 @@ #ifndef Z_EN_TA_H #define Z_EN_TA_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_En_Niw/z_en_niw.h" diff --git a/soh/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.h b/soh/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.h index 48898909b..009ee0f55 100644 --- a/soh/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.h +++ b/soh/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.h @@ -1,7 +1,7 @@ #ifndef Z_EN_TAKARA_MAN_H #define Z_EN_TAKARA_MAN_H -#include "ultra64.h" +#include #include "global.h" struct EnTakaraMan; diff --git a/soh/src/overlays/actors/ovl_En_Tana/z_en_tana.h b/soh/src/overlays/actors/ovl_En_Tana/z_en_tana.h index 763d1303c..ad7f0bd3b 100644 --- a/soh/src/overlays/actors/ovl_En_Tana/z_en_tana.h +++ b/soh/src/overlays/actors/ovl_En_Tana/z_en_tana.h @@ -1,7 +1,7 @@ #ifndef Z_EN_TANA_H #define Z_EN_TANA_H -#include "ultra64.h" +#include #include "global.h" struct EnTana; diff --git a/soh/src/overlays/actors/ovl_En_Test/z_en_test.h b/soh/src/overlays/actors/ovl_En_Test/z_en_test.h index 3ddf9f723..c8ed4d469 100644 --- a/soh/src/overlays/actors/ovl_En_Test/z_en_test.h +++ b/soh/src/overlays/actors/ovl_En_Test/z_en_test.h @@ -1,7 +1,7 @@ #ifndef Z_EN_TEST_H #define Z_EN_TEST_H -#include "ultra64.h" +#include #include "global.h" struct EnTest; diff --git a/soh/src/overlays/actors/ovl_En_Tg/z_en_tg.h b/soh/src/overlays/actors/ovl_En_Tg/z_en_tg.h index 4ba4e5034..2aba3839a 100644 --- a/soh/src/overlays/actors/ovl_En_Tg/z_en_tg.h +++ b/soh/src/overlays/actors/ovl_En_Tg/z_en_tg.h @@ -1,7 +1,7 @@ #ifndef Z_EN_TG_H #define Z_EN_TG_H -#include "ultra64.h" +#include #include "global.h" struct EnTg; diff --git a/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.h b/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.h index 2faaadf9c..6d384a71f 100755 --- a/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.h +++ b/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.h @@ -1,7 +1,7 @@ #ifndef Z_EN_TITE_H #define Z_EN_TITE_H -#include "ultra64.h" +#include #include "global.h" struct EnTite; 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 fe1f150d8..2cde96519 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 @@ -408,7 +408,7 @@ s32 EnTk_ChooseReward(EnTk* this) { f32 luck; s32 reward; - if ((gSaveContext.n64ddFlag || CVar_GetS32("gDampeWin", 0)) && !Flags_GetCollectible(gPlayState, 0x1F) && this->heartPieceSpawned == 0) { + if ((gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0)) && !Flags_GetCollectible(gPlayState, 0x1F) && this->heartPieceSpawned == 0) { return 3; } @@ -604,7 +604,7 @@ void EnTk_Dig(EnTk* this, PlayState* play) { this->rewardTimer = 0; - if (this->validDigHere == 1 || gSaveContext.n64ddFlag || CVar_GetS32("gDampeWin", 0)) { + if (this->validDigHere == 1 || gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0)) { rewardOrigin.x = 0.0f; rewardOrigin.y = 0.0f; rewardOrigin.z = -40.0f; @@ -620,21 +620,21 @@ void EnTk_Dig(EnTk* this, PlayState* play) { // merging in dampe tour fix seems messy, so i'm just wrapping this whole thing // in an n64dd check for now - if (gSaveContext.n64ddFlag || CVar_GetS32("gDampeWin", 0)) { + if (gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0)) { if (this->currentReward == 3) { /* * Upgrade the purple rupee reward to the heart piece if this * is the first grand prize dig. */ - if (!(gSaveContext.itemGetInf[1] & 0x1000) && !(gSaveContext.n64ddFlag || CVar_GetS32("gDampeWin", 0))) { + if (!(gSaveContext.itemGetInf[1] & 0x1000) && !(gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0))) { gSaveContext.itemGetInf[1] |= 0x1000; this->currentReward = 4; - } else if ((gSaveContext.n64ddFlag || CVar_GetS32("gDampeWin", 0)) && !Flags_GetCollectible(gPlayState, 0x1F) && this->heartPieceSpawned == 0) { + } else if ((gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0)) && !Flags_GetCollectible(gPlayState, 0x1F) && this->heartPieceSpawned == 0) { this->currentReward = 4; } } - if ((gSaveContext.n64ddFlag || CVar_GetS32("gDampeWin", 0)) && this->currentReward == 4) { + if ((gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0)) && this->currentReward == 4) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ITEM00, rewardPos.x, rewardPos.y, rewardPos.z, 0, 0, 0, 0x1F06, true); this->heartPieceSpawned = 1; @@ -652,7 +652,7 @@ void EnTk_Dig(EnTk* this, PlayState* play) { // If true, spawn the heart piece and set the vanilla itemGetInf flag and new temp clear flag. if (!heartPieceSpawned && (!(gSaveContext.itemGetInf[1] & ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE) || - CVar_GetS32("gGravediggingTourFix", 0) && + CVarGetInteger("gGravediggingTourFix", 0) && !Flags_GetCollectible(play, COLLECTFLAG_GRAVEDIGGING_HEART_PIECE))) { this->currentReward = 4; gSaveContext.itemGetInf[1] |= ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE; @@ -670,7 +670,7 @@ void EnTk_Dig(EnTk* this, PlayState* play) { if (this->skelAnime.curFrame >= 32.0f && this->rewardTimer == 10) { /* Play a reward sound shortly after digging */ - if (!(gSaveContext.n64ddFlag || CVar_GetS32("gDampeWin", 0)) && this->validDigHere == 0) { + if (!(gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0)) && this->validDigHere == 0) { /* Bad dig spot */ Audio_PlayActorSound2(&this->actor, NA_SE_SY_ERROR); } else if (this->currentReward == 4) { diff --git a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.h b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.h index 9b3458585..80dd6c297 100644 --- a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.h +++ b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.h @@ -1,7 +1,7 @@ #ifndef Z_EN_TK_H #define Z_EN_TK_H -#include "ultra64.h" +#include #include "global.h" /* Dirt particle effect */ diff --git a/soh/src/overlays/actors/ovl_En_Torch/z_en_torch.h b/soh/src/overlays/actors/ovl_En_Torch/z_en_torch.h index 78be1fb2d..61c63cbec 100644 --- a/soh/src/overlays/actors/ovl_En_Torch/z_en_torch.h +++ b/soh/src/overlays/actors/ovl_En_Torch/z_en_torch.h @@ -1,7 +1,7 @@ #ifndef Z_EN_TORCH_H #define Z_EN_TORCH_H -#include "ultra64.h" +#include #include "global.h" struct EnTorch; diff --git a/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 3653910d5..acf753c03 100644 --- a/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -127,7 +127,7 @@ void EnTorch2_Init(Actor* thisx, PlayState* play2) { // Change Dark Link to regular enemy instead of boss with enemy randomizer and crowd control. // This way Dark Link will be considered for "clear enemy" rooms properly. - if (CVar_GetS32("gRandomizedEnemies", 0) || CVar_GetS32("gCrowdControl", 0)) { + if (CVarGetInteger("gRandomizedEnemies", 0) || CVarGetInteger("gCrowdControl", 0)) { Actor_ChangeCategory(play, &play->actorCtx, thisx, ACTORCAT_ENEMY); } @@ -278,7 +278,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { } // Disable miniboss music with Enemy Randomizer because the music would keep // playing if the enemy was never defeated, which is common with Enemy Randomizer. - if (!CVar_GetS32("gRandomizedEnemies", 0)) { + if (!CVarGetInteger("gRandomizedEnemies", 0)) { func_800F5ACC(NA_BGM_MINI_BOSS); } sActionState = ENTORCH2_ATTACK; diff --git a/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h b/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h index d96b08527..5a747c3bd 100644 --- a/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h +++ b/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.h @@ -1,7 +1,7 @@ #ifndef Z_EN_TORCH2_H #define Z_EN_TORCH2_H -#include "ultra64.h" +#include #include "global.h" // Uses the Player struct (from z64player.h) diff --git a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h index c82f7aec2..a0aeda850 100644 --- a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h +++ b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.h @@ -1,7 +1,7 @@ #ifndef Z_EN_TORYO_H #define Z_EN_TORYO_H -#include "ultra64.h" +#include #include "global.h" struct EnToryo; diff --git a/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.h b/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.h index 04d4f7663..e7e3b9ce9 100644 --- a/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.h +++ b/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.h @@ -1,7 +1,7 @@ #ifndef Z_EN_TP_H #define Z_EN_TP_H -#include "ultra64.h" +#include #include "global.h" struct EnTp; diff --git a/soh/src/overlays/actors/ovl_En_Tr/z_en_tr.h b/soh/src/overlays/actors/ovl_En_Tr/z_en_tr.h index 57dbf78ec..1dd1a726d 100644 --- a/soh/src/overlays/actors/ovl_En_Tr/z_en_tr.h +++ b/soh/src/overlays/actors/ovl_En_Tr/z_en_tr.h @@ -1,7 +1,7 @@ #ifndef Z_EN_TR_H #define Z_EN_TR_H -#include "ultra64.h" +#include #include "global.h" struct EnTr; diff --git a/soh/src/overlays/actors/ovl_En_Trap/z_en_trap.h b/soh/src/overlays/actors/ovl_En_Trap/z_en_trap.h index 6f69707ac..d6f3faf28 100644 --- a/soh/src/overlays/actors/ovl_En_Trap/z_en_trap.h +++ b/soh/src/overlays/actors/ovl_En_Trap/z_en_trap.h @@ -1,7 +1,7 @@ #ifndef Z_EN_TRAP_H #define Z_EN_TRAP_H -#include "ultra64.h" +#include #include "global.h" // Different movement modes (set in params): diff --git a/soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h b/soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h index 17dc2f205..b481c9876 100644 --- a/soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h +++ b/soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.h @@ -1,7 +1,7 @@ #ifndef Z_EN_TUBO_TRAP_H #define Z_EN_TUBO_TRAP_H -#include "ultra64.h" +#include #include "global.h" struct EnTuboTrap; 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 057d590c8..90254a29e 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 @@ -242,7 +242,7 @@ void EnVali_SetupDivideAndDie(EnVali* this, PlayState* play) { // Offset small jellyfish with Enemy Randomizer, otherwise it gets // stuck in a loop spawning more big jellyfish with seeded spawns. - if (CVar_GetS32("gRandomizedEnemies", 0)) { + if (CVarGetInteger("gRandomizedEnemies", 0)) { this->actor.world.rot.y += rand() % 50; } diff --git a/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.h b/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.h index 0c94d9228..e3698afd4 100644 --- a/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.h +++ b/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.h @@ -1,7 +1,7 @@ #ifndef Z_EN_VALI_H #define Z_EN_VALI_H -#include "ultra64.h" +#include #include "global.h" struct EnVali; diff --git a/soh/src/overlays/actors/ovl_En_Vase/z_en_vase.h b/soh/src/overlays/actors/ovl_En_Vase/z_en_vase.h index 57ee0d577..806db7821 100644 --- a/soh/src/overlays/actors/ovl_En_Vase/z_en_vase.h +++ b/soh/src/overlays/actors/ovl_En_Vase/z_en_vase.h @@ -1,7 +1,7 @@ #ifndef Z_EN_VASE_H #define Z_EN_VASE_H -#include "ultra64.h" +#include #include "global.h" struct EnVase; diff --git a/soh/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h b/soh/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h index 8675b440c..db674618c 100644 --- a/soh/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h +++ b/soh/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.h @@ -1,7 +1,7 @@ #ifndef Z_EN_VB_BALL_H #define Z_EN_VB_BALL_H -#include "ultra64.h" +#include #include "global.h" struct EnVbBall; diff --git a/soh/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h b/soh/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h index 25961976a..3c70a6f06 100644 --- a/soh/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h +++ b/soh/src/overlays/actors/ovl_En_Viewer/z_en_viewer.h @@ -1,7 +1,7 @@ #ifndef Z_EN_VIEWER_H #define Z_EN_VIEWER_H -#include "ultra64.h" +#include #include "global.h" struct EnViewer; diff --git a/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.h b/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.h index 2be67637c..3c05bf9f5 100644 --- a/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.h +++ b/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.h @@ -1,7 +1,7 @@ #ifndef Z_EN_VM_H #define Z_EN_VM_H -#include "ultra64.h" +#include #include "global.h" struct EnVm; diff --git a/soh/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h b/soh/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h index 1e7eead00..2a9946134 100644 --- a/soh/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h +++ b/soh/src/overlays/actors/ovl_En_Wall_Tubo/z_en_wall_tubo.h @@ -1,7 +1,7 @@ #ifndef Z_EN_WALL_TUBO_H #define Z_EN_WALL_TUBO_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h" diff --git a/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h b/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h index 8b2f8d7ba..33e51df60 100644 --- a/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h +++ b/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.h @@ -1,7 +1,7 @@ #ifndef Z_EN_WALLMAS_H #define Z_EN_WALLMAS_H -#include "ultra64.h" +#include #include "global.h" typedef enum { diff --git a/soh/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h b/soh/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h index ec7c17734..1bed1857d 100644 --- a/soh/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h +++ b/soh/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.h @@ -1,7 +1,7 @@ #ifndef Z_EN_WEATHER_TAG_H #define Z_EN_WEATHER_TAG_H -#include "ultra64.h" +#include #include "global.h" struct EnWeatherTag; diff --git a/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h b/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h index fbaefbd9a..ab61af5bc 100644 --- a/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h +++ b/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.h @@ -1,7 +1,7 @@ #ifndef Z_EN_WEIYER_H #define Z_EN_WEIYER_H -#include "ultra64.h" +#include #include "global.h" struct EnWeiyer; 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 58668d39d..6ec5e00cc 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 @@ -387,7 +387,7 @@ void EnWf_WaitToAppear(EnWf* this, PlayState* play) { // Disable miniboss music with Enemy Randomizer because the music would keep // playing if the enemy was never defeated, which is common with Enemy Randomizer. - if ((this->actor.params != WOLFOS_NORMAL) && (this->switchFlag != 0xFF) && !CVar_GetS32("gRandomizedEnemies", 0)) { + if ((this->actor.params != WOLFOS_NORMAL) && (this->switchFlag != 0xFF) && !CVarGetInteger("gRandomizedEnemies", 0)) { func_800F5ACC(NA_BGM_MINI_BOSS); } } diff --git a/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.h b/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.h index 36afdccf5..d94084e19 100644 --- a/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.h +++ b/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.h @@ -1,7 +1,7 @@ #ifndef Z_EN_WF_H #define Z_EN_WF_H -#include "ultra64.h" +#include #include "global.h" struct EnWf; diff --git a/soh/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h b/soh/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h index 0626afd60..fff9768ca 100644 --- a/soh/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h +++ b/soh/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h @@ -1,7 +1,7 @@ #ifndef Z_EN_WONDER_ITEM_H #define Z_EN_WONDER_ITEM_H -#include "ultra64.h" +#include #include "global.h" struct EnWonderItem; diff --git a/soh/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.h b/soh/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.h index ae21c5b41..423b5302f 100644 --- a/soh/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.h +++ b/soh/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.h @@ -1,7 +1,7 @@ #ifndef Z_EN_WONDER_TALK_H #define Z_EN_WONDER_TALK_H -#include "ultra64.h" +#include #include "global.h" struct EnWonderTalk; diff --git a/soh/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h b/soh/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h index f58775426..a47fa0b31 100644 --- a/soh/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h +++ b/soh/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h @@ -1,7 +1,7 @@ #ifndef Z_EN_WONDER_TALK2_H #define Z_EN_WONDER_TALK2_H -#include "ultra64.h" +#include #include "global.h" struct EnWonderTalk2; diff --git a/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index e27e06248..abada7c12 100644 --- a/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -101,7 +101,7 @@ static f32 sSpawnSin; s32 EnWood02_SpawnZoneCheck(EnWood02* this, PlayState* play, Vec3f* pos) { f32 phi_f12; - if (CVar_GetS32("gDisableDrawDistance", 0) != 0) { + if (CVarGetInteger("gDisableDrawDistance", 0) != 0) { return true; } diff --git a/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h b/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h index 85ec12a5b..96746c0af 100644 --- a/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h +++ b/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.h @@ -1,7 +1,7 @@ #ifndef Z_EN_WOOD02_H #define Z_EN_WOOD02_H -#include "ultra64.h" +#include #include "global.h" struct EnWood02; diff --git a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.h b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.h index 8a8dc4850..1dea813af 100644 --- a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.h +++ b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.h @@ -1,7 +1,7 @@ #ifndef Z_EN_XC_H #define Z_EN_XC_H -#include "ultra64.h" +#include #include "global.h" struct EnXc; diff --git a/soh/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.h b/soh/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.h index f4ec71bec..946ae73f1 100644 --- a/soh/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.h +++ b/soh/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.h @@ -1,7 +1,7 @@ #ifndef Z_EN_YABUSAME_MARK_H #define Z_EN_YABUSAME_MARK_H -#include "ultra64.h" +#include #include "global.h" struct EnYabusameMark; diff --git a/soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h b/soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h index 773237fbc..8cf2faaa5 100644 --- a/soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h +++ b/soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.h @@ -1,7 +1,7 @@ #ifndef Z_EN_YUKABYUN_H #define Z_EN_YUKABYUN_H -#include "ultra64.h" +#include #include "global.h" struct EnYukabyun; diff --git a/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.h b/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.h index b9bcea800..5e96ece42 100644 --- a/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.h +++ b/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ZF_H #define Z_EN_ZF_H -#include "ultra64.h" +#include #include "global.h" struct EnZf; diff --git a/soh/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h b/soh/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h index 8971f6911..4b99e10f8 100644 --- a/soh/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h +++ b/soh/src/overlays/actors/ovl_En_Zl1/z_en_zl1.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ZL1_H #define Z_EN_ZL1_H -#include "ultra64.h" +#include #include "global.h" struct EnZl1; diff --git a/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h b/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h index 24ba15405..ec519365a 100644 --- a/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h +++ b/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ZL2_H #define Z_EN_ZL2_H -#include "ultra64.h" +#include #include "global.h" struct EnZl2; diff --git a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h index 13b9a86dd..cfd9da535 100644 --- a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h +++ b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ZL3_H #define Z_EN_ZL3_H -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h" diff --git a/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h b/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h index 05d6a2655..0b9dbca93 100644 --- a/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h +++ b/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ZL4_H #define Z_EN_ZL4_H -#include "ultra64.h" +#include #include "global.h" struct EnZl4; diff --git a/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.h b/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.h index ba3960f98..4a6c30c94 100644 --- a/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.h +++ b/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.h @@ -1,7 +1,7 @@ #ifndef Z_EN_ZO_H #define Z_EN_ZO_H -#include "ultra64.h" +#include #include "global.h" struct EnZo; diff --git a/soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.h b/soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.h index 146590a1f..524c25c1e 100644 --- a/soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.h +++ b/soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.h @@ -1,7 +1,7 @@ #ifndef Z_EN_FHG_H #define Z_EN_FHG_H -#include "ultra64.h" +#include #include "global.h" struct EnfHG; diff --git a/soh/src/overlays/actors/ovl_End_Title/z_end_title.h b/soh/src/overlays/actors/ovl_End_Title/z_end_title.h index 9897c0fbf..934110e6c 100644 --- a/soh/src/overlays/actors/ovl_End_Title/z_end_title.h +++ b/soh/src/overlays/actors/ovl_End_Title/z_end_title.h @@ -1,7 +1,7 @@ #ifndef Z_END_TITLE_H #define Z_END_TITLE_H -#include "ultra64.h" +#include #include "global.h" struct EndTitle; diff --git a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c index c81fb8473..29dc52c7f 100644 --- a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -2900,24 +2900,24 @@ f32 Fishing_GetMinimumRequiredScore() { // RANDOTODO: update the enhancement sliders to not allow // values above rando fish weight values when rando'd if(sLinkAge == 1) { - weight = CVar_GetS32("gCustomizeFishing", 0) ? CVar_GetS32("gChildMinimumWeightFish", 10) : 10; + weight = CVarGetInteger("gCustomizeFishing", 0) ? CVarGetInteger("gChildMinimumWeightFish", 10) : 10; } else { - weight = CVar_GetS32("gCustomizeFishing", 0) ? CVar_GetS32("gAdultMinimumWeightFish", 13) : 13; + weight = CVarGetInteger("gCustomizeFishing", 0) ? CVarGetInteger("gAdultMinimumWeightFish", 13) : 13; } return sqrt(((f32)weight - 0.5f) / 0.0036f); } bool getInstantFish() { - return CVar_GetS32("gCustomizeFishing", 0) && CVar_GetS32("gInstantFishing", 0); + return CVarGetInteger("gCustomizeFishing", 0) && CVarGetInteger("gInstantFishing", 0); } bool getGuaranteeBite() { - return CVar_GetS32("gCustomizeFishing", 0) && CVar_GetS32("gGuaranteeFishingBite", 0); + return CVarGetInteger("gCustomizeFishing", 0) && CVarGetInteger("gGuaranteeFishingBite", 0); } bool getFishNeverEscape() { - return CVar_GetS32("gCustomizeFishing", 0) && CVar_GetS32("gFishNeverEscape", 0); + return CVarGetInteger("gCustomizeFishing", 0) && CVarGetInteger("gFishNeverEscape", 0); } void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { diff --git a/soh/src/overlays/actors/ovl_Fishing/z_fishing.h b/soh/src/overlays/actors/ovl_Fishing/z_fishing.h index 58483652c..f83416834 100644 --- a/soh/src/overlays/actors/ovl_Fishing/z_fishing.h +++ b/soh/src/overlays/actors/ovl_Fishing/z_fishing.h @@ -1,7 +1,7 @@ #ifndef Z_FISHING_H #define Z_FISHING_H -#include "ultra64.h" +#include #include "global.h" struct Fishing; diff --git a/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h b/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h index 432a7ef49..d9483b48c 100644 --- a/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h +++ b/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h @@ -1,7 +1,7 @@ #ifndef Z_ITEM_B_HEART_H #define Z_ITEM_B_HEART_H -#include "ultra64.h" +#include #include "global.h" struct ItemBHeart; diff --git a/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h b/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h index cb881828e..3ec33b926 100644 --- a/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h +++ b/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.h @@ -1,7 +1,7 @@ #ifndef Z_ITEM_ETC_H #define Z_ITEM_ETC_H -#include "ultra64.h" +#include #include "global.h" struct ItemEtcetera; diff --git a/soh/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h b/soh/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h index 3bf3cf157..8a5e817f8 100644 --- a/soh/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h +++ b/soh/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.h @@ -1,7 +1,7 @@ #ifndef Z_ITEM_INBOX_H #define Z_ITEM_INBOX_H -#include "ultra64.h" +#include #include "global.h" struct ItemInbox; diff --git a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h index 9a02b99ed..02b7e2812 100644 --- a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h +++ b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.h @@ -1,7 +1,7 @@ #ifndef Z_ITEM_OCARINA_H #define Z_ITEM_OCARINA_H -#include "ultra64.h" +#include #include "global.h" struct ItemOcarina; diff --git a/soh/src/overlays/actors/ovl_Item_Shield/z_item_shield.h b/soh/src/overlays/actors/ovl_Item_Shield/z_item_shield.h index c7984f4a4..b4d012979 100644 --- a/soh/src/overlays/actors/ovl_Item_Shield/z_item_shield.h +++ b/soh/src/overlays/actors/ovl_Item_Shield/z_item_shield.h @@ -1,7 +1,7 @@ #ifndef Z_ITEM_SHIELD_H #define Z_ITEM_SHIELD_H -#include "ultra64.h" +#include #include "global.h" struct ItemShield; diff --git a/soh/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c b/soh/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c index 333ce4bf6..7415876cd 100644 --- a/soh/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c +++ b/soh/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c @@ -200,8 +200,8 @@ void MagicDark_DiamondDraw(Actor* thisx, PlayState* play) { u16 gameplayFrames = play->gameplayFrames; Color_RGB8 Spell_env_ori = {0, 100, 255}; Color_RGB8 Spell_col_ori = {170, 255, 255}; - Color_RGB8 Spell_env = CVar_GetRGB("gNL_Diamond_Env", Spell_env_ori); - Color_RGB8 Spell_col = CVar_GetRGB("gNL_Diamond_Col", Spell_col_ori); + Color_RGB8 Spell_env = CVarGetColor24("gNL_Diamond_Env", Spell_env_ori); + Color_RGB8 Spell_col = CVarGetColor24("gNL_Diamond_Col", Spell_col_ori); OPEN_DISPS(play->state.gfxCtx); @@ -224,7 +224,7 @@ void MagicDark_DiamondDraw(Actor* thisx, PlayState* play) { Matrix_RotateY(this->actor.shape.rot.y * (M_PI / 0x8000), MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - if (CVar_GetS32("gUseSpellsCol",0)) { + if (CVarGetInteger("gUseSpellsCol",0)) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, Spell_col.r, Spell_col.g, Spell_col.b, (s32)(this->primAlpha * 0.6f) & 0xFF); gDPSetEnvColor(POLY_XLU_DISP++, Spell_env.r, Spell_env.g, Spell_env.b, 128); } else { diff --git a/soh/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.h b/soh/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.h index 3d7ef8229..233fc4a7b 100644 --- a/soh/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.h +++ b/soh/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.h @@ -1,7 +1,7 @@ #ifndef Z_MAGIC_DARK_H #define Z_MAGIC_DARK_H -#include "ultra64.h" +#include #include "global.h" struct MagicDark; 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 0ad2f0e79..5782614bd 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 @@ -218,8 +218,8 @@ void MagicFire_Draw(Actor* thisx, PlayState* play) { u8 alpha; Color_RGB8 Spell_env_ori = {255, 0, 0}; Color_RGB8 Spell_col_ori = {255, 200, 0}; - Color_RGB8 Spell_env = CVar_GetRGB("gDF_Env", Spell_env_ori); - Color_RGB8 Spell_col = CVar_GetRGB("gDF_Col", Spell_col_ori); + Color_RGB8 Spell_env = CVarGetColor24("gDF_Env", Spell_env_ori); + Color_RGB8 Spell_col = CVarGetColor24("gDF_Col", Spell_col_ori); if (this->action > 0) { OPEN_DISPS(play->state.gfxCtx); @@ -231,7 +231,7 @@ void MagicFire_Draw(Actor* thisx, PlayState* play) { gDPSetColorDither(POLY_XLU_DISP++, G_CD_DISABLE); gDPFillRectangle(POLY_XLU_DISP++, 0, 0, 319, 239); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - if (CVar_GetS32("gUseSpellsCol",0)) { + if (CVarGetInteger("gUseSpellsCol",0)) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, Spell_col.r, Spell_col.g, Spell_col.b, (u8)(this->alphaMultiplier * 255)); gDPSetEnvColor(POLY_XLU_DISP++, Spell_env.r, Spell_env.g, Spell_env.b, (u8)(this->alphaMultiplier * 255)); } else { diff --git a/soh/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.h b/soh/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.h index 4a9cb5188..d6b20d016 100644 --- a/soh/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.h +++ b/soh/src/overlays/actors/ovl_Magic_Fire/z_magic_fire.h @@ -1,7 +1,7 @@ #ifndef Z_MAGIC_FIRE_H #define Z_MAGIC_FIRE_H -#include "ultra64.h" +#include #include "global.h" struct MagicFire; diff --git a/soh/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h b/soh/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h index 489603c38..3f88dab4d 100644 --- a/soh/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h +++ b/soh/src/overlays/actors/ovl_Magic_Wind/z_magic_wind.h @@ -1,7 +1,7 @@ #ifndef Z_MAGIC_WIND_H #define Z_MAGIC_WIND_H -#include "ultra64.h" +#include #include "global.h" struct MagicWind; diff --git a/soh/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h b/soh/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h index 0f645cb4f..098ca8f6a 100644 --- a/soh/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h +++ b/soh/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h @@ -1,7 +1,7 @@ #ifndef Z_MIR_RAY_H #define Z_MIR_RAY_H -#include "ultra64.h" +#include #include "global.h" struct MirRay; diff --git a/soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h b/soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h index 317db4821..28636c28e 100644 --- a/soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h +++ b/soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_BEAN_H #define Z_OBJ_BEAN_H -#include "ultra64.h" +#include #include "global.h" struct ObjBean; diff --git a/soh/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.h b/soh/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.h index f6ff149e9..0a191cc15 100644 --- a/soh/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.h +++ b/soh/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_BLOCKSTOP_H #define Z_OBJ_BLOCKSTOP_H -#include "ultra64.h" +#include #include "global.h" struct ObjBlockstop; diff --git a/soh/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h b/soh/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h index 33597276b..d62082988 100644 --- a/soh/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h +++ b/soh/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_BOMBIWA_H #define Z_OBJ_BOMBIWA_H -#include "ultra64.h" +#include #include "global.h" struct ObjBombiwa; diff --git a/soh/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/soh/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index 225eac29f..a9e5ca2a7 100644 --- a/soh/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/soh/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -141,7 +141,7 @@ void ObjComb_ChooseItemDrop(ObjComb* this, PlayState* play) { } else if (Rand_ZeroOne() < 0.5f) { params = -1; } - if (params >= 0 && !CVar_GetS32("gNoRandomDrops", 0)) { + if (params >= 0 && !CVarGetInteger("gNoRandomDrops", 0)) { Item_DropCollectible(play, &this->actor.world.pos, params); } } diff --git a/soh/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h b/soh/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h index 3a6ce8641..68640544f 100644 --- a/soh/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h +++ b/soh/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_COMB_H #define Z_OBJ_COMB_H -#include "ultra64.h" +#include #include "global.h" struct ObjComb; diff --git a/soh/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.h b/soh/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.h index 88818776a..fe8c425fc 100644 --- a/soh/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.h +++ b/soh/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_DEKUJR_H #define Z_OBJ_DEKUJR_H -#include "ultra64.h" +#include #include "global.h" struct ObjDekujr; diff --git a/soh/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h b/soh/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h index e77d04a9a..4f04a3bd7 100644 --- a/soh/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h +++ b/soh/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_ELEVATOR_H #define Z_OBJ_ELEVATOR_H -#include "ultra64.h" +#include #include "global.h" struct ObjElevator; diff --git a/soh/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h b/soh/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h index a897177f6..13e5b1483 100644 --- a/soh/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h +++ b/soh/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_HAMISHI_H #define Z_OBJ_HAMISHI_H -#include "ultra64.h" +#include #include "global.h" struct ObjHamishi; diff --git a/soh/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h b/soh/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h index 7fdd3bfa8..1ea68da9e 100644 --- a/soh/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h +++ b/soh/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_HANA_H #define Z_OBJ_HANA_H -#include "ultra64.h" +#include #include "global.h" struct ObjHana; diff --git a/soh/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h b/soh/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h index 6548ca9b9..1bea4c99d 100644 --- a/soh/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h +++ b/soh/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_HSBLOCK_H #define Z_OBJ_HSBLOCK_H -#include "ultra64.h" +#include #include "global.h" struct ObjHsblock; diff --git a/soh/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h b/soh/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h index 8ebbe8d12..986aa400e 100644 --- a/soh/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h +++ b/soh/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_ICE_POLY_H #define Z_OBJ_ICE_POLY_H -#include "ultra64.h" +#include #include "global.h" struct ObjIcePoly; diff --git a/soh/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h b/soh/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h index 9378a51ce..68e871c78 100644 --- a/soh/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h +++ b/soh/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_KIBAKO_H #define Z_OBJ_KIBAKO_H -#include "ultra64.h" +#include #include "global.h" struct ObjKibako; diff --git a/soh/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h b/soh/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h index 73f0e90b6..48c22154f 100644 --- a/soh/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h +++ b/soh/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_KIBAKO2_H #define Z_OBJ_KIBAKO2_H -#include "ultra64.h" +#include #include "global.h" struct ObjKibako2; diff --git a/soh/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h b/soh/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h index de25b3c1c..0c364513e 100644 --- a/soh/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h +++ b/soh/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_LIFT_H #define Z_OBJ_LIFT_H -#include "ultra64.h" +#include #include "global.h" struct ObjLift; 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 027e4c6aa..e88b4eb77 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 @@ -123,7 +123,7 @@ void ObjLightswitch_InitCollider(ObjLightswitch* this, PlayState* play) { s32 pad; // Initialize this with the sun switch, so it can't be affected by toggling while the actor is loaded - sunLightArrowsEnabledOnSunSwitchLoad = CVar_GetS32("gSunlightArrows", 0) || (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SUNLIGHT_ARROWS)); + sunLightArrowsEnabledOnSunSwitchLoad = CVarGetInteger("gSunlightArrows", 0) || (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SUNLIGHT_ARROWS)); Collider_InitJntSph(play, &this->collider); // If "Sunlight Arrows" is enabled, set up the collider to allow Light Arrow hits diff --git a/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h b/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h index b8420f2d4..593f30d3d 100644 --- a/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h +++ b/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_LIGHTSWITCH_H #define Z_OBJ_LIGHTSWITCH_H -#include "ultra64.h" +#include #include "global.h" struct ObjLightswitch; diff --git a/soh/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h b/soh/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h index 72aec99c5..6324a12a5 100644 --- a/soh/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h +++ b/soh/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_MAKEKINSUTA_H #define Z_OBJ_MAKEKINSUTA_H -#include "ultra64.h" +#include #include "global.h" struct ObjMakekinsuta; diff --git a/soh/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h b/soh/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h index 16dc3ba47..c9456df71 100644 --- a/soh/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h +++ b/soh/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_MAKEOSHIHIKI_H #define Z_OBJ_MAKEOSHIHIKI_H -#include "ultra64.h" +#include #include "global.h" struct ObjMakeoshihiki; diff --git a/soh/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/soh/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index b9e6bc38e..a94abf311 100644 --- a/soh/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/soh/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -275,7 +275,7 @@ void ObjMure_InitialAction(ObjMure* this, PlayState* play) { } void ObjMure_CulledState(ObjMure* this, PlayState* play) { - if (fabsf(this->actor.projectedPos.z) < sZClip[this->type] || CVar_GetS32("gDisableDrawDistance", 0) != 0) { + if (fabsf(this->actor.projectedPos.z) < sZClip[this->type] || CVarGetInteger("gDisableDrawDistance", 0) != 0) { this->actionFunc = ObjMure_ActiveState; this->actor.flags |= ACTOR_FLAG_4; ObjMure_SpawnActors(this, play); @@ -399,7 +399,7 @@ static ObjMureActionFunc sTypeGroupBehaviorFunc[] = { void ObjMure_ActiveState(ObjMure* this, PlayState* play) { ObjMure_CheckChildren(this, play); if (sZClip[this->type] + 40.0f <= fabsf(this->actor.projectedPos.z) && - CVar_GetS32("gDisableDrawDistance", 1) != 0) { + CVarGetInteger("gDisableDrawDistance", 1) != 0) { this->actionFunc = ObjMure_CulledState; this->actor.flags &= ~ACTOR_FLAG_4; ObjMure_KillActors(this, play); diff --git a/soh/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h b/soh/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h index 386c6ed0d..a72f02c4e 100644 --- a/soh/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h +++ b/soh/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_MURE_H #define Z_OBJ_MURE_H -#include "ultra64.h" +#include #include "global.h" struct ObjMure; 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 f2a81e771..913c847a6 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 @@ -191,7 +191,7 @@ void func_80B9A658(ObjMure2* this) { void func_80B9A668(ObjMure2* this, PlayState* play) { if (Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z) < (sDistSquared1[this->actor.params & 3] * this->unk_184) || - CVar_GetS32("gDisableDrawDistance", 0) != 0) { + CVarGetInteger("gDisableDrawDistance", 0) != 0) { this->actor.flags |= ACTOR_FLAG_4; ObjMure2_SpawnActors(this, play); func_80B9A6E8(this); @@ -205,7 +205,7 @@ void func_80B9A6E8(ObjMure2* this) { void func_80B9A6F8(ObjMure2* this, PlayState* play) { func_80B9A534(this); - if (CVar_GetS32("gDisableDrawDistance", 0) != 0) { + if (CVarGetInteger("gDisableDrawDistance", 0) != 0) { return; } diff --git a/soh/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h b/soh/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h index a197e9f7b..834ffcb04 100644 --- a/soh/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h +++ b/soh/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_MURE2_H #define Z_OBJ_MURE2_H -#include "ultra64.h" +#include #include "global.h" struct ObjMure2; diff --git a/soh/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h b/soh/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h index 415babc61..e3b131839 100644 --- a/soh/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h +++ b/soh/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_MURE3_H #define Z_OBJ_MURE3_H -#include "ultra64.h" +#include #include "global.h" struct ObjMure3; 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 31849422c..18b1845b1 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 @@ -558,7 +558,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, PlayState* play) { f32 pushDistSigned; s32 stopFlag; - this->pushSpeed = this->pushSpeed + ((CVar_GetS32("gFasterBlockPush", 0) / 2) * 0.5) + 0.5f; + this->pushSpeed = this->pushSpeed + ((CVarGetInteger("gFasterBlockPush", 0) / 2) * 0.5) + 0.5f; this->stateFlags |= PUSHBLOCK_PUSH; this->pushSpeed = CLAMP_MAX(this->pushSpeed, 2.0f); stopFlag = Math_StepToF(&this->pushDist, 20.0f, this->pushSpeed); @@ -586,7 +586,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, PlayState* play) { this->dyna.unk_150 = 0.0f; this->pushDist = 0.0f; this->pushSpeed = 0.0f; - this->timer = 10 - ((CVar_GetS32("gFasterBlockPush", 0) * 3) / 2); + this->timer = 10 - ((CVarGetInteger("gFasterBlockPush", 0) * 3) / 2); if (this->floorBgIds[this->highestFloor] == BGCHECK_SCENE) { ObjOshihiki_SetupOnScene(this, play); } else { diff --git a/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h b/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h index ac4a135c4..f292938ae 100644 --- a/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h +++ b/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_OSHIHIKI_H #define Z_OBJ_OSHIHIKI_H -#include "ultra64.h" +#include #include "global.h" struct ObjOshihiki; diff --git a/soh/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/soh/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 2410f8ec4..b1da7045f 100644 --- a/soh/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/soh/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -34,7 +34,7 @@ void ObjRoomtimer_Init(Actor* thisx, PlayState* play) { // Shabom room in Jabu Jabu has a lengthened timer in Enemy Randomizer. Flag doesn't match what the game // expects. Instead set it back to the same flag as what it would be in vanilla. - if (CVar_GetS32("gRandomizedEnemies", 0) && play->sceneNum == SCENE_BDAN && play->roomCtx.curRoom.num == 12) { + if (CVarGetInteger("gRandomizedEnemies", 0) && play->sceneNum == SCENE_BDAN && play->roomCtx.curRoom.num == 12) { this->switchFlag = 30; } else { this->switchFlag = (params >> 10) & 0x3F; diff --git a/soh/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h b/soh/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h index 2f1b08d9c..3128e93e0 100644 --- a/soh/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h +++ b/soh/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_ROOMTIMER_H #define Z_OBJ_ROOMTIMER_H -#include "ultra64.h" +#include #include "global.h" #include "z64.h" diff --git a/soh/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h b/soh/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h index acea2102a..b2eaa5162 100644 --- a/soh/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h +++ b/soh/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_SWITCH_H #define Z_OBJ_SWITCH_H -#include "ultra64.h" +#include #include "global.h" struct ObjSwitch; diff --git a/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h b/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h index 8c4e1b7d1..d5a56579c 100644 --- a/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h +++ b/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_SYOKUDAI_H #define Z_OBJ_SYOKUDAI_H -#include "ultra64.h" +#include #include "global.h" struct ObjSyokudai; diff --git a/soh/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c b/soh/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c index bf31310de..fc301fe9f 100644 --- a/soh/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c +++ b/soh/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c @@ -340,8 +340,8 @@ void ObjTimeblock_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - if (CVar_GetS32("gCosmetics.World_BlockOfTime.Changed", 0)) { - Color_RGB8 color = CVar_GetRGB("gCosmetics.World_BlockOfTime.Value", *primColor); + if (CVarGetInteger("gCosmetics.World_BlockOfTime.Changed", 0)) { + Color_RGB8 color = CVarGetColor24("gCosmetics.World_BlockOfTime.Value", *primColor); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, color.r, color.g, color.b, 255); } else { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, primColor->r, primColor->g, primColor->b, 255); diff --git a/soh/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h b/soh/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h index 9bd393b19..af4be92d0 100644 --- a/soh/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h +++ b/soh/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_TIMEBLOCK_H #define Z_OBJ_TIMEBLOCK_H -#include "ultra64.h" +#include #include "global.h" struct ObjTimeblock; diff --git a/soh/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h b/soh/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h index 62ea296f8..a83d43a47 100644 --- a/soh/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h +++ b/soh/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_TSUBO_H #define Z_OBJ_TSUBO_H -#include "ultra64.h" +#include #include "global.h" struct ObjTsubo; diff --git a/soh/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h b/soh/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h index 3e09d976c..bd4cf0a71 100644 --- a/soh/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h +++ b/soh/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.h @@ -1,7 +1,7 @@ #ifndef Z_OBJ_WARP2BLOCK_H #define Z_OBJ_WARP2BLOCK_H -#include "ultra64.h" +#include #include "global.h" struct ObjWarp2block; diff --git a/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h b/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h index a60d7dbef..ff9276ff0 100644 --- a/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h +++ b/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h @@ -1,7 +1,7 @@ #ifndef Z_OBJECT_KANKYO_H #define Z_OBJECT_KANKYO_H -#include "ultra64.h" +#include #include "global.h" struct ObjectKankyo; diff --git a/soh/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h b/soh/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h index a96f1878a..e7e9a46ee 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h +++ b/soh/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.h @@ -1,7 +1,7 @@ #ifndef Z_OCEFF_SPOT_H #define Z_OCEFF_SPOT_H -#include "ultra64.h" +#include #include "global.h" struct OceffSpot; diff --git a/soh/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h b/soh/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h index e4b831a20..ed01bdd78 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h +++ b/soh/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.h @@ -1,7 +1,7 @@ #ifndef Z_OCEFF_STORM_H #define Z_OCEFF_STORM_H -#include "ultra64.h" +#include #include "global.h" struct OceffStorm; diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h b/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h index 0b26239ba..c9b3caf64 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.h @@ -1,7 +1,7 @@ #ifndef Z_OCEFF_WIPE_H #define Z_OCEFF_WIPE_H -#include "ultra64.h" +#include #include "global.h" typedef enum { diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h b/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h index c7f9c7b87..598851a40 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.h @@ -1,7 +1,7 @@ #ifndef Z_OCEFF_WIPE2_H #define Z_OCEFF_WIPE2_H -#include "ultra64.h" +#include #include "global.h" struct OceffWipe2; diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h b/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h index a5bc2bbe4..51c7ed192 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.h @@ -1,7 +1,7 @@ #ifndef Z_OCEFF_WIPE3_H #define Z_OCEFF_WIPE3_H -#include "ultra64.h" +#include #include "global.h" struct OceffWipe3; diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h b/soh/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h index 618728934..66677abfd 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.h @@ -1,7 +1,7 @@ #ifndef Z_OCEFF_WIPE4_H #define Z_OCEFF_WIPE4_H -#include "ultra64.h" +#include #include "global.h" typedef enum { diff --git a/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h b/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h index 51b2d0e6f..c346defd6 100644 --- a/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h +++ b/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.h @@ -1,7 +1,7 @@ #ifndef Z_SHOT_SUN_H #define Z_SHOT_SUN_H -#include "ultra64.h" +#include #include "global.h" struct ShotSun; 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 f58248db0..4f381e7d9 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -4,7 +4,7 @@ * Description: Link */ -#include "ultra64.h" +#include #include "global.h" #include "overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.h" @@ -1880,7 +1880,7 @@ void func_808337D4(PlayState* play, Player* this) { this->actor.shape.rot.y, 0, 0); if (spawnedActor != NULL) { if ((explosiveType != 0) && (play->bombchuBowlingStatus != 0)) { - if (!CVar_GetS32("gInfiniteAmmo", 0)) { + if (!CVarGetInteger("gInfiniteAmmo", 0)) { play->bombchuBowlingStatus--; } if (play->bombchuBowlingStatus == 0) { @@ -2018,7 +2018,7 @@ s32 func_80833C98(s32 item1, s32 actionParam) { } s32 func_80833CDC(PlayState* play, s32 index) { - if (index >= ((CVar_GetS32("gDpadEquips", 0) != 0) ? 8 : 4)) { + if (index >= ((CVarGetInteger("gDpadEquips", 0) != 0) ? 8 : 4)) { return ITEM_NONE; } else if (play->bombchuBowlingStatus != 0) { return (play->bombchuBowlingStatus > 0) ? ITEM_BOMBCHU : ITEM_NONE; @@ -2047,10 +2047,10 @@ void func_80833DF8(Player* this, PlayState* play) { s32 i; if (this->currentMask != PLAYER_MASK_NONE) { - if (CVar_GetS32("gMMBunnyHood", 0) != 0) { + if (CVarGetInteger("gMMBunnyHood", 0) != 0) { s32 maskItem = this->currentMask - PLAYER_MASK_KEATON + ITEM_MASK_KEATON; bool hasOnDpad = false; - if (CVar_GetS32("gDpadEquips", 0) != 0) { + if (CVarGetInteger("gDpadEquips", 0) != 0) { for (int buttonIndex = 4; buttonIndex < 8; buttonIndex++) { hasOnDpad |= gSaveContext.equips.buttonItems[buttonIndex] == maskItem; } @@ -2065,7 +2065,7 @@ void func_80833DF8(Player* this, PlayState* play) { } else { maskActionParam = this->currentMask - 1 + PLAYER_IA_MASK_KEATON; bool hasOnDpad = false; - if (CVar_GetS32("gDpadEquips", 0) != 0) { + if (CVarGetInteger("gDpadEquips", 0) != 0) { for (int buttonIndex = 0; buttonIndex < 4; buttonIndex++) { hasOnDpad |= func_80833C98(DPAD_ITEM(buttonIndex), maskActionParam); } @@ -2080,7 +2080,7 @@ void func_80833DF8(Player* this, PlayState* play) { if (!(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_29)) && !func_8008F128(this)) { if (this->itemAction >= PLAYER_IA_FISHING_POLE) { bool hasOnDpad = false; - if (CVar_GetS32("gDpadEquips", 0) != 0) { + if (CVarGetInteger("gDpadEquips", 0) != 0) { for (int buttonIndex = 0; buttonIndex < 4; buttonIndex++) { hasOnDpad |= func_80833C50(this, DPAD_ITEM(buttonIndex)); } @@ -2279,10 +2279,10 @@ LinkAnimationHeader* func_808346C4(PlayState* play, Player* this) { if (this->unk_870 < 0.5f) { return D_808543A4[Player_HoldsTwoHandedWeapon(this) && - !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemAction != PLAYER_IA_STICK))]; + !(CVarGetInteger("gShieldTwoHanded", 0) && (this->heldItemAction != PLAYER_IA_STICK))]; } else { return D_808543AC[Player_HoldsTwoHandedWeapon(this) && - !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemAction != PLAYER_IA_STICK))]; + !(CVarGetInteger("gShieldTwoHanded", 0) && (this->heldItemAction != PLAYER_IA_STICK))]; } } @@ -2458,7 +2458,7 @@ s32 func_80834E44(PlayState* play) { s32 func_80834E7C(PlayState* play) { u16 buttonsToCheck = BTN_A | BTN_B | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN; - if (CVar_GetS32("gDpadEquips", 0) != 0) { + if (CVarGetInteger("gDpadEquips", 0) != 0) { buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT; } return (play->shootingGalleryStatus != 0) && @@ -2527,11 +2527,11 @@ s32 func_808350A4(PlayState* play, Player* this) { func_80834380(play, this, &item, &arrowType); if (gSaveContext.minigameState == 1) { - if (!CVar_GetS32("gInfiniteAmmo", 0)) { + if (!CVarGetInteger("gInfiniteAmmo", 0)) { play->interfaceCtx.hbaAmmo--; } } else if (play->shootingGalleryStatus != 0) { - if (!CVar_GetS32("gInfiniteAmmo", 0)) { + if (!CVarGetInteger("gInfiniteAmmo", 0)) { play->shootingGalleryStatus--; } } else { @@ -2809,7 +2809,7 @@ s32 func_80835B60(Player* this, PlayState* play) { return 1; } - if (D_80853614 && CVar_GetS32("gFastBoomerang", 0)) { + if (D_80853614 && CVarGetInteger("gFastBoomerang", 0)) { this->boomerangQuickRecall = true; } @@ -3033,7 +3033,7 @@ void func_80835F44(PlayState* play, Player* this, s32 item) { (item != this->heldItemId) && (D_80854164[gPlayerModelTypes[this->modelGroup][PLAYER_MODELGROUPENTRY_ANIM]][nextAnimType] != PLAYER_D_808540F4_0) && - (!CVar_GetS32("gSeparateArrows", 0) || + (!CVarGetInteger("gSeparateArrows", 0) || actionParam < PLAYER_IA_BOW || actionParam > PLAYER_IA_BOW_0E || this->heldItemAction < PLAYER_IA_BOW || this->heldItemAction > PLAYER_IA_BOW_0E)) { this->heldItemId = item; @@ -3620,7 +3620,7 @@ void func_80837948(PlayState* play, Player* this, s32 arg2) { } if ((arg2 >= 16) && (arg2 < 20)) { - if (CVar_GetS32("gRestoreQPA", 1) && temp == -1) { + if (CVarGetInteger("gRestoreQPA", 1) && temp == -1) { flags = 0x16171617; } else { @@ -3655,7 +3655,7 @@ s32 func_80837B18_modified(PlayState* play, Player* this, s32 damage, u8 modifie s32 modifiedDamage = damage; if (modified) { - modifiedDamage *= (1 << CVar_GetS32("gDamageMul", 0)); + modifiedDamage *= (1 << CVarGetInteger("gDamageMul", 0)); } return Health_ChangeBy(play, modifiedDamage); @@ -3842,7 +3842,7 @@ s32 func_8083816C(s32 arg0) { } void func_8083819C(Player* this, PlayState* play) { - if (this->currentShield == PLAYER_SHIELD_DEKU && (CVar_GetS32("gFireproofDekuShield", 0) == 0)) { + if (this->currentShield == PLAYER_SHIELD_DEKU && (CVarGetInteger("gFireproofDekuShield", 0) == 0)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_SHIELD, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 1, true); Inventory_DeleteEquipment(play, EQUIP_SHIELD); @@ -3880,7 +3880,7 @@ s32 func_808382DC(Player* this, PlayState* play) { if (this->unk_A86 != 0) { if (!Player_InBlockingCsMode(play, this)) { - Player_InflictDamageModified(play, -16 * (1 << CVar_GetS32("gVoidDamageMul", 0)), false); + Player_InflictDamageModified(play, -16 * (1 << CVarGetInteger("gVoidDamageMul", 0)), false); this->unk_A86 = 0; } } else { @@ -3955,18 +3955,18 @@ s32 func_808382DC(Player* this, PlayState* play) { if (this->unk_870 < 0.5f) { anim = D_808543BC[Player_HoldsTwoHandedWeapon(this) && - !(CVar_GetS32("gShieldTwoHanded", 0) && + !(CVarGetInteger("gShieldTwoHanded", 0) && (this->heldItemAction != PLAYER_IA_STICK))]; } else { anim = D_808543B4[Player_HoldsTwoHandedWeapon(this) && - !(CVar_GetS32("gShieldTwoHanded", 0) && + !(CVarGetInteger("gShieldTwoHanded", 0) && (this->heldItemAction != PLAYER_IA_STICK))]; } LinkAnimation_PlayOnce(play, &this->skelAnime2, anim); } else { func_80832264(play, this, D_808543C4[Player_HoldsTwoHandedWeapon(this) && - !(CVar_GetS32("gShieldTwoHanded", 0) && + !(CVarGetInteger("gShieldTwoHanded", 0) && (this->heldItemAction != PLAYER_IA_STICK))]); } } @@ -4023,7 +4023,7 @@ s32 func_808382DC(Player* this, PlayState* play) { ((sp48 >= 0) && SurfaceType_IsWallDamage(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) && (this->unk_A79 >= D_808544F4[sp48])) || - ((sp48 >= 0) && ((this->currentTunic != PLAYER_TUNIC_GORON && CVar_GetS32("gSuperTunic", 0) == 0) || + ((sp48 >= 0) && ((this->currentTunic != PLAYER_TUNIC_GORON && CVarGetInteger("gSuperTunic", 0) == 0) || (this->unk_A79 >= D_808544F4[sp48])))) { this->unk_A79 = 0; this->actor.colChkInfo.damage = 4; @@ -4662,7 +4662,7 @@ void func_8083A0F4(PlayState* play, Player* this) { // Same actor is used for small and large silver rocks, use actor params to identify large ones bool isLargeSilverRock = interactActorId == ACTOR_EN_ISHI && interactRangeActor->params & 1 == 1; - if (CVar_GetS32("gFasterHeavyBlockLift", 0) && (isLargeSilverRock || interactActorId == ACTOR_BG_HEAVY_BLOCK)) { + if (CVarGetInteger("gFasterHeavyBlockLift", 0) && (isLargeSilverRock || interactActorId == ACTOR_BG_HEAVY_BLOCK)) { LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, anim, 5.0f); } else { LinkAnimation_PlayOnce(play, &this->skelAnime, anim); @@ -4788,7 +4788,7 @@ s32 func_8083A6AC(Player* this, PlayState* play) { if (BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &sp74, &sp68, &sp84, true, false, false, true, &sp80) && - ((ABS(sp84->normal.y) < 600) || (CVar_GetS32("gClimbEverything", 0) != 0))) { + ((ABS(sp84->normal.y) < 600) || (CVarGetInteger("gClimbEverything", 0) != 0))) { f32 nx = COLPOLY_GET_NORMAL(sp84->normal.x); f32 ny = COLPOLY_GET_NORMAL(sp84->normal.y); f32 nz = COLPOLY_GET_NORMAL(sp84->normal.z); @@ -5191,7 +5191,7 @@ s32 func_8083B644(Player* this, PlayState* play) { this->stateFlags2 |= PLAYER_STATE2_21; } - if (!CHECK_BTN_ALL(sControlInput->press.button, CVar_GetS32("gNaviOnL", 0) ? BTN_L : BTN_CUP) && + if (!CHECK_BTN_ALL(sControlInput->press.button, CVarGetInteger("gNaviOnL", 0) ? BTN_L : BTN_CUP) && !sp28) { return 0; } @@ -5245,7 +5245,7 @@ s32 func_8083B998(Player* this, PlayState* play) { if ((this->unk_664 != NULL) && (CHECK_FLAG_ALL(this->unk_664->flags, ACTOR_FLAG_0 | ACTOR_FLAG_18) || (this->unk_664->naviEnemyId != 0xFF))) { this->stateFlags2 |= PLAYER_STATE2_21; - } else if ((this->naviTextId == 0 || CVar_GetS32("gNaviOnL", 0)) && !func_8008E9C4(this) && + } else if ((this->naviTextId == 0 || CVarGetInteger("gNaviOnL", 0)) && !func_8008E9C4(this) && CHECK_BTN_ALL(sControlInput->press.button, BTN_CUP) && (YREG(15) != 0x10) && (YREG(15) != 0x20) && !func_8083B8F4(this, play)) { func_80078884(NA_SE_SY_ERROR); @@ -5560,7 +5560,7 @@ s32 func_8083C6B8(PlayState* play, Player* this) { sp24 = this->actor.world.pos; sp24.y += 50.0f; - if (CVar_GetS32("gHoverFishing", 0) + if (CVarGetInteger("gHoverFishing", 0) ? 0 : !(this->actor.bgCheckFlags & 1) || (this->actor.world.pos.z > 1300.0f) || BgCheck_SphVsFirstPoly(&play->colCtx, &sp24, 20.0f)) { @@ -6081,22 +6081,22 @@ void func_8083DFE0(Player* this, f32* arg1, s16* arg2) { } } - if (CVar_GetS32("gMMBunnyHood", 0) == 1 && this->currentMask == PLAYER_MASK_BUNNY) { + if (CVarGetInteger("gMMBunnyHood", 0) == 1 && this->currentMask == PLAYER_MASK_BUNNY) { maxSpeed *= 1.5f; } - if (CVar_GetS32("gEnableWalkModify", 0)) { - if (CVar_GetS32("gWalkSpeedToggle", 0)) { + if (CVarGetInteger("gEnableWalkModify", 0)) { + if (CVarGetInteger("gWalkSpeedToggle", 0)) { if (gWalkSpeedToggle1) { - maxSpeed *= CVar_GetFloat("gWalkModifierOne", 1.0f); + maxSpeed *= CVarGetFloat("gWalkModifierOne", 1.0f); } else if (gWalkSpeedToggle2) { - maxSpeed *= CVar_GetFloat("gWalkModifierTwo", 1.0f); + maxSpeed *= CVarGetFloat("gWalkModifierTwo", 1.0f); } } else { if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_MODIFIER1)) { - maxSpeed *= CVar_GetFloat("gWalkModifierOne", 1.0f); + maxSpeed *= CVarGetFloat("gWalkModifierOne", 1.0f); } else if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_MODIFIER2)) { - maxSpeed *= CVar_GetFloat("gWalkModifierTwo", 1.0f); + maxSpeed *= CVarGetFloat("gWalkModifierTwo", 1.0f); } } } @@ -6330,7 +6330,7 @@ s32 func_8083E5A8(Player* this, PlayState* play) { // Skip cutscenes from picking up consumables with "Fast Pickup Text" enabled, even when the player never picked it up before. // But only for bushes/rocks/enemies because otherwise it can lead to softlocks in deku mask theatre and potentially other places. - uint8_t skipItemCutscene = CVar_GetS32("gFastDrops", 0) && isDropToSkip; + uint8_t skipItemCutscene = CVarGetInteger("gFastDrops", 0) && isDropToSkip; // Same as above but for rando. Rando is different because we want to enable cutscenes for items that the player already has because // those items could be a randomized item coming from scrubs, freestanding PoH's and keys. So we need to once again overrule @@ -6369,7 +6369,7 @@ s32 func_8083E5A8(Player* this, PlayState* play) { giEntry = this->getItemEntry; } EnBox* chest = (EnBox*)interactedActor; - if (CVar_GetS32("gFastChests", 0) != 0) { + if (CVarGetInteger("gFastChests", 0) != 0) { giEntry.gi = -1 * abs(giEntry.gi); } @@ -6457,7 +6457,7 @@ s32 func_8083EAF0(Player* this, Actor* actor) { s32 func_8083EB44(Player* this, PlayState* play) { u16 buttonsToCheck = BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN; - if (CVar_GetS32("gDpadEquips", 0) != 0) { + if (CVarGetInteger("gDpadEquips", 0) != 0) { buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT; } if ((this->stateFlags1 & PLAYER_STATE1_11) && (this->heldActor != NULL) && @@ -7184,7 +7184,7 @@ void func_808409CC(PlayState* play, Player* this) { if (sp34 < 4) { if (((sp34 != 0) && (sp34 != 3)) || ((this->rightHandType == PLAYER_MODELTYPE_RH_SHIELD) && ((sp34 == 3) || Player_GetSwordHeld(this)))) { - if ((sp34 == 1) && Player_HoldsTwoHandedWeapon(this) && CVar_GetS32("gTwoHandedIdle", 0) == 1) { + if ((sp34 == 1) && Player_HoldsTwoHandedWeapon(this) && CVarGetInteger("gTwoHandedIdle", 0) == 1) { sp34 = 4; } sp38 = sp34 + 9; @@ -7726,22 +7726,22 @@ void func_80842180(Player* this, PlayState* play) { } } - if (CVar_GetS32("gMMBunnyHood", 0) && this->currentMask == PLAYER_MASK_BUNNY) { + if (CVarGetInteger("gMMBunnyHood", 0) && this->currentMask == PLAYER_MASK_BUNNY) { sp2C *= 1.5f; } - if (CVar_GetS32("gEnableWalkModify", 0)) { - if (CVar_GetS32("gWalkSpeedToggle", 0)) { + if (CVarGetInteger("gEnableWalkModify", 0)) { + if (CVarGetInteger("gWalkSpeedToggle", 0)) { if (gWalkSpeedToggle1) { - sp2C *= CVar_GetFloat("gWalkModifierOne", 1.0f); + sp2C *= CVarGetFloat("gWalkModifierOne", 1.0f); } else if (gWalkSpeedToggle2) { - sp2C *= CVar_GetFloat("gWalkModifierTwo", 1.0f); + sp2C *= CVarGetFloat("gWalkModifierTwo", 1.0f); } } else { if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_MODIFIER1)) { - sp2C *= CVar_GetFloat("gWalkModifierOne", 1.0f); + sp2C *= CVarGetFloat("gWalkModifierOne", 1.0f); } else if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_MODIFIER2)) { - sp2C *= CVar_GetFloat("gWalkModifierTwo", 1.0f); + sp2C *= CVarGetFloat("gWalkModifierTwo", 1.0f); } } } @@ -7903,7 +7903,7 @@ s32 func_808428D8(Player* this, PlayState* play) { this->meleeWeaponAnimation = 0xC; this->currentYaw = this->actor.shape.rot.y + this->unk_6BE; - if (!CVar_GetS32("gCrouchStabHammerFix", 0)) { + if (!CVarGetInteger("gCrouchStabHammerFix", 0)) { return 1; } @@ -7914,7 +7914,7 @@ s32 func_808428D8(Player* this, PlayState* play) { swordId = Player_GetSwordHeld(this) - 1; } - if (swordId != 4 && !CVar_GetS32("gCrouchStabFix", 0)) { // 4 = Megaton Hammer + if (swordId != 4 && !CVarGetInteger("gCrouchStabFix", 0)) { // 4 = Megaton Hammer return 1; } @@ -8346,12 +8346,12 @@ void func_80843AE8(PlayState* play, Player* this) { LinkAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_derth_rebirth, 1.0f, 99.0f, Animation_GetLastFrame(&gPlayerAnim_link_derth_rebirth), ANIMMODE_ONCE, 0.0f); } - if (CVar_GetS32("gFairyReviveEffect", 0)) { - if (CVar_GetS32("gFairyRevivePercentRestore", 0)) { + if (CVarGetInteger("gFairyReviveEffect", 0)) { + if (CVarGetInteger("gFairyRevivePercentRestore", 0)) { gSaveContext.healthAccumulator = - (gSaveContext.healthCapacity * CVar_GetS32("gFairyReviveHealth", 100) / 100 + 15) / 16 * 16; + (gSaveContext.healthCapacity * CVarGetInteger("gFairyReviveHealth", 100) / 100 + 15) / 16 * 16; } else { - gSaveContext.healthAccumulator = CVar_GetS32("gFairyReviveHealth", 20) * 16; + gSaveContext.healthAccumulator = CVarGetInteger("gFairyReviveHealth", 20) * 16; } } else { gSaveContext.healthAccumulator = 0x140; @@ -8388,7 +8388,7 @@ static struct_80832924 D_808545F0[] = { }; void func_80843CEC(Player* this, PlayState* play) { - if (this->currentTunic != PLAYER_TUNIC_GORON && CVar_GetS32("gSuperTunic", 0) == 0) { + if (this->currentTunic != PLAYER_TUNIC_GORON && CVarGetInteger("gSuperTunic", 0) == 0) { if ((play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_3) || (D_808535E4 == 9) || ((func_80838144(D_808535E4) >= 0) && !SurfaceType_IsWallDamage(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId))) { @@ -8452,7 +8452,7 @@ s32 func_80843E64(PlayState* play, Player* this) { impactInfo = &D_80854600[impactIndex]; - if (Player_InflictDamageModified(play, impactInfo->damage * (1 << CVar_GetS32("gFallDamageMul", 0)), + if (Player_InflictDamageModified(play, impactInfo->damage * (1 << CVarGetInteger("gFallDamageMul", 0)), false)) { return -1; } @@ -8515,7 +8515,7 @@ void func_8084411C(Player* this, PlayState* play) { Actor* heldActor = this->heldActor; u16 buttonsToCheck = BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN; - if (CVar_GetS32("gDpadEquips", 0) != 0) { + if (CVarGetInteger("gDpadEquips", 0) != 0) { buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT; } if (!func_80835644(play, this, heldActor) && (heldActor->id == ACTOR_EN_NIW) && @@ -9268,7 +9268,7 @@ void func_80846120(Player* this, PlayState* play) { if (LinkAnimation_OnFrame(&this->skelAnime, 229.0f)) { Actor* heldActor = this->heldActor; - if (CVar_GetS32("gFasterHeavyBlockLift", 0)) { + if (CVarGetInteger("gFasterHeavyBlockLift", 0)) { // This is the difference in rotation when the animation is sped up 5x heldActor->shape.rot.x -= 3510; } @@ -9293,7 +9293,7 @@ void func_80846260(Player* this, PlayState* play) { } u16 buttonsToCheck = BTN_A | BTN_B | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN; - if (CVar_GetS32("gDpadEquips", 0) != 0) { + if (CVarGetInteger("gDpadEquips", 0) != 0) { buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT; } if (this->unk_850 == 0) { @@ -9623,7 +9623,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { func_80835F44(play, this, ITEM_NONE); Player_SetEquipmentData(play, this); this->prevBoots = this->currentBoots; - if (CVar_GetS32("gMMBunnyHood", 0)) { + if (CVarGetInteger("gMMBunnyHood", 0)) { if (INV_CONTENT(ITEM_TRADE_CHILD) == ITEM_SOLD_OUT) { sMaskMemory = PLAYER_MASK_NONE; } @@ -9631,7 +9631,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { for (uint16_t cSlotIndex = 0; cSlotIndex < ARRAY_COUNT(gSaveContext.equips.cButtonSlots); cSlotIndex++) { if (gSaveContext.equips.cButtonSlots[cSlotIndex] == SLOT_TRADE_CHILD && (gItemAgeReqs[gSaveContext.equips.buttonItems[cSlotIndex + 1]] != 9 && LINK_IS_ADULT && - !CVar_GetS32("gTimelessEquipment", 0))) { + !CVarGetInteger("gTimelessEquipment", 0))) { gSaveContext.equips.cButtonSlots[cSlotIndex] = SLOT_NONE; gSaveContext.equips.buttonItems[cSlotIndex + 1] = ITEM_NONE; } @@ -9887,7 +9887,7 @@ void func_808473D4(PlayState* play, Player* this) { if (doAction != DO_ACTION_PUTAWAY) { this->unk_837 = 20; } else if (this->unk_837 != 0) { - if (CVar_GetS32("gInstantPutaway", 0) != 0) { + if (CVarGetInteger("gInstantPutaway", 0) != 0) { this->unk_837 = 0; } else { doAction = DO_ACTION_NONE; @@ -10088,7 +10088,7 @@ void func_80847BA0(PlayState* play, Player* this) { if ((this->actor.bgCheckFlags & 0x200) && (D_80853608 < 0x3000)) { CollisionPoly* wallPoly = this->actor.wallPoly; - if ((ABS(wallPoly->normal.y) < 600) || (CVar_GetS32("gClimbEverything", 0) != 0)) { + if ((ABS(wallPoly->normal.y) < 600) || (CVarGetInteger("gClimbEverything", 0) != 0)) { f32 sp8C = COLPOLY_GET_NORMAL(wallPoly->normal.x); f32 sp88 = COLPOLY_GET_NORMAL(wallPoly->normal.y); f32 sp84 = COLPOLY_GET_NORMAL(wallPoly->normal.z); @@ -10278,7 +10278,7 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) { seqMode = SEQ_MODE_STILL; } - if (play->actorCtx.targetCtx.bgmEnemy != NULL && !CVar_GetS32("gEnemyBGMDisable", 0)) { + if (play->actorCtx.targetCtx.bgmEnemy != NULL && !CVarGetInteger("gEnemyBGMDisable", 0)) { seqMode = SEQ_MODE_ENEMY; Audio_SetBgmEnemyVolume(sqrtf(play->actorCtx.targetCtx.bgmEnemy->xyzDistToPlayerSq)); } @@ -10357,7 +10357,7 @@ void func_80848C74(PlayState* play, Player* this) { s32 sp58; s32 sp54; - if (this->currentTunic == PLAYER_TUNIC_GORON || CVar_GetS32("gSuperTunic", 0) != 0) { + if (this->currentTunic == PLAYER_TUNIC_GORON || CVarGetInteger("gSuperTunic", 0) != 0) { sp54 = 20; } else { sp54 = (s32)(this->linearVelocity * 0.4f) + 1; @@ -10426,17 +10426,17 @@ void func_80848EF8(Player* this, PlayState* play) { /*Prevent it on horse, while jumping and on title screen. If you fly around no stone of agony for you! */ Color_RGB8 stoneOfAgonyColor = { 255, 255, 255 }; - if (CVar_GetS32("gCosmetics.Hud_StoneOfAgony.Changed", 0)) { - stoneOfAgonyColor = CVar_GetRGB("gCosmetics.Hud_StoneOfAgony.Value", stoneOfAgonyColor); + if (CVarGetInteger("gCosmetics.Hud_StoneOfAgony.Changed", 0)) { + stoneOfAgonyColor = CVarGetColor24("gCosmetics.Hud_StoneOfAgony.Value", stoneOfAgonyColor); } - if (CVar_GetS32("gVisualAgony", 0) != 0 && !this->stateFlags1) { - s16 Top_Margins = (CVar_GetS32("gHUDMargin_T", 0) * -1); - s16 Left_Margins = CVar_GetS32("gHUDMargin_L", 0); - s16 Right_Margins = CVar_GetS32("gHUDMargin_R", 0); + if (CVarGetInteger("gVisualAgony", 0) != 0 && !this->stateFlags1) { + s16 Top_Margins = (CVarGetInteger("gHUDMargin_T", 0) * -1); + s16 Left_Margins = CVarGetInteger("gHUDMargin_L", 0); + s16 Right_Margins = CVarGetInteger("gHUDMargin_R", 0); s16 X_Margins_VSOA; s16 Y_Margins_VSOA; - if (CVar_GetS32("gVSOAUseMargins", 0) != 0) { - if (CVar_GetS32("gVSOAPosType", 0) == 0) { + if (CVarGetInteger("gVSOAUseMargins", 0) != 0) { + if (CVarGetInteger("gVSOAPosType", 0) == 0) { X_Margins_VSOA = Left_Margins; }; Y_Margins_VSOA = Top_Margins; @@ -10448,21 +10448,21 @@ void func_80848EF8(Player* this, PlayState* play) { s16 PosY_VSOA_ori = 60 + Y_Margins_VSOA; s16 PosX_VSOA; s16 PosY_VSOA; - if (CVar_GetS32("gVSOAPosType", 0) != 0) { - PosY_VSOA = CVar_GetS32("gVSOAPosY", 0) + Y_Margins_VSOA; - if (CVar_GetS32("gVSOAPosType", 0) == 1) { // Anchor Left - if (CVar_GetS32("gVSOAUseMargins", 0) != 0) { + if (CVarGetInteger("gVSOAPosType", 0) != 0) { + PosY_VSOA = CVarGetInteger("gVSOAPosY", 0) + Y_Margins_VSOA; + if (CVarGetInteger("gVSOAPosType", 0) == 1) { // Anchor Left + if (CVarGetInteger("gVSOAUseMargins", 0) != 0) { X_Margins_VSOA = Left_Margins; }; - PosX_VSOA = OTRGetDimensionFromLeftEdge(CVar_GetS32("gVSOAPosX", 0) + X_Margins_VSOA); - } else if (CVar_GetS32("gVSOAPosType", 0) == 2) { // Anchor Right - if (CVar_GetS32("gVSOAUseMargins", 0) != 0) { + PosX_VSOA = OTRGetDimensionFromLeftEdge(CVarGetInteger("gVSOAPosX", 0) + X_Margins_VSOA); + } else if (CVarGetInteger("gVSOAPosType", 0) == 2) { // Anchor Right + if (CVarGetInteger("gVSOAUseMargins", 0) != 0) { X_Margins_VSOA = Right_Margins; }; - PosX_VSOA = OTRGetDimensionFromRightEdge(CVar_GetS32("gVSOAPosX", 0) + X_Margins_VSOA); - } else if (CVar_GetS32("gVSOAPosType", 0) == 3) { // Anchor None - PosX_VSOA = CVar_GetS32("gVSOAPosX", 0); - } else if (CVar_GetS32("gVSOAPosType", 0) == 4) { // Hidden + PosX_VSOA = OTRGetDimensionFromRightEdge(CVarGetInteger("gVSOAPosX", 0) + X_Margins_VSOA); + } else if (CVarGetInteger("gVSOAPosType", 0) == 3) { // Anchor None + PosX_VSOA = CVarGetInteger("gVSOAPosX", 0); + } else if (CVarGetInteger("gVSOAPosType", 0) == 4) { // Hidden PosX_VSOA = -9999; } } else { @@ -10513,7 +10513,7 @@ void func_80848EF8(Player* this, PlayState* play) { if (this->unk_6A0 > 4000000.0f) { this->unk_6A0 = 0.0f; - if (CVar_GetS32("gVisualAgony", 0) != 0 && !this->stateFlags1) { + if (CVarGetInteger("gVisualAgony", 0) != 0 && !this->stateFlags1) { // This audio is placed here and not in previous CVar check to prevent ears ra.. :) Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E0); } @@ -10975,7 +10975,7 @@ void Player_Update(Actor* thisx, PlayState* play) { } } - if (CVar_GetS32("gEnableWalkModify", 0) && CVar_GetS32("gWalkSpeedToggle", 0)) { + if (CVarGetInteger("gEnableWalkModify", 0) && CVarGetInteger("gWalkSpeedToggle", 0)) { if (CHECK_BTN_ALL(sControlInput->press.button, BTN_MODIFIER1)) { gWalkSpeedToggle1 = !gWalkSpeedToggle1; } @@ -11051,7 +11051,7 @@ void Player_DrawGameplay(PlayState* play, Player* this, s32 lod, Gfx* cullDList, if ((overrideLimbDraw == func_80090014) && (this->currentMask != PLAYER_MASK_NONE)) { // Fixes a bug in vanilla where ice traps are rendered extremely large while wearing a bunny hood - if (CVar_GetS32("gFixIceTrapWithBunnyHood", 1)) Matrix_Push(); + if (CVarGetInteger("gFixIceTrapWithBunnyHood", 1)) Matrix_Push(); Mtx* sp70 = Graph_Alloc(play->state.gfxCtx, 2 * sizeof(Mtx)); if (this->currentMask == PLAYER_MASK_BUNNY) { @@ -11063,18 +11063,18 @@ void Player_DrawGameplay(PlayState* play, Player* this, s32 lod, Gfx* cullDList, sp68.x = D_80858AC8.unk_02 + 0x3E2; sp68.y = D_80858AC8.unk_04 + 0xDBE; sp68.z = D_80858AC8.unk_00 - 0x348A; - Matrix_SetTranslateRotateYXZ(97.0f, -1203.0f - CVar_GetFloat("gCosmetics.BunnyHood_EarLength", 0.0f), -240.0f - CVar_GetFloat("gCosmetics.BunnyHood_EarSpread", 0.0f), &sp68); + Matrix_SetTranslateRotateYXZ(97.0f, -1203.0f - CVarGetFloat("gCosmetics.BunnyHood_EarLength", 0.0f), -240.0f - CVarGetFloat("gCosmetics.BunnyHood_EarSpread", 0.0f), &sp68); MATRIX_TOMTX(sp70++); sp68.x = D_80858AC8.unk_02 - 0x3E2; sp68.y = -0xDBE - D_80858AC8.unk_04; sp68.z = D_80858AC8.unk_00 - 0x348A; - Matrix_SetTranslateRotateYXZ(97.0f, -1203.0f - CVar_GetFloat("gCosmetics.BunnyHood_EarLength", 0.0f), 240.0f + CVar_GetFloat("gCosmetics.BunnyHood_EarSpread", 0.0f), &sp68); + Matrix_SetTranslateRotateYXZ(97.0f, -1203.0f - CVarGetFloat("gCosmetics.BunnyHood_EarLength", 0.0f), 240.0f + CVarGetFloat("gCosmetics.BunnyHood_EarSpread", 0.0f), &sp68); MATRIX_TOMTX(sp70); } gSPDisplayList(POLY_OPA_DISP++, sMaskDlists[this->currentMask - 1]); - if (CVar_GetS32("gFixIceTrapWithBunnyHood", 1)) Matrix_Pop(); + if (CVarGetInteger("gFixIceTrapWithBunnyHood", 1)) Matrix_Pop(); } if ((this->currentBoots == PLAYER_BOOTS_HOVER) && !(this->actor.bgCheckFlags & 1) && @@ -11161,7 +11161,7 @@ void Player_Draw(Actor* thisx, PlayState* play2) { lod = 1; } - if (CVar_GetS32("gDisableLOD", 0) != 0) + if (CVarGetInteger("gDisableLOD", 0) != 0) lod = 0; func_80093C80(play); @@ -11263,27 +11263,27 @@ s16 func_8084ABD8(PlayState* play, Player* this, s32 arg2, s16 arg3) { s16 temp2; s16 temp3; - if (!func_8002DD78(this) && !func_808334B4(this) && (arg2 == 0) && !CVar_GetS32("gDisableAutoCenterViewFirstPerson", 0)) { - temp2 = sControlInput->rel.stick_y * 240.0f * (CVar_GetS32("gInvertAimingYAxis", 1) ? 1 : -1); // Sensitivity not applied here because higher than default sensitivies will allow the camera to escape the autocentering, and glitch out massively + if (!func_8002DD78(this) && !func_808334B4(this) && (arg2 == 0) && !CVarGetInteger("gDisableAutoCenterViewFirstPerson", 0)) { + temp2 = sControlInput->rel.stick_y * 240.0f * (CVarGetInteger("gInvertAimingYAxis", 1) ? 1 : -1); // Sensitivity not applied here because higher than default sensitivies will allow the camera to escape the autocentering, and glitch out massively Math_SmoothStepToS(&this->actor.focus.rot.x, temp2, 14, 4000, 30); - temp2 = sControlInput->rel.stick_x * -16.0f * (CVar_GetS32("gInvertAimingXAxis", 0) ? -1 : 1) * (CVar_GetFloat("gFirstPersonCameraSensitivity", 1.0f)); + temp2 = sControlInput->rel.stick_x * -16.0f * (CVarGetInteger("gInvertAimingXAxis", 0) ? -1 : 1) * (CVarGetFloat("gFirstPersonCameraSensitivity", 1.0f)); temp2 = CLAMP(temp2, -3000, 3000); this->actor.focus.rot.y += temp2; } else { temp1 = (this->stateFlags1 & PLAYER_STATE1_23) ? 3500 : 14000; temp3 = ((sControlInput->rel.stick_y >= 0) ? 1 : -1) * (s32)((1.0f - Math_CosS(sControlInput->rel.stick_y * 200)) * 1500.0f * - (CVar_GetS32("gInvertAimingYAxis", 1) ? 1 : -1)) * (CVar_GetFloat("gFirstPersonCameraSensitivity", 1.0f)); + (CVarGetInteger("gInvertAimingYAxis", 1) ? 1 : -1)) * (CVarGetFloat("gFirstPersonCameraSensitivity", 1.0f)); this->actor.focus.rot.x += temp3; if (fabsf(sControlInput->cur.gyro_x) > 0.01f) { this->actor.focus.rot.x -= (sControlInput->cur.gyro_x) * 750.0f; } - if (fabsf(sControlInput->cur.right_stick_y) > 15.0f && CVar_GetS32("gRightStickAiming", 0) != 0) { + if (fabsf(sControlInput->cur.right_stick_y) > 15.0f && CVarGetInteger("gRightStickAiming", 0) != 0) { this->actor.focus.rot.x -= - (sControlInput->cur.right_stick_y) * 10.0f * (CVar_GetS32("gInvertAimingYAxis", 1) ? -1 : 1) * (CVar_GetFloat("gFirstPersonCameraSensitivity", 1.0f)); + (sControlInput->cur.right_stick_y) * 10.0f * (CVarGetInteger("gInvertAimingYAxis", 1) ? -1 : 1) * (CVarGetFloat("gFirstPersonCameraSensitivity", 1.0f)); } this->actor.focus.rot.x = CLAMP(this->actor.focus.rot.x, -temp1, temp1); @@ -11292,7 +11292,7 @@ s16 func_8084ABD8(PlayState* play, Player* this, s32 arg2, s16 arg3) { temp2 = this->actor.focus.rot.y - this->actor.shape.rot.y; temp3 = ((sControlInput->rel.stick_x >= 0) ? 1 : -1) * (s32)((1.0f - Math_CosS(sControlInput->rel.stick_x * 200)) * -1500.0f * - (CVar_GetS32("gInvertAimingXAxis", 0) ? -1 : 1)) * (CVar_GetFloat("gFirstPersonCameraSensitivity", 1.0f)); + (CVarGetInteger("gInvertAimingXAxis", 0) ? -1 : 1)) * (CVarGetFloat("gFirstPersonCameraSensitivity", 1.0f)); temp2 += temp3; this->actor.focus.rot.y = CLAMP(temp2, -temp1, temp1) + this->actor.shape.rot.y; @@ -11301,9 +11301,9 @@ s16 func_8084ABD8(PlayState* play, Player* this, s32 arg2, s16 arg3) { this->actor.focus.rot.y += (sControlInput->cur.gyro_y) * 750.0f; } - if (fabsf(sControlInput->cur.right_stick_x) > 15.0f && CVar_GetS32("gRightStickAiming", 0) != 0) { + if (fabsf(sControlInput->cur.right_stick_x) > 15.0f && CVarGetInteger("gRightStickAiming", 0) != 0) { this->actor.focus.rot.y += - (sControlInput->cur.right_stick_x) * 10.0f * (CVar_GetS32("gInvertAimingXAxis", 0) ? 1 : -1) * (CVar_GetFloat("gFirstPersonCameraSensitivity", 1.0f)); + (sControlInput->cur.right_stick_x) * 10.0f * (CVarGetInteger("gInvertAimingXAxis", 0) ? 1 : -1) * (CVarGetFloat("gFirstPersonCameraSensitivity", 1.0f)); } } @@ -11415,7 +11415,7 @@ void func_8084B1D8(Player* this, PlayState* play) { } u16 buttonsToCheck = BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN; - if (CVar_GetS32("gDpadEquips", 0) != 0) { + if (CVarGetInteger("gDpadEquips", 0) != 0) { buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT; } if ((this->csMode != 0) || (this->unk_6AD == 0) || (this->unk_6AD >= 4) || func_80833B54(this) || @@ -11779,7 +11779,7 @@ void func_8084BF1C(Player* this, PlayState* play) { phi_f2 = -1.0f; } - this->skelAnime.playSpeed = phi_f2 * phi_f0 + phi_f2 * CVar_GetS32("gClimbSpeed", 0); + this->skelAnime.playSpeed = phi_f2 * phi_f0 + phi_f2 * CVarGetInteger("gClimbSpeed", 0); if (this->unk_850 >= 0) { if ((this->actor.wallPoly != NULL) && (this->actor.wallBgId != BGCHECK_SCENE)) { @@ -12583,9 +12583,9 @@ s32 func_8084DFF4(PlayState* play, Player* this) { } this->unk_84F = 1; equipItem = giEntry.itemId; - equipNow = CVar_GetS32("gAskToEquip", 0) && equipItem >= ITEM_SWORD_KOKIRI && equipItem <= ITEM_TUNIC_ZORA && + equipNow = CVarGetInteger("gAskToEquip", 0) && equipItem >= ITEM_SWORD_KOKIRI && equipItem <= ITEM_TUNIC_ZORA && ((gItemAgeReqs[equipItem] == 9 || gItemAgeReqs[equipItem] == gSaveContext.linkAge) || - CVar_GetS32("gTimelessEquipment", 0)); + CVarGetInteger("gTimelessEquipment", 0)); Message_StartTextbox(play, giEntry.textId, &this->actor); // RANDOTODO: Macro this boolean check. @@ -12951,29 +12951,29 @@ void func_8084EAC0(Player* this, PlayState* play) { } else { s32 sp28 = D_808549FC[this->itemAction - PLAYER_IA_BOTTLE_POTION_RED]; - if (CVar_GetS32("gRedPotionEffect", 0) && this->itemAction == PLAYER_IA_BOTTLE_POTION_RED) { - if (CVar_GetS32("gRedPercentRestore", 0)) { + if (CVarGetInteger("gRedPotionEffect", 0) && this->itemAction == PLAYER_IA_BOTTLE_POTION_RED) { + if (CVarGetInteger("gRedPercentRestore", 0)) { gSaveContext.healthAccumulator = - (gSaveContext.healthCapacity * CVar_GetS32("gRedPotionHealth", 100) / 100 + 15) / 16 * 16; + (gSaveContext.healthCapacity * CVarGetInteger("gRedPotionHealth", 100) / 100 + 15) / 16 * 16; } else { - gSaveContext.healthAccumulator = CVar_GetS32("gRedPotionHealth", 20) * 16; + gSaveContext.healthAccumulator = CVarGetInteger("gRedPotionHealth", 20) * 16; } - } else if (CVar_GetS32("gBluePotionEffects", 0) && + } else if (CVarGetInteger("gBluePotionEffects", 0) && this->itemAction == PLAYER_IA_BOTTLE_POTION_BLUE) { - if (CVar_GetS32("gBlueHealthPercentRestore", 0)) { + if (CVarGetInteger("gBlueHealthPercentRestore", 0)) { gSaveContext.healthAccumulator = - (gSaveContext.healthCapacity * CVar_GetS32("gBluePotionHealth", 100) / 100 + 15) / 16 * 16; + (gSaveContext.healthCapacity * CVarGetInteger("gBluePotionHealth", 100) / 100 + 15) / 16 * 16; } else { - gSaveContext.healthAccumulator = CVar_GetS32("gBluePotionHealth", 20) * 16; + gSaveContext.healthAccumulator = CVarGetInteger("gBluePotionHealth", 20) * 16; } - if (CVar_GetS32("gBlueManaPercentRestore", 0)) { + if (CVarGetInteger("gBlueManaPercentRestore", 0)) { if (gSaveContext.magicState != 10) { Magic_Fill(play); } func_80087708(play, - (gSaveContext.magicLevel * 48 * CVar_GetS32("gBluePotionMana", 100) / 100 + 15) / + (gSaveContext.magicLevel * 48 * CVarGetInteger("gBluePotionMana", 100) / 100 + 15) / 16 * 16, 5); } else { @@ -12981,18 +12981,18 @@ void func_8084EAC0(Player* this, PlayState* play) { Magic_Fill(play); } - func_80087708(play, CVar_GetS32("gBluePotionMana", 100), 5); + func_80087708(play, CVarGetInteger("gBluePotionMana", 100), 5); ; } - } else if (CVar_GetS32("gGreenPotionEffect", 0) && + } else if (CVarGetInteger("gGreenPotionEffect", 0) && this->itemAction == PLAYER_IA_BOTTLE_POTION_GREEN) { - if (CVar_GetS32("gGreenPercentRestore", 0)) { + if (CVarGetInteger("gGreenPercentRestore", 0)) { if (gSaveContext.magicState != 10) { Magic_Fill(play); } func_80087708(play, - (gSaveContext.magicLevel * 48 * CVar_GetS32("gGreenPotionMana", 100) / 100 + 15) / + (gSaveContext.magicLevel * 48 * CVarGetInteger("gGreenPotionMana", 100) / 100 + 15) / 16 * 16, 5); } else { @@ -13000,25 +13000,25 @@ void func_8084EAC0(Player* this, PlayState* play) { Magic_Fill(play); } - func_80087708(play, CVar_GetS32("gGreenPotionMana", 100), 5); + func_80087708(play, CVarGetInteger("gGreenPotionMana", 100), 5); ; } - } else if (CVar_GetS32("gMilkEffect", 0) && (this->itemAction == PLAYER_IA_BOTTLE_MILK || + } else if (CVarGetInteger("gMilkEffect", 0) && (this->itemAction == PLAYER_IA_BOTTLE_MILK || this->itemAction == PLAYER_IA_BOTTLE_MILK_HALF)) { - if (CVar_GetS32("gMilkPercentRestore", 0)) { + if (CVarGetInteger("gMilkPercentRestore", 0)) { gSaveContext.healthAccumulator = - (gSaveContext.healthCapacity * CVar_GetS32("gMilkHealth", 100) / 100 + 15) / 16 * 16; + (gSaveContext.healthCapacity * CVarGetInteger("gMilkHealth", 100) / 100 + 15) / 16 * 16; } else { - gSaveContext.healthAccumulator = CVar_GetS32("gMilkHealth", 5) * 16; + gSaveContext.healthAccumulator = CVarGetInteger("gMilkHealth", 5) * 16; } - if (CVar_GetS32("gSeparateHalfMilkEffect", 0) && + if (CVarGetInteger("gSeparateHalfMilkEffect", 0) && this->itemAction == PLAYER_IA_BOTTLE_MILK_HALF) { - if (CVar_GetS32("gHalfMilkPercentRestore", 0)) { + if (CVarGetInteger("gHalfMilkPercentRestore", 0)) { gSaveContext.healthAccumulator = - (gSaveContext.healthCapacity * CVar_GetS32("gHalfMilkHealth", 100) / 100 + 15) / 16 * + (gSaveContext.healthCapacity * CVarGetInteger("gHalfMilkHealth", 100) / 100 + 15) / 16 * 16; } else { - gSaveContext.healthAccumulator = CVar_GetS32("gHalfMilkHealth", 5) * 16; + gSaveContext.healthAccumulator = CVarGetInteger("gHalfMilkHealth", 5) * 16; } } } else { @@ -13074,7 +13074,7 @@ void func_8084ECA4(Player* this, PlayState* play) { if (LinkAnimation_Update(play, &this->skelAnime)) { if (this->unk_84F != 0) { if (this->unk_850 == 0) { - if (CVar_GetS32("gFastDrops", 0)) { + if (CVarGetInteger("gFastDrops", 0)) { this->unk_84F = 0; } else { Message_StartTextbox(play, D_80854A04[this->unk_84F - 1].textId, &this->actor); @@ -13113,7 +13113,7 @@ void func_8084ECA4(Player* this, PlayState* play) { this->unk_850 = 0; this->interactRangeActor->parent = &this->actor; Player_UpdateBottleHeld(play, this, catchInfo->itemId, ABS(catchInfo->actionParam)); - if (!CVar_GetS32("gFastDrops", 0)) { + if (!CVarGetInteger("gFastDrops", 0)) { this->stateFlags1 |= PLAYER_STATE1_28 | PLAYER_STATE1_29; func_808322D0(play, this, sp24->unk_04); func_80835EA4(play, 4); @@ -13145,12 +13145,12 @@ void func_8084EED8(Player* this, PlayState* play) { func_8002F7DC(&this->actor, NA_SE_EV_BOTTLE_CAP_OPEN); func_8002F7DC(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG); } else if (LinkAnimation_OnFrame(&this->skelAnime, 47.0f)) { - if (CVar_GetS32("gFairyEffect", 0)) { - if (CVar_GetS32("gFairyPercentRestore", 0)) { + if (CVarGetInteger("gFairyEffect", 0)) { + if (CVarGetInteger("gFairyPercentRestore", 0)) { gSaveContext.healthAccumulator = - (gSaveContext.healthCapacity * CVar_GetS32("gFairyHealth", 100) / 100 + 15) / 16 * 16; + (gSaveContext.healthCapacity * CVarGetInteger("gFairyHealth", 100) / 100 + 15) / 16 * 16; } else { - gSaveContext.healthAccumulator = CVar_GetS32("gFairyHealth", 8) * 16; + gSaveContext.healthAccumulator = CVarGetInteger("gFairyHealth", 8) * 16; } } else { gSaveContext.healthAccumulator = 0x140; @@ -13486,7 +13486,7 @@ void func_8084FBF4(Player* this, PlayState* play) { s32 func_8084FCAC(Player* this, PlayState* play) { sControlInput = &play->state.input[0]; - if (CVar_GetS32("gDebugEnabled", 0) && + if (CVarGetInteger("gDebugEnabled", 0) && ((CHECK_BTN_ALL(sControlInput->cur.button, BTN_A | BTN_L | BTN_R) && CHECK_BTN_ALL(sControlInput->press.button, BTN_B)) || (CHECK_BTN_ALL(sControlInput->cur.button, BTN_L) && CHECK_BTN_ALL(sControlInput->press.button, BTN_DRIGHT)))) { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.h b/soh/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.h index a22d3092d..0798343be 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Blast/z_eff_ss_blast.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_BLAST_H #define Z_EFF_SS_BLAST_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h b/soh/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h index 1f7abc2f9..bbc2a4b20 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Bomb/z_eff_ss_bomb.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_BOMB_H #define Z_EFF_SS_BOMB_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.h b/soh/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.h index 8fe9efc02..9f5ccf25f 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Bomb2/z_eff_ss_bomb2.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_BOMB2_H #define Z_EFF_SS_BOMB2_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.h b/soh/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.h index c8a77cfb3..da30a5fc9 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_BUBBLE_H #define Z_EFF_SS_BUBBLE_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.h b/soh/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.h index 44f891a2e..23b838155 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_D_FIRE_H #define Z_EFF_SS_D_FIRE_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.h b/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.h index 69f890b8f..5bb73d8e5 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Db/z_eff_ss_dead_db.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_DEAD_DB_H #define Z_EFF_SS_DEAD_DB_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.h b/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.h index 3b3281cde..0db319ff6 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_DEAD_DD_H #define Z_EFF_SS_DEAD_DD_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.h b/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.h index d6a9b9afb..f53338457 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Ds/z_eff_ss_dead_ds.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_DEAD_DS_H #define Z_EFF_SS_DEAD_DS_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h b/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h index 624159f3d..b368fb006 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_DEAD_SOUND_H #define Z_EFF_SS_DEAD_SOUND_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.h b/soh/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.h index d7629b3b4..e1a506310 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_DT_BUBBLE_H #define Z_EFF_SS_DT_BUBBLE_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h b/soh/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h index a56bc38f5..f3b08b76e 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_DUST_H #define Z_EFF_SS_DUST_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.h b/soh/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.h index bf8839be9..2f5545519 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_En_Fire/z_eff_ss_en_fire.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_EN_FIRE_H #define Z_EFF_SS_EN_FIRE_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h b/soh/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h index 985e37b84..d4a6f5d89 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_En_Ice/z_eff_ss_en_ice.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_EN_ICE_H #define Z_EFF_SS_EN_ICE_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.h b/soh/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.h index cc05775c2..7b8953a95 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_EXTRA_H #define Z_EFF_SS_EXTRA_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.h b/soh/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.h index 01709c6aa..35b295530 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Fcircle/z_eff_ss_fcircle.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_FCIRCLE_H #define Z_EFF_SS_FCIRCLE_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h b/soh/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h index 4a56d0b9f..b26318b18 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_FHGFLASH_H #define Z_EFF_SS_FHGFLASH_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.h b/soh/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.h index 424d769f1..00eab4e97 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Fire_Tail/z_eff_ss_fire_tail.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_FIRE_TAIL_H #define Z_EFF_SS_FIRE_TAIL_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.h b/soh/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.h index 1fb6af2f2..710587ee8 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_G_Fire/z_eff_ss_g_fire.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_G_FIRE_H #define Z_EFF_SS_G_FIRE_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.h b/soh/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.h index a63e567e5..3c08f55de 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_G_Magma/z_eff_ss_g_magma.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_G_MAGMA_H #define Z_EFF_SS_G_MAGMA_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.h b/soh/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.h index d1993832c..a4ced3808 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_G_Magma2/z_eff_ss_g_magma2.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_G_MAGMA2_H #define Z_EFF_SS_G_MAGMA2_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.h b/soh/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.h index afe8e89e1..f91e2eb6a 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_G_Ripple/z_eff_ss_g_ripple.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_G_RIPPLE_H #define Z_EFF_SS_G_RIPPLE_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.h b/soh/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.h index a4a22cef1..7b5023020 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_G_Spk/z_eff_ss_g_spk.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_G_SPK_H #define Z_EFF_SS_G_SPK_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h b/soh/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h index b761ce332..c2d106187 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_G_SPLASH_H #define Z_EFF_SS_G_SPLASH_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h b/soh/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h index 990699431..9eb66f8bc 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_HAHEN_H #define Z_EFF_SS_HAHEN_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h b/soh/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h index 74f8e7f80..90338ddd6 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_HITMARK_H #define Z_EFF_SS_HITMARK_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.h b/soh/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.h index 2a697d74e..5f4eddb0c 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Ice_Piece/z_eff_ss_ice_piece.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_ICE_PIECE_H #define Z_EFF_SS_ICE_PIECE_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.h b/soh/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.h index 08fc6f745..314a3143c 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_ICE_SMOKE_H #define Z_EFF_SS_ICE_SMOKE_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.h b/soh/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.h index e8b2c617c..ee6ee49ca 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_K_Fire/z_eff_ss_k_fire.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_K_FIRE_H #define Z_EFF_SS_K_FIRE_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h b/soh/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h index 17a4c8da1..773add6e8 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_KAKERA_H #define Z_EFF_SS_KAKERA_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h b/soh/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h index 290fec68d..ba39d1633 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_KiraKira/z_eff_ss_kirakira.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_KIRAKIRA_H #define Z_EFF_SS_KIRAKIRA_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.h b/soh/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.h index 758f2cce6..5bfc56978 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Lightning/z_eff_ss_lightning.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_LIGHTNING_H #define Z_EFF_SS_LIGHTNING_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.h b/soh/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.h index 321fd334e..f9cb09309 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_SIBUKI_H #define Z_EFF_SS_SIBUKI_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.h b/soh/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.h index c0201fba0..dbcdc538e 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Sibuki2/z_eff_ss_sibuki2.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_SIBUKI2_H #define Z_EFF_SS_SIBUKI2_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c b/soh/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c index d6c04c24b..a1a46f6de 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.c @@ -222,7 +222,7 @@ static void draw_ico_sphere(Gfx** p_gfx_p, f32 x, f32 y, f32 z, f32 radius, Grap } void EffectSsSolderSrchBall_Draw(PlayState* play, u32 index, EffectSs* this) { - if (CVar_GetS32("gGuardVision", 0) == 0) { + if (CVarGetInteger("gGuardVision", 0) == 0) { return; } diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h b/soh/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h index e29ca6e3f..d00844b8d 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Solder_Srch_Ball/z_eff_ss_solder_srch_ball.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_SOLDERSRCHBALL_H #define Z_EFF_SS_SOLDERSRCHBALL_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h b/soh/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h index a3df5491c..f307d0cda 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_STICK_H #define Z_EFF_SS_STICK_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h b/soh/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h index 680345014..c3b16ae35 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Stone1/z_eff_ss_stone1.h @@ -1,7 +1,7 @@ #ifndef Z_EFF_SS_STONE1_H #define Z_EFF_SS_STONE1_H -#include "ultra64.h" +#include #include "global.h" typedef struct { diff --git a/soh/src/overlays/gamestates/ovl_file_choose/file_choose.h b/soh/src/overlays/gamestates/ovl_file_choose/file_choose.h index 0abf7583a..551bd3942 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/file_choose.h +++ b/soh/src/overlays/gamestates/ovl_file_choose/file_choose.h @@ -1,7 +1,7 @@ #ifndef _FILE_CHOOSE_H_ #define _FILE_CHOOSE_H_ -#include "ultra64.h" +#include #include "global.h" #include "vt.h" 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 ee28e85d8..397a1a2c6 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 @@ -15,7 +15,7 @@ #define RANDOMIZER_QUEST 2 #define MIN_QUEST (ResourceMgr_GameHasOriginal() ? NORMAL_QUEST : MASTER_QUEST) u8 getMaxQuest() { - if ((strnlen(CVar_GetString("gSpoilerLog", ""), 1) != 0)) { + if ((strnlen(CVarGetString("gSpoilerLog", ""), 1) != 0)) { return RANDOMIZER_QUEST; } @@ -111,7 +111,7 @@ void FileChoose_DrawImageRGBA32(GraphicsContext* gfxCtx, s16 centerX, s16 center OPEN_DISPS(gfxCtx); - source = ResourceMgr_LoadTexByName(source); + source = GetResourceDataByName(source, false); curTexture = source; rectLeft = centerX - (width / 2); @@ -403,7 +403,7 @@ void DrawSeedHashSprites(FileChooseContext* this) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0xFF, 0xFF, 0xFF, this->fileButtonAlpha[this->buttonIndex]); - if (strnlen(CVar_GetString("gSpoilerLog", ""), 1) != 0 && fileSelectSpoilerFileLoaded) { + if (strnlen(CVarGetString("gSpoilerLog", ""), 1) != 0 && fileSelectSpoilerFileLoaded) { u16 xStart = 64; for (unsigned int i = 0; i < 5; i++) { SpriteLoad(this, GetSeedTexture(gSaveContext.seedIcons[i])); @@ -420,11 +420,11 @@ void DrawSeedHashSprites(FileChooseContext* this) { u8 generating; void FileChoose_UpdateRandomizer() { - if (CVar_GetS32("gRandoGenerating", 0) != 0 && generating == 0) { + if (CVarGetInteger("gRandoGenerating", 0) != 0 && generating == 0) { generating = 1; func_800F5E18(SEQ_PLAYER_BGM_MAIN, NA_BGM_HORSE, 0, 7, 1); return; - } else if (CVar_GetS32("gRandoGenerating", 0) == 0 && generating) { + } else if (CVarGetInteger("gRandoGenerating", 0) == 0 && generating) { Audio_PlayFanfare(NA_BGM_HORSE_GOAL); func_800F5E18(SEQ_PLAYER_BGM_MAIN, NA_BGM_FILE_SELECT, 0, 7, 1); generating = 0; @@ -433,25 +433,25 @@ void FileChoose_UpdateRandomizer() { return; } - if (!SpoilerFileExists(CVar_GetString("gSpoilerLog", ""))) { - CVar_SetString("gSpoilerLog", ""); + if (!SpoilerFileExists(CVarGetString("gSpoilerLog", ""))) { + CVarSetString("gSpoilerLog", ""); fileSelectSpoilerFileLoaded = false; } - if ((CVar_GetS32("gNewFileDropped", 0) != 0) || (CVar_GetS32("gNewSeedGenerated", 0) != 0) || - (!fileSelectSpoilerFileLoaded && SpoilerFileExists(CVar_GetString("gSpoilerLog", "")))) { - if (CVar_GetS32("gNewFileDropped", 0) != 0) { - CVar_SetString("gSpoilerLog", CVar_GetString("gDroppedFile", "None")); + if ((CVarGetInteger("gNewFileDropped", 0) != 0) || (CVarGetInteger("gNewSeedGenerated", 0) != 0) || + (!fileSelectSpoilerFileLoaded && SpoilerFileExists(CVarGetString("gSpoilerLog", "")))) { + if (CVarGetInteger("gNewFileDropped", 0) != 0) { + CVarSetString("gSpoilerLog", CVarGetString("gDroppedFile", "None")); } bool silent = true; - if ((CVar_GetS32("gNewFileDropped", 0) != 0) || (CVar_GetS32("gNewSeedGenerated", 0) != 0)) { + if ((CVarGetInteger("gNewFileDropped", 0) != 0) || (CVarGetInteger("gNewSeedGenerated", 0) != 0)) { silent = false; } - CVar_SetS32("gNewSeedGenerated", 0); - CVar_SetS32("gNewFileDropped", 0); - CVar_SetString("gDroppedFile", ""); + CVarSetInteger("gNewSeedGenerated", 0); + CVarSetInteger("gNewFileDropped", 0); + CVarSetString("gDroppedFile", ""); fileSelectSpoilerFileLoaded = false; - const char* fileLoc = CVar_GetString("gSpoilerLog", ""); + const char* fileLoc = CVarGetString("gSpoilerLog", ""); Randomizer_LoadSettings(fileLoc); Randomizer_LoadHintLocations(fileLoc); Randomizer_LoadRequiredTrials(fileLoc); @@ -475,7 +475,7 @@ void FileChoose_UpdateMainMenu(GameState* thisx) { static u8 emptyName[] = { 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E }; FileChooseContext* this = (FileChooseContext*)thisx; Input* input = &this->state.input[0]; - bool dpad = CVar_GetS32("gDpadText", 0); + bool dpad = CVarGetInteger("gDpadText", 0); FileChoose_UpdateRandomizer(); @@ -490,7 +490,7 @@ void FileChoose_UpdateMainMenu(GameState* thisx) { this->configMode = CM_ROTATE_TO_NAME_ENTRY; gSaveContext.isMasterQuest = MIN_QUEST == MASTER_QUEST; this->questType[this->buttonIndex] = MIN_QUEST; - CVar_SetS32("gOnFileSelectNameEntry", 1); + CVarSetInteger("gOnFileSelectNameEntry", 1); this->kbdButton = FS_KBD_BTN_NONE; this->charPage = FS_CHAR_PAGE_ENG; this->kbdX = 0; @@ -658,7 +658,7 @@ void FileChoose_UpdateQuestMenu(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; Input* input = &this->state.input[0]; s8 i = 0; - bool dpad = CVar_GetS32("gDpadText", 0);(dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP)); + bool dpad = CVarGetInteger("gDpadText", 0);(dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP)); FileChoose_UpdateRandomizer(); @@ -700,7 +700,7 @@ void FileChoose_UpdateQuestMenu(GameState* thisx) { this->prevConfigMode = this->configMode; this->configMode = CM_ROTATE_TO_NAME_ENTRY; this->logoAlpha = 0; - CVar_SetS32("gOnFileSelectNameEntry", 1); + CVarSetInteger("gOnFileSelectNameEntry", 1); this->kbdButton = FS_KBD_BTN_NONE; this->charPage = FS_CHAR_PAGE_ENG; this->kbdX = 0; @@ -1240,20 +1240,20 @@ void FileChoose_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) { s16 deathCountSplit[3]; Color_RGB8 heartColor = {HEARTS_PRIM_R, HEARTS_PRIM_G, HEARTS_PRIM_B}; - if (CVar_GetS32("gCosmetics.Consumable_Hearts.Changed", 0)) { - heartColor = CVar_GetRGB("gCosmetics.Consumable_Hearts.Value", heartColor); + if (CVarGetInteger("gCosmetics.Consumable_Hearts.Changed", 0)) { + heartColor = CVarGetColor24("gCosmetics.Consumable_Hearts.Value", heartColor); } Color_RGB8 heartBorder = {HEARTS_ENV_R, HEARTS_ENV_G, HEARTS_ENV_B}; - if (CVar_GetS32("gCosmetics.Consumable_HeartBorder.Changed", 0)) { - heartBorder = CVar_GetRGB("gCosmetics.Consumable_HeartBorder.Value", heartBorder); + if (CVarGetInteger("gCosmetics.Consumable_HeartBorder.Changed", 0)) { + heartBorder = CVarGetColor24("gCosmetics.Consumable_HeartBorder.Value", heartBorder); } Color_RGB8 ddColor = {HEARTS_DD_ENV_R, HEARTS_DD_ENV_G, HEARTS_DD_ENV_B}; - if (CVar_GetS32("gCosmetics.Consumable_DDHearts.Changed", 0)) { - ddColor = CVar_GetRGB("gCosmetics.Consumable_DDHearts.Value", ddColor); + if (CVarGetInteger("gCosmetics.Consumable_DDHearts.Changed", 0)) { + ddColor = CVarGetColor24("gCosmetics.Consumable_DDHearts.Value", ddColor); } Color_RGB8 ddBorder = {HEARTS_DD_PRIM_R, HEARTS_DD_PRIM_G, HEARTS_DD_PRIM_B}; - if (CVar_GetS32("gCosmetics.Consumable_DDHeartBorder.Changed", 0)) { - ddBorder = CVar_GetRGB("gCosmetics.Consumable_DDHeartBorder.Value", ddBorder); + if (CVarGetInteger("gCosmetics.Consumable_DDHeartBorder.Changed", 0)) { + ddBorder = CVarGetColor24("gCosmetics.Consumable_DDHeartBorder.Value", ddBorder); } OPEN_DISPS(this->state.gfxCtx); @@ -1936,7 +1936,7 @@ void FileChoose_FadeInFileInfo(GameState* thisx) { void FileChoose_ConfirmFile(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; Input* input = &this->state.input[0]; - bool dpad = CVar_GetS32("gDpadText", 0); + bool dpad = CVarGetInteger("gDpadText", 0); if (CHECK_BTN_ALL(input->press.button, BTN_START) || (CHECK_BTN_ALL(input->press.button, BTN_A))) { if (this->confirmButtonIndex == FS_BTN_CONFIRM_YES) { @@ -2055,7 +2055,7 @@ void FileChoose_LoadGame(GameState* thisx) { u16 swordEquipMask; s32 pad; - if ((this->buttonIndex == FS_BTN_SELECT_FILE_1 && CVar_GetS32("gDebugEnabled", 0)) || this->buttonIndex == 0xFF) { + if ((this->buttonIndex == FS_BTN_SELECT_FILE_1 && CVarGetInteger("gDebugEnabled", 0)) || this->buttonIndex == 0xFF) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); gSaveContext.fileNum = this->buttonIndex; if (this->buttonIndex == 0xFF) { @@ -2127,7 +2127,7 @@ void FileChoose_LoadGame(GameState* thisx) { gSaveContext.naviTimer = 0; // SWORDLESS LINK IS BACK BABY - if (CVar_GetS32("gSwordlessLink", 0) != 0) + if (CVarGetInteger("gSwordlessLink", 0) != 0) { if ((gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) && (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_MASTER) && @@ -2144,9 +2144,9 @@ void FileChoose_LoadGame(GameState* thisx) { // Handle randomized spawn positions after the save context has been setup from load // When remeber save location is on, set save warp if the save was in an a grotto, or // the entrance index is -1 from shuffle overwarld spawn - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES) && ((!CVar_GetS32("gRememberSaveLocation", 0) || + if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES) && ((!CVarGetInteger("gRememberSaveLocation", 0) || gSaveContext.savedSceneNum == SCENE_YOUSEI_IZUMI_TATE || gSaveContext.savedSceneNum == SCENE_KAKUSIANA) || - (CVar_GetS32("gRememberSaveLocation", 0) && Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_SPAWNS) && gSaveContext.entranceIndex == -1))) { + (CVarGetInteger("gRememberSaveLocation", 0) && Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_SPAWNS) && gSaveContext.entranceIndex == -1))) { Entrance_SetSavewarpEntrance(); } } @@ -2238,8 +2238,8 @@ void FileChoose_Main(GameState* thisx) { Input* input = &this->state.input[0]; Color_RGB8 helpTextColor = { 100, 255, 255 }; - if (CVar_GetS32("gCosmetics.Title_FileChoose.Changed", 0)) { - Color_RGB8 backgroundColor = CVar_GetRGB("gCosmetics.Title_FileChoose.Value", (Color_RGB8){ 100, 150, 255 }); + if (CVarGetInteger("gCosmetics.Title_FileChoose.Changed", 0)) { + Color_RGB8 backgroundColor = CVarGetColor24("gCosmetics.Title_FileChoose.Value", (Color_RGB8){ 100, 150, 255 }); this->windowColor[0] = backgroundColor.r; this->windowColor[1] = backgroundColor.g; this->windowColor[2] = backgroundColor.b; @@ -2264,19 +2264,19 @@ void FileChoose_Main(GameState* thisx) { sWindowContentColors[0][2] = 255; } - if (CVar_GetS32("gTimeFlowFileSelect", 0) != 0) { + if (CVarGetInteger("gTimeFlowFileSelect", 0) != 0) { gSaveContext.skyboxTime += 0x10; } - if (CVar_GetS32("gSkipLogoTitle", 0) && CVar_GetS32("gSaveFileID", 0) < 3 && !isFastFileIdIncompatible) { - if (Save_Exist(CVar_GetS32("gSaveFileID", 0)) && FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(CVar_GetS32("gSaveFileID", 0)))) { - this->buttonIndex = CVar_GetS32("gSaveFileID", 0); + if (CVarGetInteger("gSkipLogoTitle", 0) && CVarGetInteger("gSaveFileID", 0) < 3 && !isFastFileIdIncompatible) { + if (Save_Exist(CVarGetInteger("gSaveFileID", 0)) && FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(CVarGetInteger("gSaveFileID", 0)))) { + this->buttonIndex = CVarGetInteger("gSaveFileID", 0); this->menuMode = FS_MENU_MODE_SELECT; this->selectMode = SM_LOAD_GAME; } else { isFastFileIdIncompatible = 1; } - } else if (CVar_GetS32("gSkipLogoTitle", 0) && CVar_GetS32("gSaveFileID", 0) == 3) { + } else if (CVarGetInteger("gSkipLogoTitle", 0) && CVarGetInteger("gSaveFileID", 0) == 3) { this->buttonIndex = 0xFF; this->menuMode = FS_MENU_MODE_SELECT; this->selectMode = SM_LOAD_GAME; @@ -2293,7 +2293,7 @@ void FileChoose_Main(GameState* thisx) { this->stickRelX = input->rel.stick_x; this->stickRelY = input->rel.stick_y; - if (CVar_GetS32("gDpadHoldChange", 1) && CVar_GetS32("gDpadText", 0)) { + if (CVarGetInteger("gDpadHoldChange", 1) && CVarGetInteger("gDpadText", 0)) { if (CHECK_BTN_ALL(input->cur.button, BTN_DLEFT)) { if (CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { this->inputTimerX = 10; @@ -2631,7 +2631,7 @@ void FileChoose_Init(GameState* thisx) { this->questType[2] = MIN_QUEST; fileSelectSpoilerFileLoaded = false; isFastFileIdIncompatible = 0; - CVar_SetS32("gOnFileSelectNameEntry", 0); + CVarSetInteger("gOnFileSelectNameEntry", 0); SREG(30) = 1; osSyncPrintf("SIZE=%x\n", size); 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 8ca49b33a..77ca745f8 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 @@ -61,7 +61,7 @@ void FileChoose_SetupCopySource(GameState* thisx) { void FileChoose_SelectCopySource(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; Input* input = &this->state.input[0]; - bool dpad = CVar_GetS32("gDpadText", 0); + bool dpad = CVarGetInteger("gDpadText", 0); if (((this->buttonIndex == FS_BTN_COPY_QUIT) && CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) || CHECK_BTN_ALL(input->press.button, BTN_B)) { @@ -173,7 +173,7 @@ void FileChoose_SetupCopyDest2(GameState* thisx) { void FileChoose_SelectCopyDest(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; Input* input = &this->state.input[0]; - bool dpad = CVar_GetS32("gDpadText", 0); + bool dpad = CVarGetInteger("gDpadText", 0); if (((this->buttonIndex == FS_BTN_COPY_QUIT) && CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) || CHECK_BTN_ALL(input->press.button, BTN_B)) { @@ -357,7 +357,7 @@ void FileChoose_CopyConfirm(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; Input* input = &this->state.input[0]; u16 dayTime; - bool dpad = CVar_GetS32("gDpadText", 0); + bool dpad = CVarGetInteger("gDpadText", 0); if (((this->buttonIndex != FS_BTN_CONFIRM_YES) && CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) || CHECK_BTN_ALL(input->press.button, BTN_B)) { @@ -675,7 +675,7 @@ void FileChoose_SetupEraseSelect(GameState* thisx) { void FileChoose_EraseSelect(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; Input* input = &this->state.input[0]; - bool dpad = CVar_GetS32("gDpadText", 0); + bool dpad = CVarGetInteger("gDpadText", 0); if (((this->buttonIndex == FS_BTN_COPY_QUIT) && CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) || CHECK_BTN_ALL(input->press.button, BTN_B)) { @@ -812,7 +812,7 @@ void FileChoose_SetupEraseConfirm2(GameState* thisx) { void FileChoose_EraseConfirm(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; Input* input = &this->state.input[0]; - bool dpad = CVar_GetS32("gDpadText", 0); + bool dpad = CVarGetInteger("gDpadText", 0); if (((this->buttonIndex != FS_BTN_CONFIRM_YES) && CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) || CHECK_BTN_ALL(input->press.button, BTN_B)) { 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 fc2a952e9..999a62a91 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 @@ -373,7 +373,7 @@ void FileChoose_DrawNameEntry(GameState* thisx) { this->configMode = CM_NAME_ENTRY_TO_MAIN; } this->prevConfigMode = CM_NAME_ENTRY; - CVar_SetS32("gOnFileSelectNameEntry", 0); + CVarSetInteger("gOnFileSelectNameEntry", 0); } else { for (i = this->newFileNameCharCount; i < 7; i++) { filename[i] = filename[i + 1]; @@ -448,8 +448,8 @@ void FileChoose_DrawNameEntry(GameState* thisx) { gSaveContext.dayTime = dayTime; this->prevConfigMode = CM_MAIN_MENU; this->configMode = CM_NAME_ENTRY_TO_MAIN; - CVar_SetS32("gOnFileSelectNameEntry", 0); - CVar_SetS32("gNewFileDropped", 0); + CVarSetInteger("gOnFileSelectNameEntry", 0); + CVarSetInteger("gNewFileDropped", 0); this->nameBoxAlpha[this->buttonIndex] = this->nameAlpha[this->buttonIndex] = 200; this->connectorAlpha[this->buttonIndex] = 255; func_800AA000(300.0f, 0xB4, 0x14, 0x64); @@ -521,7 +521,7 @@ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; Input* input = &this->state.input[0]; s16 prevKbdX; - bool dpad = CVar_GetS32("gDpadText", 0); + bool dpad = CVarGetInteger("gDpadText", 0); this->kbdButton = 99; @@ -666,7 +666,7 @@ static u8 sSelectedSetting; void FileChoose_UpdateOptionsMenu(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; Input* input = &this->state.input[0]; - bool dpad = CVar_GetS32("gDpadText", 0); + bool dpad = CVarGetInteger("gDpadText", 0); if (CHECK_BTN_ALL(input->press.button, BTN_B)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); @@ -800,8 +800,8 @@ void FileChoose_DrawOptionsImpl(GameState* thisx) { { 0, 150, 150 }, }; - if (CVar_GetS32("gCosmetics.Title_FileChoose.Changed", 0)) { - Color_RGB8 backgroundColor = CVar_GetRGB("gCosmetics.Title_FileChoose.Value", (Color_RGB8){ 100, 150, 255 }); + if (CVarGetInteger("gCosmetics.Title_FileChoose.Changed", 0)) { + Color_RGB8 backgroundColor = CVarGetColor24("gCosmetics.Title_FileChoose.Value", (Color_RGB8){ 100, 150, 255 }); cursorPrimColors[1][0] = MIN(backgroundColor.r + 100, 255); cursorPrimColors[1][1] = MIN(backgroundColor.g + 100, 255); cursorPrimColors[1][2] = MIN(backgroundColor.b + 100, 255); diff --git a/soh/src/overlays/gamestates/ovl_select/z_select.c b/soh/src/overlays/gamestates/ovl_select/z_select.c index 082275c5f..f4e000876 100644 --- a/soh/src/overlays/gamestates/ovl_select/z_select.c +++ b/soh/src/overlays/gamestates/ovl_select/z_select.c @@ -4,7 +4,7 @@ * Description: Debug Scene Select Menu */ -#include "ultra64.h" +#include #include "global.h" #include "vt.h" #include "alloca.h" @@ -40,11 +40,11 @@ void Select_LoadGame(SelectContext* this, s32 entranceIndex) { Grotto_OverrideSpecialEntrance(Entrance_GetOverride(entranceIndex)); } - if (CVar_GetS32("gBetterDebugWarpScreen", 0)) { - CVar_SetS32("gBetterDebugWarpScreenCurrentScene", this->currentScene); - CVar_SetS32("gBetterDebugWarpScreenTopDisplayedScene", this->topDisplayedScene); - CVar_SetS32("gBetterDebugWarpScreenPageDownIndex", this->pageDownIndex); - CVar_Save(); + if (CVarGetInteger("gBetterDebugWarpScreen", 0)) { + CVarSetInteger("gBetterDebugWarpScreenCurrentScene", this->currentScene); + CVarSetInteger("gBetterDebugWarpScreenTopDisplayedScene", this->topDisplayedScene); + CVarSetInteger("gBetterDebugWarpScreenPageDownIndex", this->pageDownIndex); + CVarSave(); } gSaveContext.respawnFlag = 0; @@ -90,11 +90,11 @@ void Select_Grotto_LoadGame(SelectContext* this, s32 grottoIndex) { Grotto_OverrideSpecialEntrance(Entrance_GetOverride(grottoEntrance)); } - if (CVar_GetS32("gBetterDebugWarpScreen", 0)) { - CVar_SetS32("gBetterDebugWarpScreenCurrentScene", this->currentScene); - CVar_SetS32("gBetterDebugWarpScreenTopDisplayedScene", this->topDisplayedScene); - CVar_SetS32("gBetterDebugWarpScreenPageDownIndex", this->pageDownIndex); - CVar_Save(); + if (CVarGetInteger("gBetterDebugWarpScreen", 0)) { + CVarSetInteger("gBetterDebugWarpScreenCurrentScene", this->currentScene); + CVarSetInteger("gBetterDebugWarpScreenTopDisplayedScene", this->topDisplayedScene); + CVarSetInteger("gBetterDebugWarpScreenPageDownIndex", this->pageDownIndex); + CVarSave(); } gSaveContext.respawnFlag = 0; @@ -1227,7 +1227,7 @@ void Select_DrawMenu(SelectContext* this) { printer = alloca(sizeof(GfxPrint)); GfxPrint_Init(printer); GfxPrint_Open(printer, POLY_OPA_DISP); - if (CVar_GetS32("gBetterDebugWarpScreen", 0)) { + if (CVarGetInteger("gBetterDebugWarpScreen", 0)) { Better_Select_PrintMenu(this, printer); Better_Select_PrintAgeSetting(this, printer, ((void)0, gSaveContext.linkAge)); Better_Select_PrintTimeSetting(this, printer); @@ -1286,7 +1286,7 @@ void Select_Draw(SelectContext* this) { void Select_Main(GameState* thisx) { SelectContext* this = (SelectContext*)thisx; - if (CVar_GetS32("gBetterDebugWarpScreen", 0)) { + if (CVarGetInteger("gBetterDebugWarpScreen", 0)) { Better_Select_UpdateMenu(this); } else { Select_UpdateMenu(this); @@ -1321,7 +1321,7 @@ void Select_Init(GameState* thisx) { this->pageDownStops[6] = 91; // Escaping Ganon's Tower 3 this->pageDownIndex = 0; this->opt = 0; - this->count = CVar_GetS32("gBetterDebugWarpScreen", 0) ? ARRAY_COUNT(sBetterScenes) : ARRAY_COUNT(sScenes); + this->count = CVarGetInteger("gBetterDebugWarpScreen", 0) ? ARRAY_COUNT(sBetterScenes) : ARRAY_COUNT(sScenes); View_Init(&this->view, this->state.gfxCtx); this->view.flags = (0x08 | 0x02); this->verticalInputAccumulator = 0; @@ -1339,10 +1339,10 @@ void Select_Init(GameState* thisx) { this->topDisplayedScene = dREG(81); this->pageDownIndex = dREG(82); } - if (CVar_GetS32("gBetterDebugWarpScreen", 0)) { - this->currentScene = CVar_GetS32("gBetterDebugWarpScreenCurrentScene", 0); - this->topDisplayedScene = CVar_GetS32("gBetterDebugWarpScreenTopDisplayedScene", 0); - this->pageDownIndex = CVar_GetS32("gBetterDebugWarpScreenPageDownIndex", 0); + if (CVarGetInteger("gBetterDebugWarpScreen", 0)) { + this->currentScene = CVarGetInteger("gBetterDebugWarpScreenCurrentScene", 0); + this->topDisplayedScene = CVarGetInteger("gBetterDebugWarpScreenTopDisplayedScene", 0); + this->pageDownIndex = CVarGetInteger("gBetterDebugWarpScreenPageDownIndex", 0); } R_UPDATE_RATE = 1; #if !defined(_MSC_VER) && !defined(__GNUC__) diff --git a/soh/src/overlays/gamestates/ovl_title/z_title.c b/soh/src/overlays/gamestates/ovl_title/z_title.c index 6f3446b62..d30b6f693 100644 --- a/soh/src/overlays/gamestates/ovl_title/z_title.c +++ b/soh/src/overlays/gamestates/ovl_title/z_title.c @@ -195,7 +195,7 @@ void Title_Draw(TitleContext* this) { v1.z = 0; v2.z = 1119.0837; - char* n64LogoTex = ResourceMgr_LoadTexByName(nintendo_rogo_static_Tex_000000); + char* n64LogoTex = GetResourceDataByName(nintendo_rogo_static_Tex_000000, false); func_8002EABC(&v1, &v2, &v3, this->state.gfxCtx); gSPSetLights1(POLY_OPA_DISP++, sTitleLights); @@ -213,8 +213,8 @@ void Title_Draw(TitleContext* this) { gDPSetRenderMode(POLY_OPA_DISP++, G_RM_XLU_SURF2, G_RM_OPA_CI | CVG_DST_WRAP); gDPSetCombineLERP(POLY_OPA_DISP++, TEXEL1, PRIMITIVE, ENV_ALPHA, TEXEL0, 0, 0, 0, TEXEL0, PRIMITIVE, ENVIRONMENT, COMBINED, ENVIRONMENT, COMBINED, 0, PRIMITIVE, 0); - if (CVar_GetS32("gCosmetics.Title_NintendoLogo.Changed", 0)) { - Color_RGB8 nintendoLogoColor = CVar_GetRGB("gCosmetics.Title_NintendoLogo.Value", (Color_RGB8){0, 0, 255}); + if (CVarGetInteger("gCosmetics.Title_NintendoLogo.Changed", 0)) { + Color_RGB8 nintendoLogoColor = CVarGetColor24("gCosmetics.Title_NintendoLogo.Value", (Color_RGB8){0, 0, 255}); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(POLY_OPA_DISP++, nintendoLogoColor.r, nintendoLogoColor.g, nintendoLogoColor.b, 128); } else { @@ -236,7 +236,7 @@ void Title_Draw(TitleContext* this) { } // Draw ice cube around N64 logo. - if (CVar_GetS32("gLetItSnow", 0)) { + if (CVarGetInteger("gLetItSnow", 0)) { f32 scale = 0.4f; gSPSegment(POLY_OPA_DISP++, 0x08, @@ -253,7 +253,7 @@ void Title_Draw(TitleContext* this) { Environment_FillScreen(this->state.gfxCtx, 0, 0, 0, (s16)this->coverAlpha, FILL_SCREEN_XLU); - sTitleRotY += (300 * CVar_GetFloat("gCosmetics.N64Logo_SpinSpeed", 1.0f)); + sTitleRotY += (300 * CVarGetFloat("gCosmetics.N64Logo_SpinSpeed", 1.0f)); CLOSE_DISPS(this->state.gfxCtx); } @@ -269,7 +269,7 @@ void Title_Main(GameState* thisx) { Title_Calc(this); Title_Draw(this); - if (!CVar_GetS32("gHideBuildInfo", 0)) { + if (!CVarGetInteger("gHideBuildInfo", 0)) { Gfx* gfx = POLY_OPA_DISP; s32 pad; @@ -277,13 +277,13 @@ void Title_Main(GameState* thisx) { POLY_OPA_DISP = gfx; } - if (this->exit || CVar_GetS32("gSkipLogoTitle", 0)) { + if (this->exit || CVarGetInteger("gSkipLogoTitle", 0)) { gSaveContext.seqId = (u8)NA_BGM_DISABLED; gSaveContext.natureAmbienceId = 0xFF; gSaveContext.gameMode = 1; this->state.running = false; - if (gLoadFileSelect || CVar_GetS32("gSkipLogoTitle", 0)) + if (gLoadFileSelect || CVarGetInteger("gSkipLogoTitle", 0)) SET_NEXT_GAMESTATE(&this->state, FileChoose_Init, FileChooseContext); else SET_NEXT_GAMESTATE(&this->state, Opening_Init, OpeningContext); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c index eaef5ca62..99888adcc 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -6,31 +6,31 @@ extern const char* digitTextures[]; void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { Color_RGB8 aButtonColor = { 80, 150, 255 }; - if (CVar_GetS32("gCosmetics.Hud_AButton.Changed", 0)) { - aButtonColor = CVar_GetRGB("gCosmetics.Hud_AButton.Value", aButtonColor); - } else if (CVar_GetS32("gCosmetics.DefaultColorScheme", 0)) { + if (CVarGetInteger("gCosmetics.Hud_AButton.Changed", 0)) { + aButtonColor = CVarGetColor24("gCosmetics.Hud_AButton.Value", aButtonColor); + } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", 0)) { aButtonColor = (Color_RGB8){ 80, 255, 150 }; } Color_RGB8 cButtonsColor = {255, 255, 50}; - if (CVar_GetS32("gCosmetics.Hud_CButtons.Changed", 0)) { - cButtonsColor = CVar_GetRGB("gCosmetics.Hud_CButtons.Value", cButtonsColor); + if (CVarGetInteger("gCosmetics.Hud_CButtons.Changed", 0)) { + cButtonsColor = CVarGetColor24("gCosmetics.Hud_CButtons.Value", cButtonsColor); } Color_RGB8 cUpButtonColor = cButtonsColor; - if (CVar_GetS32("gCosmetics.Hud_CUpButton.Changed", 0)) { - cUpButtonColor = CVar_GetRGB("gCosmetics.Hud_CUpButton.Value", cUpButtonColor); + if (CVarGetInteger("gCosmetics.Hud_CUpButton.Changed", 0)) { + cUpButtonColor = CVarGetColor24("gCosmetics.Hud_CUpButton.Value", cUpButtonColor); } Color_RGB8 cDownButtonColor = cButtonsColor; - if (CVar_GetS32("gCosmetics.Hud_CDownButton.Changed", 0)) { - cDownButtonColor = CVar_GetRGB("gCosmetics.Hud_CDownButton.Value", cDownButtonColor); + if (CVarGetInteger("gCosmetics.Hud_CDownButton.Changed", 0)) { + cDownButtonColor = CVarGetColor24("gCosmetics.Hud_CDownButton.Value", cDownButtonColor); } Color_RGB8 cLeftButtonColor = cButtonsColor; - if (CVar_GetS32("gCosmetics.Hud_CLeftButton.Changed", 0)) { - cLeftButtonColor = CVar_GetRGB("gCosmetics.Hud_CLeftButton.Value", cLeftButtonColor); + if (CVarGetInteger("gCosmetics.Hud_CLeftButton.Changed", 0)) { + cLeftButtonColor = CVarGetColor24("gCosmetics.Hud_CLeftButton.Value", cLeftButtonColor); } Color_RGB8 cRightButtonColor = cButtonsColor; - if (CVar_GetS32("gCosmetics.Hud_CRightButton.Changed", 0)) { - cRightButtonColor = CVar_GetRGB("gCosmetics.Hud_CRightButton.Value", cRightButtonColor); + if (CVarGetInteger("gCosmetics.Hud_CRightButton.Changed", 0)) { + cRightButtonColor = CVarGetColor24("gCosmetics.Hud_CRightButton.Value", cRightButtonColor); } static s16 D_8082A070[][4] = { @@ -102,7 +102,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { s16 pad2; s16 phi_s0_2; s16 sp208[3]; - bool dpad = CVar_GetS32("gDpadPause", 0); + bool dpad = CVarGetInteger("gDpadPause", 0); OPEN_DISPS(gfxCtx); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c index a160576d9..5b55f4144 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_debug.c @@ -641,7 +641,7 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) { // Handles exiting the inventory editor with the L button // The editor is opened with `debugState` set to 1, and becomes closable after a frame once `debugState` is set to 2 s16 Debug_BTN = BTN_L; - if (CVar_GetS32("gNGCKaleidoSwitcher", 0) != 0) { + if (CVarGetInteger("gNGCKaleidoSwitcher", 0) != 0) { Debug_BTN = BTN_Z; } if (pauseCtx->debugState == 1) { diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 34ac13afa..208ad5a67 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -97,10 +97,10 @@ void KaleidoScope_DrawPlayerWork(PlayState* play) { //Vec3s rot; // Removed for not having it use din the function f32 scale; Input* input = &play->state.input[0]; - s16 RotationSpeed = 150 * CVar_GetS32("gPauseLiveLinkRotationSpeed", 0); - u8 AllowStickRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 3) ? true : false; - u8 AllowCRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 2) ? true : false; - u8 AllowDPadRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 1) ? true : false; + s16 RotationSpeed = 150 * CVarGetInteger("gPauseLiveLinkRotationSpeed", 0); + u8 AllowStickRotation = (CVarGetInteger("gPauseLiveLinkRotation", 0) == 3) ? true : false; + u8 AllowCRotation = (CVarGetInteger("gPauseLiveLinkRotation", 0) == 2) ? true : false; + u8 AllowDPadRotation = (CVarGetInteger("gPauseLiveLinkRotation", 0) == 1) ? true : false; if (LINK_AGE_IN_YEARS == YEARS_CHILD) { @@ -108,7 +108,7 @@ void KaleidoScope_DrawPlayerWork(PlayState* play) { pos.y = -130.0f; pos.z = -150.0f; scale = 0.046f; - } else if (CUR_EQUIP_VALUE(EQUIP_SWORD) != 2 && !CVar_GetS32("gPauseTriforce", 0)) { + } else if (CUR_EQUIP_VALUE(EQUIP_SWORD) != 2 && !CVarGetInteger("gPauseTriforce", 0)) { pos.x = 25.0f; pos.y = -228.0f; pos.z = 60.0f; @@ -176,7 +176,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { s16 cursorX; s16 cursorY; s16 oldCursorPoint; - bool dpad = (CVar_GetS32("gDpadPause", 0) && !CHECK_BTN_ALL(input->cur.button, BTN_CUP)); + bool dpad = (CVarGetInteger("gDpadPause", 0) && !CHECK_BTN_ALL(input->cur.button, BTN_CUP)); OPEN_DISPS(play->state.gfxCtx); @@ -226,7 +226,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { cursorMoveResult = 1; } } - } else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & gSaveContext.inventory.equipment) || CVar_GetS32("gPauseAnyCursor", 0)) { + } else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & gSaveContext.inventory.equipment) || CVarGetInteger("gPauseAnyCursor", 0)) { cursorMoveResult = 2; } } else { @@ -260,7 +260,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { if (CUR_UPG_VALUE(pauseCtx->cursorY[PAUSE_EQUIP]) != 0) { cursorMoveResult = 1; } - } else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & gSaveContext.inventory.equipment) || CVar_GetS32("gPauseAnyCursor", 0)) { + } else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & gSaveContext.inventory.equipment) || CVarGetInteger("gPauseAnyCursor", 0)) { cursorMoveResult = 2; } } else { @@ -311,7 +311,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { cursorMoveResult = 1; } } else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & - gSaveContext.inventory.equipment) || CVar_GetS32("gPauseAnyCursor", 0)) { + gSaveContext.inventory.equipment) || CVarGetInteger("gPauseAnyCursor", 0)) { cursorMoveResult = 2; } } else { @@ -329,7 +329,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { cursorMoveResult = 1; } } else if ((gBitFlags[pauseCtx->cursorPoint[PAUSE_EQUIP] - 1] & - gSaveContext.inventory.equipment) || CVar_GetS32("gPauseAnyCursor", 0)) { + gSaveContext.inventory.equipment) || CVarGetInteger("gPauseAnyCursor", 0)) { cursorMoveResult = 2; } } else { @@ -501,7 +501,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { KaleidoScope_SetCursorVtx(pauseCtx, cursorSlot * 4, pauseCtx->equipVtx); u16 buttonsToCheck = BTN_A | BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT; - if (CVar_GetS32("gDpadEquips", 0) && (!CVar_GetS32("gDpadPause", 0) || CHECK_BTN_ALL(input->cur.button, BTN_CUP))) { + if (CVarGetInteger("gDpadEquips", 0) && (!CVarGetInteger("gDpadPause", 0) || CHECK_BTN_ALL(input->cur.button, BTN_CUP))) { buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT; } @@ -517,7 +517,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { // Only BGS/Giant's Knife is affected, and it will revert to Master Sword. // If we have the feature toggled on - if (CVar_GetS32("gEquipmentCanBeRemoved", 0)) { + if (CVarGetInteger("gEquipmentCanBeRemoved", 0)) { // If we're on the "swords" section of the equipment screen AND we're on a currently-equipped BGS/Giant's Knife if (pauseCtx->cursorY[PAUSE_EQUIP] == 0 && pauseCtx->cursorX[PAUSE_EQUIP] == 3 @@ -577,7 +577,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); pauseCtx->unk_1E4 = 7; sEquipTimer = 10; - } else if (CVar_GetS32("gAssignableTunicsAndBoots", 0) != 0) { + } else if (CVarGetInteger("gAssignableTunicsAndBoots", 0) != 0) { // Only allow assigning tunic and boots to c-buttons if (pauseCtx->cursorY[PAUSE_EQUIP] > 1) { if (CHECK_OWNED_EQUIP(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP] - 1)) { @@ -617,7 +617,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { EQUIP_FAIL: if (CHECK_BTN_ALL(input->press.button, BTN_A)) { Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - } else if ((CVar_GetS32("gAssignableTunicsAndBoots", 0) != 0) && (pauseCtx->cursorY[PAUSE_EQUIP] > 1)) { + } else if ((CVarGetInteger("gAssignableTunicsAndBoots", 0) != 0) && (pauseCtx->cursorY[PAUSE_EQUIP] > 1)) { Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } } @@ -664,7 +664,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { for (rowStart = 0, j = 0, temp = 0, i = 0; i < 4; i++, rowStart += 4, j += 16) { gSPVertex(POLY_KAL_DISP++, &pauseCtx->equipVtx[j], 16, 0); - bool drawGreyItems = !CVar_GetS32("gTimelessEquipment", 0); + bool drawGreyItems = !CVarGetInteger("gTimelessEquipment", 0); if (LINK_AGE_IN_YEARS == YEARS_CHILD) { point = CUR_UPG_VALUE(sChildUpgrades[i]); if ((point != 0) && (CUR_UPG_VALUE(sChildUpgrades[i]) != 0)) { 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 607afb979..b9b17a067 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 @@ -100,7 +100,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { s16 cursorY; s16 oldCursorPoint; s16 moveCursorResult; - bool dpad = (CVar_GetS32("gDpadPause", 0) && !CHECK_BTN_ALL(input->cur.button, BTN_CUP)); + bool dpad = (CVarGetInteger("gDpadPause", 0) && !CHECK_BTN_ALL(input->cur.button, BTN_CUP)); OPEN_DISPS(play->state.gfxCtx); @@ -142,7 +142,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { pauseCtx->cursorX[PAUSE_ITEM] -= 1; pauseCtx->cursorPoint[PAUSE_ITEM] -= 1; if ((gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) || - CVar_GetS32("gPauseAnyCursor", 0)) { + CVarGetInteger("gPauseAnyCursor", 0)) { moveCursorResult = 1; } } else { @@ -174,7 +174,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { pauseCtx->cursorX[PAUSE_ITEM] += 1; pauseCtx->cursorPoint[PAUSE_ITEM] += 1; if ((gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) || - CVar_GetS32("gPauseAnyCursor", 0)) { + CVarGetInteger("gPauseAnyCursor", 0)) { moveCursorResult = 1; } } else { @@ -296,7 +296,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { pauseCtx->cursorY[PAUSE_ITEM] -= 1; pauseCtx->cursorPoint[PAUSE_ITEM] -= 6; if ((gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) || - CVar_GetS32("gPauseAnyCursor", 0)) { + CVarGetInteger("gPauseAnyCursor", 0)) { moveCursorResult = 1; } } else { @@ -310,7 +310,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { pauseCtx->cursorY[PAUSE_ITEM] += 1; pauseCtx->cursorPoint[PAUSE_ITEM] += 6; if ((gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) || - CVar_GetS32("gPauseAnyCursor", 0)) { + CVarGetInteger("gPauseAnyCursor", 0)) { moveCursorResult = 1; } } else { @@ -343,7 +343,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { pauseCtx->cursorSlot[PAUSE_ITEM] = cursorSlot; gSlotAgeReqs[SLOT_TRADE_CHILD] = gItemAgeReqs[ITEM_MASK_BUNNY] = - ((CVar_GetS32("gMMBunnyHood", 0) || CVar_GetS32("gTimelessEquipment", 0)) && + ((CVarGetInteger("gMMBunnyHood", 0) || CVarGetInteger("gTimelessEquipment", 0)) && INV_CONTENT(ITEM_TRADE_CHILD) == ITEM_MASK_BUNNY) ? 9 : 1; @@ -362,7 +362,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { // * zelda's letter check: gSaveContext.eventChkInf[4] & 1 // * kak gate check: gSaveContext.infTable[7] & 0x40 // and the mask quest is complete: gSaveContext.eventChkInf[8] & 0x8000 - if (CVar_GetS32("gMaskSelect", 0) && + if (CVarGetInteger("gMaskSelect", 0) && (gSaveContext.eventChkInf[8] & 0x8000) && cursorSlot == SLOT_TRADE_CHILD && CHECK_BTN_ALL(input->press.button, BTN_A) && (gSaveContext.eventChkInf[4] & 1) && @@ -394,7 +394,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { } for (uint16_t cSlotIndex = 0; cSlotIndex < ARRAY_COUNT(gSaveContext.equips.cButtonSlots); cSlotIndex++) { if (gSaveContext.equips.cButtonSlots[cSlotIndex] == SLOT_TRADE_CHILD) { - if (!LINK_IS_ADULT || CVar_GetS32("gTimelessEquipment", 0)) { + if (!LINK_IS_ADULT || CVarGetInteger("gTimelessEquipment", 0)) { gSaveContext.equips.buttonItems[cSlotIndex+1] = INV_CONTENT(ITEM_TRADE_CHILD); } else if (INV_CONTENT(ITEM_TRADE_CHILD) != gSaveContext.equips.buttonItems[cSlotIndex+1]) { gSaveContext.equips.cButtonSlots[cSlotIndex] = SLOT_NONE; @@ -423,7 +423,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { gSelectingAdultTrade = cursorSlot == SLOT_TRADE_ADULT; } u16 buttonsToCheck = BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT; - if (CVar_GetS32("gDpadEquips", 0) && (!CVar_GetS32("gDpadPause", 0) || CHECK_BTN_ALL(input->cur.button, BTN_CUP))) { + if (CVarGetInteger("gDpadEquips", 0) && (!CVarGetInteger("gDpadPause", 0) || CHECK_BTN_ALL(input->cur.button, BTN_CUP))) { buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT; } if (CHECK_BTN_ANY(input->press.button, buttonsToCheck)) { @@ -554,7 +554,7 @@ void KaleidoScope_SetupItemEquip(PlayState* play, u16 item, u16 slot, s16 animX, pauseCtx->equipTargetCBtn = 1; } else if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) { pauseCtx->equipTargetCBtn = 2; - } else if (CVar_GetS32("gDpadEquips", 0)) { + } else if (CVarGetInteger("gDpadEquips", 0)) { if (CHECK_BTN_ALL(input->press.button, BTN_DUP)) { pauseCtx->equipTargetCBtn = 3; } else if (CHECK_BTN_ALL(input->press.button, BTN_DDOWN)) { @@ -577,7 +577,7 @@ void KaleidoScope_SetupItemEquip(PlayState* play, u16 item, u16 slot, s16 animX, sEquipMoveTimer = 10; if ((pauseCtx->equipTargetItem == ITEM_ARROW_FIRE) || (pauseCtx->equipTargetItem == ITEM_ARROW_ICE) || (pauseCtx->equipTargetItem == ITEM_ARROW_LIGHT)) { - if (CVar_GetS32("gSkipArrowAnimation", 0)) { + if (CVarGetInteger("gSkipArrowAnimation", 0)) { Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } else { u16 index = 0; @@ -609,10 +609,10 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { u16 offsetX; u16 offsetY; - s16 Top_HUD_Margin = CVar_GetS32("gHUDMargin_T", 0); - s16 Left_HUD_Margin = CVar_GetS32("gHUDMargin_L", 0); - s16 Right_HUD_Margin = CVar_GetS32("gHUDMargin_R", 0); - s16 Bottom_HUD_Margin = CVar_GetS32("gHUDMargin_B", 0); + s16 Top_HUD_Margin = CVarGetInteger("gHUDMargin_T", 0); + s16 Left_HUD_Margin = CVarGetInteger("gHUDMargin_L", 0); + s16 Right_HUD_Margin = CVarGetInteger("gHUDMargin_R", 0); + s16 Bottom_HUD_Margin = CVarGetInteger("gHUDMargin_B", 0); s16 X_Margins_CL; s16 X_Margins_CR; @@ -624,36 +624,36 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { s16 Y_Margins_BtnB; s16 X_Margins_DPad_Items; s16 Y_Margins_DPad_Items; - if (CVar_GetS32("gBBtnUseMargins", 0) != 0) { - if (CVar_GetS32("gBBtnPosType", 0) == 0) {X_Margins_BtnB = Right_HUD_Margin;}; + if (CVarGetInteger("gBBtnUseMargins", 0) != 0) { + if (CVarGetInteger("gBBtnPosType", 0) == 0) {X_Margins_BtnB = Right_HUD_Margin;}; Y_Margins_BtnB = (Top_HUD_Margin*-1); } else { X_Margins_BtnB = 0; Y_Margins_BtnB = 0; } - if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) { - if (CVar_GetS32("gCBtnLPosType", 0) == 0) {X_Margins_CL = Right_HUD_Margin;}; + if (CVarGetInteger("gCBtnLUseMargins", 0) != 0) { + if (CVarGetInteger("gCBtnLPosType", 0) == 0) {X_Margins_CL = Right_HUD_Margin;}; Y_Margins_CL = (Top_HUD_Margin*-1); } else { X_Margins_CL = 0; Y_Margins_CL = 0; } - if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) { - if (CVar_GetS32("gCBtnRPosType", 0) == 0) {X_Margins_CR = Right_HUD_Margin;}; + if (CVarGetInteger("gCBtnRUseMargins", 0) != 0) { + if (CVarGetInteger("gCBtnRPosType", 0) == 0) {X_Margins_CR = Right_HUD_Margin;}; Y_Margins_CR = (Top_HUD_Margin*-1); } else { X_Margins_CR = 0; Y_Margins_CR = 0; } - if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) { - if (CVar_GetS32("gCBtnDPosType", 0) == 0) {X_Margins_CD = Right_HUD_Margin;}; + if (CVarGetInteger("gCBtnDUseMargins", 0) != 0) { + if (CVarGetInteger("gCBtnDPosType", 0) == 0) {X_Margins_CD = Right_HUD_Margin;}; Y_Margins_CD = (Top_HUD_Margin*-1); } else { X_Margins_CD = 0; Y_Margins_CD = 0; } - if (CVar_GetS32("gDPadUseMargins", 0) != 0) { - if (CVar_GetS32("gDPadPosType", 0) == 0) {X_Margins_DPad_Items = Right_HUD_Margin;}; + if (CVarGetInteger("gDPadUseMargins", 0) != 0) { + if (CVarGetInteger("gDPadPosType", 0) == 0) {X_Margins_DPad_Items = Right_HUD_Margin;}; Y_Margins_DPad_Items = (Top_HUD_Margin*-1); } else { X_Margins_DPad_Items = 0; @@ -676,28 +676,28 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { }; //(X,Y) Used with custom position to place it properly. //DPadItems - if (CVar_GetS32("gDPadPosType", 0) != 0) { - sCButtonPosY[3] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[0][1];//Up - sCButtonPosY[4] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[1][1];//Down - sCButtonPosY[5] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[2][1];//Left - sCButtonPosY[6] = CVar_GetS32("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[3][1];//Right - if (CVar_GetS32("gDPadPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gDPadUseMargins", 0) != 0) {X_Margins_DPad_Items = Left_HUD_Margin;}; - sCButtonPosX[3] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[0][0]); - sCButtonPosX[4] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[1][0]); - sCButtonPosX[5] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[2][0]); - sCButtonPosX[6] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[3][0]); - } else if (CVar_GetS32("gDPadPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gDPadUseMargins", 0) != 0) {X_Margins_DPad_Items = Right_HUD_Margin;}; - sCButtonPosX[3] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[0][0]); - sCButtonPosX[4] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[1][0]); - sCButtonPosX[5] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[2][0]); - sCButtonPosX[6] = OTRGetDimensionFromRightEdge(CVar_GetS32("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[3][0]); - } else if (CVar_GetS32("gDPadPosType", 0) == 3) {//Anchor None - sCButtonPosX[3] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[0][0]; - sCButtonPosX[4] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[1][0]; - sCButtonPosX[5] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[2][0]; - sCButtonPosX[6] = CVar_GetS32("gDPadPosX", 0)+DPad_ItemsOffset[3][0]; + if (CVarGetInteger("gDPadPosType", 0) != 0) { + sCButtonPosY[3] = CVarGetInteger("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[0][1];//Up + sCButtonPosY[4] = CVarGetInteger("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[1][1];//Down + sCButtonPosY[5] = CVarGetInteger("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[2][1];//Left + sCButtonPosY[6] = CVarGetInteger("gDPadPosY", 0)+Y_Margins_DPad_Items+DPad_ItemsOffset[3][1];//Right + if (CVarGetInteger("gDPadPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gDPadUseMargins", 0) != 0) {X_Margins_DPad_Items = Left_HUD_Margin;}; + sCButtonPosX[3] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[0][0]); + sCButtonPosX[4] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[1][0]); + sCButtonPosX[5] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[2][0]); + sCButtonPosX[6] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[3][0]); + } else if (CVarGetInteger("gDPadPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gDPadUseMargins", 0) != 0) {X_Margins_DPad_Items = Right_HUD_Margin;}; + sCButtonPosX[3] = OTRGetDimensionFromRightEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[0][0]); + sCButtonPosX[4] = OTRGetDimensionFromRightEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[1][0]); + sCButtonPosX[5] = OTRGetDimensionFromRightEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[2][0]); + sCButtonPosX[6] = OTRGetDimensionFromRightEdge(CVarGetInteger("gDPadPosX", 0)+X_Margins_DPad_Items+DPad_ItemsOffset[3][0]); + } else if (CVarGetInteger("gDPadPosType", 0) == 3) {//Anchor None + sCButtonPosX[3] = CVarGetInteger("gDPadPosX", 0)+DPad_ItemsOffset[0][0]; + sCButtonPosX[4] = CVarGetInteger("gDPadPosX", 0)+DPad_ItemsOffset[1][0]; + sCButtonPosX[5] = CVarGetInteger("gDPadPosX", 0)+DPad_ItemsOffset[2][0]; + sCButtonPosX[6] = CVarGetInteger("gDPadPosX", 0)+DPad_ItemsOffset[3][0]; } } else { sCButtonPosX[3] = OTRGetDimensionFromRightEdge(ItemIconPos_ori[3][0]); @@ -710,48 +710,48 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { sCButtonPosY[6] = ItemIconPos_ori[6][1]; } //C button Left - if (CVar_GetS32("gCBtnLPosType", 0) != 0) { - sCButtonPosY[0] = CVar_GetS32("gCBtnLPosY", 0)+Y_Margins_CL; - if (CVar_GetS32("gCBtnLPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Left_HUD_Margin;}; - sCButtonPosX[0] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL); - } else if (CVar_GetS32("gCBtnLPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Right_HUD_Margin;}; - sCButtonPosX[0] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnLPosX", 0)+X_Margins_CL); - } else if (CVar_GetS32("gCBtnLPosType", 0) == 3) {//Anchor None - sCButtonPosX[0] = CVar_GetS32("gCBtnLPosX", 0); + if (CVarGetInteger("gCBtnLPosType", 0) != 0) { + sCButtonPosY[0] = CVarGetInteger("gCBtnLPosY", 0)+Y_Margins_CL; + if (CVarGetInteger("gCBtnLPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Left_HUD_Margin;}; + sCButtonPosX[0] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCBtnLPosX", 0)+X_Margins_CL); + } else if (CVarGetInteger("gCBtnLPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCBtnLUseMargins", 0) != 0) {X_Margins_CL = Right_HUD_Margin;}; + sCButtonPosX[0] = OTRGetDimensionFromRightEdge(CVarGetInteger("gCBtnLPosX", 0)+X_Margins_CL); + } else if (CVarGetInteger("gCBtnLPosType", 0) == 3) {//Anchor None + sCButtonPosX[0] = CVarGetInteger("gCBtnLPosX", 0); } } else { sCButtonPosX[0] = OTRGetRectDimensionFromRightEdge(ItemIconPos_ori[0][0]); sCButtonPosY[0] = ItemIconPos_ori[0][1]; } //C Button down - if (CVar_GetS32("gCBtnDPosType", 0) != 0) { - sCButtonPosY[1] = CVar_GetS32("gCBtnDPosY", 0)+Y_Margins_CD; - if (CVar_GetS32("gCBtnDPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Left_HUD_Margin;}; - sCButtonPosX[1] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD); - } else if (CVar_GetS32("gCBtnDPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Right_HUD_Margin;}; - sCButtonPosX[1] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnDPosX", 0)+X_Margins_CD); - } else if (CVar_GetS32("gCBtnDPosType", 0) == 3) {//Anchor None - sCButtonPosX[1] = CVar_GetS32("gCBtnDPosX", 0); + if (CVarGetInteger("gCBtnDPosType", 0) != 0) { + sCButtonPosY[1] = CVarGetInteger("gCBtnDPosY", 0)+Y_Margins_CD; + if (CVarGetInteger("gCBtnDPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Left_HUD_Margin;}; + sCButtonPosX[1] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCBtnDPosX", 0)+X_Margins_CD); + } else if (CVarGetInteger("gCBtnDPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCBtnDUseMargins", 0) != 0) {X_Margins_CD = Right_HUD_Margin;}; + sCButtonPosX[1] = OTRGetDimensionFromRightEdge(CVarGetInteger("gCBtnDPosX", 0)+X_Margins_CD); + } else if (CVarGetInteger("gCBtnDPosType", 0) == 3) {//Anchor None + sCButtonPosX[1] = CVarGetInteger("gCBtnDPosX", 0); } } else { sCButtonPosX[1] = OTRGetRectDimensionFromRightEdge(ItemIconPos_ori[1][0]); sCButtonPosY[1] = ItemIconPos_ori[1][1]; } //C button Right - if (CVar_GetS32("gCBtnRPosType", 0) != 0) { - sCButtonPosY[2] = CVar_GetS32("gCBtnRPosY", 0)+Y_Margins_CR; - if (CVar_GetS32("gCBtnRPosType", 0) == 1) {//Anchor Left - if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Left_HUD_Margin;}; - sCButtonPosX[2] = OTRGetDimensionFromLeftEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR); - } else if (CVar_GetS32("gCBtnRPosType", 0) == 2) {//Anchor Right - if (CVar_GetS32("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Right_HUD_Margin;}; - sCButtonPosX[2] = OTRGetDimensionFromRightEdge(CVar_GetS32("gCBtnRPosX", 0)+X_Margins_CR); - } else if (CVar_GetS32("gCBtnRPosType", 0) == 3) {//Anchor None - sCButtonPosX[2] = CVar_GetS32("gCBtnRPosX", 0); + if (CVarGetInteger("gCBtnRPosType", 0) != 0) { + sCButtonPosY[2] = CVarGetInteger("gCBtnRPosY", 0)+Y_Margins_CR; + if (CVarGetInteger("gCBtnRPosType", 0) == 1) {//Anchor Left + if (CVarGetInteger("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Left_HUD_Margin;}; + sCButtonPosX[2] = OTRGetDimensionFromLeftEdge(CVarGetInteger("gCBtnRPosX", 0)+X_Margins_CR); + } else if (CVarGetInteger("gCBtnRPosType", 0) == 2) {//Anchor Right + if (CVarGetInteger("gCBtnRUseMargins", 0) != 0) {X_Margins_CR = Right_HUD_Margin;}; + sCButtonPosX[2] = OTRGetDimensionFromRightEdge(CVarGetInteger("gCBtnRPosX", 0)+X_Margins_CR); + } else if (CVarGetInteger("gCBtnRPosType", 0) == 3) {//Anchor None + sCButtonPosX[2] = CVarGetInteger("gCBtnRPosX", 0); } } else { sCButtonPosX[2] = OTRGetRectDimensionFromRightEdge(ItemIconPos_ori[2][0]); @@ -788,7 +788,7 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { if (D_8082A488 == 0) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; - if (!CVar_GetS32("gSeparateArrows", 0)) { + if (!CVarGetInteger("gSeparateArrows", 0)) { pauseCtx->equipTargetSlot = SLOT_BOW; } sEquipMoveTimer = 6; @@ -874,7 +874,7 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { pauseCtx->equipTargetItem = ITEM_BOW_ARROW_LIGHT; break; } - if (!CVar_GetS32("gSeparateArrows", 0)) { + if (!CVarGetInteger("gSeparateArrows", 0)) { pauseCtx->equipTargetSlot = SLOT_BOW; } } diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c index 1e0cdfaad..db487b3fc 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c @@ -52,7 +52,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) { s16 stepG; s16 stepB; u16 rgba16; - bool dpad = CVar_GetS32("gDpadPause", 0); + bool dpad = CVarGetInteger("gDpadPause", 0); OPEN_DISPS(gfxCtx); @@ -419,7 +419,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { s16 stepR; s16 stepG; s16 stepB; - bool dpad = CVar_GetS32("gDpadPause", 0); + bool dpad = CVarGetInteger("gDpadPause", 0); OPEN_DISPS(gfxCtx); @@ -513,7 +513,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { gSPVertex(POLY_KAL_DISP++, &pauseCtx->mapPageVtx[188], 32, 0); for (j = t = i = 0; i < 8; i++, t++, j += 4) { - gDPLoadTextureBlock(POLY_KAL_DISP++, (u8*)ResourceMgr_LoadTexByName(gWorldMapImageTex) + t * 216 * 9, G_IM_FMT_CI, G_IM_SIZ_8b, 216, 9, + gDPLoadTextureBlock(POLY_KAL_DISP++, (u8*)GetResourceDataByName(gWorldMapImageTex, false) + t * 216 * 9, G_IM_FMT_CI, G_IM_SIZ_8b, 216, 9, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); @@ -524,14 +524,14 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) { for (j = i = 0; i < 6; i++, t++, j += 4) { - gDPLoadTextureBlock(POLY_KAL_DISP++, (u8*)ResourceMgr_LoadTexByName(gWorldMapImageTex) + t * 216 * 9, G_IM_FMT_CI, G_IM_SIZ_8b, 216, 9, + gDPLoadTextureBlock(POLY_KAL_DISP++, (u8*)GetResourceDataByName(gWorldMapImageTex, false) + t * 216 * 9, G_IM_FMT_CI, G_IM_SIZ_8b, 216, 9, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_KAL_DISP++, j, j + 2, j + 3, j + 1, 0); } - gDPLoadTextureBlock(POLY_KAL_DISP++, (u8*)ResourceMgr_LoadTexByName(gWorldMapImageTex) + t * 216 * 9, G_IM_FMT_CI, G_IM_SIZ_8b, 216, 2, 0, + gDPLoadTextureBlock(POLY_KAL_DISP++, (u8*)GetResourceDataByName(gWorldMapImageTex, false) + t * 216 * 9, G_IM_FMT_CI, G_IM_SIZ_8b, 216, 2, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c index 06ffa7b14..0807b8356 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c @@ -7,7 +7,7 @@ void KaleidoScope_UpdatePrompt(PlayState* play) { Input* input = &play->state.input[0]; s8 relStickX = input->rel.stick_x; s16 step; - bool dpad = CVar_GetS32("gDpadPause", 0); + bool dpad = CVarGetInteger("gDpadPause", 0); if (((pauseCtx->state == 7) && (pauseCtx->unk_1EC == 1)) || (pauseCtx->state == 0xE) || (pauseCtx->state == 0x10)) { if ((pauseCtx->promptChoice == 0) && ((relStickX >= 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)))) { diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h index 58425a25d..af42f7f73 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h @@ -1,7 +1,7 @@ #ifndef Z_KALEIDO_SCOPE_H #define Z_KALEIDO_SCOPE_H -#include "ultra64.h" +#include #include "global.h" extern u8 gAmmoItems[]; 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 47367a7d8..916bb192d 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 @@ -924,7 +924,7 @@ void KaleidoScope_SwitchPage(PauseContext* pauseCtx, u8 pt) { gSaveContext.buttonStatus[buttonIndex] = D_8082AB6C[pauseCtx->pageIndex + pt][buttonIndex]; } - if ((CVar_GetS32("gAssignableTunicsAndBoots", 0) != 0) && (D_8082ABEC[pauseCtx->mode] == PAUSE_EQUIP)) { + if ((CVarGetInteger("gAssignableTunicsAndBoots", 0) != 0) && (D_8082ABEC[pauseCtx->mode] == PAUSE_EQUIP)) { gSaveContext.buttonStatus[1] = BTN_ENABLED; gSaveContext.buttonStatus[2] = BTN_ENABLED; gSaveContext.buttonStatus[3] = BTN_ENABLED; @@ -944,12 +944,12 @@ void KaleidoScope_SwitchPage(PauseContext* pauseCtx, u8 pt) { void KaleidoScope_HandlePageToggles(PauseContext* pauseCtx, Input* input) { s16 Debug_BTN = BTN_L; s16 PageLeft_BTN = BTN_Z; - if (CVar_GetS32("gNGCKaleidoSwitcher", 0) != 0) { + if (CVarGetInteger("gNGCKaleidoSwitcher", 0) != 0) { Debug_BTN = BTN_Z; PageLeft_BTN = BTN_L; } - if (CVar_GetS32("gDebugEnabled", 0) && (pauseCtx->debugState == 0) && CHECK_BTN_ALL(input->press.button, Debug_BTN)) { + if (CVarGetInteger("gDebugEnabled", 0) && (pauseCtx->debugState == 0) && CHECK_BTN_ALL(input->press.button, Debug_BTN)) { pauseCtx->debugState = 1; return; } @@ -964,7 +964,7 @@ void KaleidoScope_HandlePageToggles(PauseContext* pauseCtx, Input* input) { return; } - bool dpad = CVar_GetS32("gDpadPause", 0); + bool dpad = CVarGetInteger("gDpadPause", 0); if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->cur.button, BTN_DLEFT))) { pauseCtx->pageSwitchTimer++; @@ -994,14 +994,14 @@ void KaleidoScope_DrawCursor(PlayState* play, u16 pageIndex) { temp = pauseCtx->unk_1E4; - if (CVar_GetS32("gCosmetics.Hud_AButton.Changed", 0)) { - sCursorColors[2] = CVar_GetRGB("gCosmetics.Hud_AButton.Value", sCursorColors[2]); - } else if (CVar_GetS32("gCosmetics.DefaultColorScheme", 0)) { + if (CVarGetInteger("gCosmetics.Hud_AButton.Changed", 0)) { + sCursorColors[2] = CVarGetColor24("gCosmetics.Hud_AButton.Value", sCursorColors[2]); + } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", 0)) { sCursorColors[2] = (Color_RGB8){ 0, 255, 50 }; } - if (CVar_GetS32("gCosmetics.Hud_CButtons.Changed", 0)) { - sCursorColors[1] = CVar_GetRGB("gCosmetics.Hud_CButtons.Value", sCursorColors[1]); + if (CVarGetInteger("gCosmetics.Hud_CButtons.Changed", 0)) { + sCursorColors[1] = CVarGetColor24("gCosmetics.Hud_CButtons.Value", sCursorColors[1]); } if ((((pauseCtx->unk_1E4 == 0) || (temp == 8)) && (pauseCtx->state == 6)) || @@ -1075,19 +1075,19 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { { 0, 0, 0 }, { 255, 255, 0 }, { 0, 50, 255 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 50, 255 }, }; Color_RGB8 aButtonColor = { 100, 100, 255 }; - if (CVar_GetS32("gCosmetics.Hud_AButton.Changed", 0)) { - aButtonColor = CVar_GetRGB("gCosmetics.Hud_AButton.Value", aButtonColor); - D_8082ACF4[8] = CVar_GetRGB("gCosmetics.Hud_AButton.Value", D_8082ACF4[8]); - D_8082ACF4[11] = CVar_GetRGB("gCosmetics.Hud_AButton.Value", D_8082ACF4[11]); - } else if (CVar_GetS32("gCosmetics.DefaultColorScheme", 0)) { + if (CVarGetInteger("gCosmetics.Hud_AButton.Changed", 0)) { + aButtonColor = CVarGetColor24("gCosmetics.Hud_AButton.Value", aButtonColor); + D_8082ACF4[8] = CVarGetColor24("gCosmetics.Hud_AButton.Value", D_8082ACF4[8]); + D_8082ACF4[11] = CVarGetColor24("gCosmetics.Hud_AButton.Value", D_8082ACF4[11]); + } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", 0)) { aButtonColor = (Color_RGB8){ 100, 255, 100 }; D_8082ACF4[8] = (Color_RGB8){ 0, 255, 50 }; D_8082ACF4[11] = (Color_RGB8){ 0, 255, 50 }; } - if (CVar_GetS32("gCosmetics.Hud_CButtons.Changed", 0)) { - D_8082ACF4[4] = CVar_GetRGB("gCosmetics.Hud_CButtons.Value", D_8082ACF4[4]); - D_8082ACF4[7] = CVar_GetRGB("gCosmetics.Hud_CButtons.Value", D_8082ACF4[7]); + if (CVarGetInteger("gCosmetics.Hud_CButtons.Changed", 0)) { + D_8082ACF4[4] = CVarGetColor24("gCosmetics.Hud_CButtons.Value", D_8082ACF4[4]); + D_8082ACF4[7] = CVarGetColor24("gCosmetics.Hud_CButtons.Value", D_8082ACF4[7]); } static s16 D_8082AD3C = 20; @@ -1138,7 +1138,7 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { } } - if (CVar_GetS32("gDpadHoldChange", 1) && CVar_GetS32("gDpadPause", 0)) { + if (CVarGetInteger("gDpadHoldChange", 1) && CVarGetInteger("gDpadPause", 0)) { if (CHECK_BTN_ALL(input->cur.button, BTN_DLEFT)) { if (CHECK_BTN_ALL(input->press.button, BTN_DLEFT)) { D_8082AD44 = XREG(8); @@ -1483,7 +1483,7 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { POLY_KAL_DISP = KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, sPromptChoiceTexs[gSaveContext.language][1], 48, 16, 16); } else if (((pauseCtx->state == 7 && pauseCtx->unk_1EC >= 4) || pauseCtx->state == 0xF) && - !CVar_GetS32("gSkipSaveConfirmation", 0)) { + !CVarGetInteger("gSkipSaveConfirmation", 0)) { POLY_KAL_DISP = KaleidoScope_QuadTextureIA8(POLY_KAL_DISP, sSaveConfirmationTexs[gSaveContext.language], 152, 16, 0); } else if ((pauseCtx->state != 7) || (pauseCtx->unk_1EC < 4)) { @@ -1529,31 +1529,31 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { void KaleidoScope_DrawInfoPanel(PlayState* play) { Color_RGB8 aButtonColor = { 0, 100, 255 }; - if (CVar_GetS32("gCosmetics.Hud_AButton.Changed", 0)) { - aButtonColor = CVar_GetRGB("gCosmetics.Hud_AButton.Value", aButtonColor); - } else if (CVar_GetS32("gCosmetics.DefaultColorScheme", 0)) { + if (CVarGetInteger("gCosmetics.Hud_AButton.Changed", 0)) { + aButtonColor = CVarGetColor24("gCosmetics.Hud_AButton.Value", aButtonColor); + } else if (CVarGetInteger("gCosmetics.DefaultColorScheme", 0)) { aButtonColor = (Color_RGB8){ 0, 255, 100 }; } Color_RGB8 cButtonsColor = {255, 160, 0}; - if (CVar_GetS32("gCosmetics.Hud_CButtons.Changed", 0)) { - cButtonsColor = CVar_GetRGB("gCosmetics.Hud_CButtons.Value", cButtonsColor); + if (CVarGetInteger("gCosmetics.Hud_CButtons.Changed", 0)) { + cButtonsColor = CVarGetColor24("gCosmetics.Hud_CButtons.Value", cButtonsColor); } Color_RGB8 cUpButtonColor = cButtonsColor; - if (CVar_GetS32("gCosmetics.Hud_CUpButton.Changed", 0)) { - cUpButtonColor = CVar_GetRGB("gCosmetics.Hud_CUpButton.Value", cUpButtonColor); + if (CVarGetInteger("gCosmetics.Hud_CUpButton.Changed", 0)) { + cUpButtonColor = CVarGetColor24("gCosmetics.Hud_CUpButton.Value", cUpButtonColor); } Color_RGB8 cDownButtonColor = cButtonsColor; - if (CVar_GetS32("gCosmetics.Hud_CDownButton.Changed", 0)) { - cDownButtonColor = CVar_GetRGB("gCosmetics.Hud_CDownButton.Value", cDownButtonColor); + if (CVarGetInteger("gCosmetics.Hud_CDownButton.Changed", 0)) { + cDownButtonColor = CVarGetColor24("gCosmetics.Hud_CDownButton.Value", cDownButtonColor); } Color_RGB8 cLeftButtonColor = cButtonsColor; - if (CVar_GetS32("gCosmetics.Hud_CLeftButton.Changed", 0)) { - cLeftButtonColor = CVar_GetRGB("gCosmetics.Hud_CLeftButton.Value", cLeftButtonColor); + if (CVarGetInteger("gCosmetics.Hud_CLeftButton.Changed", 0)) { + cLeftButtonColor = CVarGetColor24("gCosmetics.Hud_CLeftButton.Value", cLeftButtonColor); } Color_RGB8 cRightButtonColor = cButtonsColor; - if (CVar_GetS32("gCosmetics.Hud_CRightButton.Changed", 0)) { - cRightButtonColor = CVar_GetRGB("gCosmetics.Hud_CRightButton.Value", cRightButtonColor); + if (CVarGetInteger("gCosmetics.Hud_CRightButton.Changed", 0)) { + cRightButtonColor = CVarGetColor24("gCosmetics.Hud_CRightButton.Value", cRightButtonColor); } static const void* sToEquipTextures[3] = { @@ -1750,21 +1750,21 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { if ((pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) && (pauseCtx->unk_1E4 == 0)) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, D_808321A0, D_808321A2, D_808321A4, D_808321A6); } else { - if (CVar_GetS32("gUniformLR", 0) != 0) { + if (CVarGetInteger("gUniformLR", 0) != 0) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 180, 210, 255, 255); } } gSPDisplayList(POLY_KAL_DISP++, gLButtonIconDL); - if (CVar_GetS32("gUniformLR", 0) == 0) { //Restore the misplace gDPSetPrimColor + if (CVarGetInteger("gUniformLR", 0) == 0) { //Restore the misplace gDPSetPrimColor gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 180, 210, 255, 255); } if ((pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_RIGHT) && (pauseCtx->unk_1E4 == 0)) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, D_808321A0, D_808321A2, D_808321A4, D_808321A6); } else { - if (CVar_GetS32("gUniformLR", 0) != 0) { + if (CVarGetInteger("gUniformLR", 0) != 0) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 180, 210, 255, 255); } } @@ -1815,7 +1815,7 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { POLY_KAL_DISP = KaleidoScope_QuadTextureIA4(POLY_KAL_DISP, pauseCtx->nameSegment, 128, 16, 0); } - if (pauseCtx->pageIndex == PAUSE_MAP && CVar_GetS32("gSkulltulaDebugEnabled", 0) != 0) { + if (pauseCtx->pageIndex == PAUSE_MAP && CVarGetInteger("gSkulltulaDebugEnabled", 0) != 0) { if (YREG(7) != 0) { osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("キンスタ数(%d) Get_KIN_STA=%x (%x) (%x)\n", YREG(6), GET_GS_FLAGS(YREG(6)), @@ -1912,7 +1912,7 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { } } } else { - if (!pauseCtx->pageIndex && (!CVar_GetS32("gPauseAnyCursor", 0) || (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE))) { // pageIndex == PAUSE_ITEM + if (!pauseCtx->pageIndex && (!CVarGetInteger("gPauseAnyCursor", 0) || (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE))) { // pageIndex == PAUSE_ITEM pauseCtx->infoPanelVtx[16].v.ob[0] = pauseCtx->infoPanelVtx[18].v.ob[0] = WREG(49 + gSaveContext.language); @@ -2057,7 +2057,7 @@ void KaleidoScope_UpdateNamePanel(PlayState* play) { osCreateMesgQueue(&pauseCtx->loadQueue, &pauseCtx->loadMsg, 1); - if (CVar_GetS32("gPauseAnyCursor", 0) && + if (CVarGetInteger("gPauseAnyCursor", 0) && ((pauseCtx->pageIndex == PAUSE_EQUIP && pauseCtx->cursorX[PAUSE_EQUIP] != 0 && !CHECK_OWNED_EQUIP(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP] - 1)) || (pauseCtx->pageIndex == PAUSE_ITEM && gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] == ITEM_NONE))) { pauseCtx->namedItem = PAUSE_ITEM_NONE; @@ -2073,7 +2073,7 @@ void KaleidoScope_UpdateNamePanel(PlayState* play) { } const char* textureName = mapNameTextures[sp2A]; - memcpy(pauseCtx->nameSegment, ResourceMgr_LoadTexByName(textureName), ResourceMgr_LoadTexSizeByName(textureName)); + memcpy(pauseCtx->nameSegment, GetResourceDataByName(textureName, false), GetResourceTexSizeByName(textureName, false)); } else { osSyncPrintf("zoom_name=%d\n", pauseCtx->namedItem); @@ -2087,7 +2087,7 @@ void KaleidoScope_UpdateNamePanel(PlayState* play) { osSyncPrintf("J_N=%d point=%d\n", gSaveContext.language, sp2A); const char* textureName = iconNameTextures[sp2A]; - memcpy(pauseCtx->nameSegment, ResourceMgr_LoadTexByName(textureName), ResourceMgr_LoadTexSizeByName(textureName)); + memcpy(pauseCtx->nameSegment, GetResourceDataByName(textureName, false), GetResourceTexSizeByName(textureName, false)); } pauseCtx->nameDisplayTimer = 0; @@ -2631,7 +2631,7 @@ void KaleidoScope_InitVertices(PlayState* play, GraphicsContext* gfxCtx) { for (phi_t3 = 1; phi_t3 < ARRAY_COUNT(gSaveContext.equips.buttonItems); phi_t3++, phi_t2 += 4) { if (gSaveContext.equips.cButtonSlots[phi_t3 - 1] != ITEM_NONE && - ((phi_t3 < 4) || CVar_GetS32("gDpadEquips", 0))) { + ((phi_t3 < 4) || CVarGetInteger("gDpadEquips", 0))) { phi_t4 = gSaveContext.equips.cButtonSlots[phi_t3 - 1] * 4; pauseCtx->itemVtx[phi_t2 + 0].v.ob[0] = pauseCtx->itemVtx[phi_t2 + 2].v.ob[0] = @@ -3044,7 +3044,7 @@ void KaleidoScope_GrayOutTextureRGBA32(u32* texture, u16 pixelCount) { u16 gray; u16 i; - texture = ResourceMgr_LoadTexByName(texture); + texture = GetResourceDataByName(texture, false); for (i = 0; i < pixelCount; i++) { uint32_t px = texture[i]; @@ -3080,7 +3080,7 @@ void func_808265BC(PlayState* play) { pauseCtx->pageIndex = D_8082ABEC[pauseCtx->mode]; - if ((CVar_GetS32("gAssignableTunicsAndBoots", 0) != 0) && (pauseCtx->pageIndex == PAUSE_EQUIP)) { + if ((CVarGetInteger("gAssignableTunicsAndBoots", 0) != 0) && (pauseCtx->pageIndex == PAUSE_EQUIP)) { gSaveContext.buttonStatus[1] = BTN_ENABLED; gSaveContext.buttonStatus[2] = BTN_ENABLED; gSaveContext.buttonStatus[3] = BTN_ENABLED; @@ -3191,8 +3191,8 @@ void KaleidoScope_LoadDungeonMap(PlayState* play) { char* firstTextureName = sDungeonMapTexs[R_MAP_TEX_INDEX]; char* secondTextureName = sDungeonMapTexs[R_MAP_TEX_INDEX + 1]; - memcpy(interfaceCtx->mapSegment, ResourceMgr_LoadTexByName(firstTextureName), ResourceMgr_LoadTexSizeByName(firstTextureName)); - memcpy(interfaceCtx->mapSegment + 0x800, ResourceMgr_LoadTexByName(secondTextureName), ResourceMgr_LoadTexSizeByName(secondTextureName)); + memcpy(interfaceCtx->mapSegment, GetResourceDataByName(firstTextureName, false), GetResourceTexSizeByName(firstTextureName, false)); + memcpy(interfaceCtx->mapSegment + 0x800, GetResourceDataByName(secondTextureName, false), GetResourceTexSizeByName(secondTextureName, false)); } void KaleidoScope_UpdateDungeonMap(PlayState* play) { @@ -3371,13 +3371,13 @@ void KaleidoScope_Update(PlayState* play) if (((void)0, gSaveContext.worldMapArea) < 22) { if (gSaveContext.language == LANGUAGE_ENG) { const char* textureName = mapNameTextures[36 + gSaveContext.worldMapArea]; - memcpy(pauseCtx->nameSegment + 0x400, ResourceMgr_LoadTexByName(textureName), ResourceMgr_LoadTexSizeByName(textureName)); + memcpy(pauseCtx->nameSegment + 0x400, GetResourceDataByName(textureName, false), GetResourceTexSizeByName(textureName, false)); } else if (gSaveContext.language == LANGUAGE_GER) { const char* textureName = mapNameTextures[58 + gSaveContext.worldMapArea]; - memcpy(pauseCtx->nameSegment + 0x400, ResourceMgr_LoadTexByName(textureName), ResourceMgr_LoadTexSizeByName(textureName)); + memcpy(pauseCtx->nameSegment + 0x400, GetResourceDataByName(textureName, false), GetResourceTexSizeByName(textureName, false)); } else { const char* textureName = mapNameTextures[80 + gSaveContext.worldMapArea]; - memcpy(pauseCtx->nameSegment + 0x400, ResourceMgr_LoadTexByName(textureName), ResourceMgr_LoadTexSizeByName(textureName)); + memcpy(pauseCtx->nameSegment + 0x400, GetResourceDataByName(textureName, false), GetResourceTexSizeByName(textureName, false)); } } // OTRTODO - player on pause @@ -3650,9 +3650,9 @@ void KaleidoScope_Update(PlayState* play) switch (pauseCtx->unk_1E4) { case 0: if (CHECK_BTN_ALL(input->press.button, BTN_START)) { - CVar_SetS32("gPauseBufferBlockInputFrame", 9); - if (CVar_GetS32("gCheatEasyPauseBufferEnabled", 0)) { - CVar_SetS32("gCheatEasyPauseBufferFrameAdvance", 13); + CVarSetInteger("gPauseBufferBlockInputFrame", 9); + if (CVarGetInteger("gCheatEasyPauseBufferEnabled", 0)) { + CVarSetInteger("gCheatEasyPauseBufferFrameAdvance", 13); } Interface_SetDoAction(play, DO_ACTION_NONE); pauseCtx->state = 0x12; @@ -3813,7 +3813,7 @@ void KaleidoScope_Update(PlayState* play) &D_801333E8); Play_PerformSave(play); pauseCtx->unk_1EC = 4; - D_8082B25C = CVar_GetS32("gSkipSaveConfirmation", 0) ? 3 /* 0.1 sec */ : 90 /* 3 secs */; + D_8082B25C = CVarGetInteger("gSkipSaveConfirmation", 0) ? 3 /* 0.1 sec */ : 90 /* 3 secs */; } } else if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_B)) { @@ -4057,7 +4057,7 @@ void KaleidoScope_Update(PlayState* play) gSaveContext.savedSceneNum = play->sceneNum; Save_SaveFile(); pauseCtx->state = 0xF; - D_8082B25C = CVar_GetS32("gSkipSaveConfirmation", 0) ? 3 /* 0.1 sec */ : 90 /* 3 secs */; + D_8082B25C = CVarGetInteger("gSkipSaveConfirmation", 0) ? 3 /* 0.1 sec */ : 90 /* 3 secs */; } } break; @@ -4204,7 +4204,7 @@ void KaleidoScope_Update(PlayState* play) R_UPDATE_RATE = 3; R_PAUSE_MENU_MODE = 0; - CVar_SetS32("gPauseTriforce", 0); + CVarSetInteger("gPauseTriforce", 0); func_800981B8(&play->objectCtx); func_800418D0(&play->colCtx, play);