Merge pull request #4578 from garrettjoecox/let-it-snow

develop -> let-it-snow
This commit is contained in:
Garrett Cox 2024-11-24 10:13:19 -06:00 committed by GitHub
commit 6042328133
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
280 changed files with 2600 additions and 837 deletions

View File

@ -244,7 +244,6 @@ jobs:
- name: Cache build folder
uses: actions/cache@v4
with:
save-always: true
key: ${{ runner.os }}-build-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-${{ github.ref }}

View File

@ -12,7 +12,7 @@ jobs:
if: ${{ github.event.workflow_run.event == 'pull_request' }}
steps:
- id: 'pr-number'
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
result-encoding: string
script: |
@ -20,8 +20,9 @@ jobs:
const pullHeadSHA = '${{github.event.workflow_run.head_sha}}';
const pullUserId = ${{github.event.sender.id}};
const prNumber = await (async () => {
const pulls = await github.rest.pulls.list({owner, repo});
for await (const {data} of github.paginate.iterator(pulls)) {
for await (const { data } of github.paginate.iterator(
github.rest.pulls.list, { owner, repo }
)) {
for (const pull of data) {
if (pull.head.sha === pullHeadSHA && pull.user.id === pullUserId) {
return pull.number;
@ -36,7 +37,7 @@ jobs:
return prNumber;
- id: 'artifacts-text'
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
result-encoding: string
script: |
@ -47,13 +48,13 @@ jobs:
});
return allArtifacts.data.artifacts.reduce((acc, item) => {
if (item.name === "assets") return acc;
if (item.name === "soh.otr") return acc;
acc += `
- [${item.name}.zip](https://nightly.link/${context.repo.owner}/${context.repo.repo}/actions/artifacts/${item.id}.zip)`;
return acc;
}, '### Build Artifacts');
- id: 'add-to-pr'
uses: garrettjoecox/pr-section@3.1.0
uses: garrettjoecox/pr-section@4.0.0
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
pr-number: ${{ steps.pr-number.outputs.result }}

View File

@ -220,7 +220,7 @@ static const ALIGN_ASSET(2) char gLinkChildDL_18580[] = dgLinkChildDL_18580;
static const ALIGN_ASSET(2) char gLinkChildBottle2DL[] = dgLinkChildBottle2DL;
#define dgLinkChildSlinghotStringDL "__OTR__objects/object_link_child/gLinkChildSlinghotStringDL"
static const ALIGN_ASSET(2) char gLinkChildSlinghotStringDL[] = dgLinkChildSlinghotStringDL;
static const ALIGN_ASSET(2) char gLinkChildSlingshotStringDL[] = dgLinkChildSlinghotStringDL;
#define dgLinkChildDekuShieldDL "__OTR__objects/object_link_child/gLinkChildDekuShieldDL"
static const ALIGN_ASSET(2) char gLinkChildDekuShieldDL[] = dgLinkChildDekuShieldDL;

View File

@ -8,7 +8,7 @@
#include "functions.h"
#include "variables.h"
#include "macros.h"
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
#include "soh/Enhancements/gameconsole.h"
#include "soh/Enhancements/gameplaystats.h"
#include <libultraship/bridge.h>

View File

@ -1,6 +1,7 @@
#include "AudioCollection.h"
#include "sequence.h"
#include "sfx.h"
#include "soh/cvar_prefixes.h"
#include <vector>
#include <utils/StringHelper.h>
#include <libultraship/bridge.h>

View File

@ -8,9 +8,10 @@
#include <libultraship/libultraship.h>
#include <functions.h>
#include "../randomizer/3drando/random.hpp"
#include "../../OTRGlobals.h"
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
#include <utils/StringHelper.h>
#include "../../UIWidgets.hpp"
#include "soh/UIWidgets.hpp"
#include "AudioCollection.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"

View File

@ -10,6 +10,7 @@
#include <stdarg.h>
#include <z64.h>
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
uint8_t gLoadFileSelect = 0, gSkipLogoTest = 0;

View File

@ -4,6 +4,7 @@
#include "libultraship/libultra/controller.h"
#include "Context.h"
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
#ifndef IMGUI_DEFINE_MATH_OPERATORS
#define IMGUI_DEFINE_MATH_OPERATORS
#endif

View File

@ -3,6 +3,7 @@
#include "soh/OTRGlobals.h"
#include "../../UIWidgets.hpp"
#include "z64.h"
#include "soh/cvar_prefixes.h"
#ifndef __WIIU__
#include "controller/controldevice/controller/mapping/sdl/SDLAxisDirectionToButtonMapping.h"
#endif
@ -1578,9 +1579,9 @@ void SohInputEditorWindow::DrawCameraControlPanel() {
UIWidgets::Tooltip("Inverts the Camera X Axis in:\n-First-Person/C-Up view\n-Weapon Aiming");
UIWidgets::PaddedEnhancementCheckbox("Invert Aiming Y Axis", CVAR_SETTING("Controls.InvertAimingYAxis"), true, true, false, "", UIWidgets::CheckboxGraphics::Cross, true);
UIWidgets::Tooltip("Inverts the Camera Y Axis in:\n-First-Person/C-Up view\n-Weapon Aiming");
UIWidgets::PaddedEnhancementCheckbox("Invert Shield Aiming Y Axis", CVAR_SETTING("Controls.InvertShieldAimingYAxis"), true, true, false, "", UIWidgets::CheckboxGraphics::Cross, true);
UIWidgets::PaddedEnhancementCheckbox("Invert Shield Aiming X Axis", CVAR_SETTING("Controls.InvertShieldAimingXAxis"), true, true, false, "", UIWidgets::CheckboxGraphics::Cross, true);
UIWidgets::Tooltip("Inverts the Shield Aiming Y Axis");
UIWidgets::PaddedEnhancementCheckbox("Invert Shield Aiming X Axis", CVAR_SETTING("Controls.InvertShieldAimingYAxis"));
UIWidgets::PaddedEnhancementCheckbox("Invert Shield Aiming Y Axis", CVAR_SETTING("Controls.InvertShieldAimingYAxis"));
UIWidgets::Tooltip("Inverts the Shield Aiming X Axis");
UIWidgets::PaddedEnhancementCheckbox("Invert Z-Weapon Aiming Y Axis", CVAR_SETTING("Controls.InvertZAimingYAxis"), true, true, false, "", UIWidgets::CheckboxGraphics::Cross, true);
UIWidgets::Tooltip("Inverts the Camera Y Axis in:\n-Z-Weapon Aiming");

View File

@ -14,10 +14,12 @@
#include "soh/UIWidgets.hpp"
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
extern "C" {
#include <z64.h>
#include "macros.h"
#include "soh/cvar_prefixes.h"
extern PlayState* gPlayState;
#include "objects/object_link_boy/object_link_boy.h"
#include "objects/object_link_child/object_link_child.h"
@ -877,7 +879,7 @@ void ApplyOrResetCustomGfxPatches(bool manualChange) {
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));
PATCH_GFX(gLinkChildSlingshotStringDL, "Equipment_SlingshotString3",equipmentSlingshotString.changedCvar, 9, gsDPSetPrimColor(0, 0, color.r, color.g, color.b, 255));
}
static CosmeticOption& equipmentBowTips = cosmeticOptions.at("Equipment.BowTips");
@ -1419,7 +1421,7 @@ void DrawSillyTab() {
Reset_Option_Single("Reset##BunnyHood_EarLength", CVAR_COSMETIC("BunnyHood.EarLength"));
UIWidgets::EnhancementSliderFloat("Bunny Hood Spread: %f", "##BunnyHood_EarSpread", CVAR_COSMETIC("BunnyHood.EarSpread"), -300.0f, 500.0f, "", 0.0f, false);
Reset_Option_Single("Reset##BunnyHood_EarSpread", CVAR_COSMETIC("BunnyHood.EarSpread"));
UIWidgets::EnhancementSliderFloat("Goron Neck Length: %f", "##Goron_NeckLength", CVAR_COSMETIC("Goron.NeckLength"), 0.0f, 1000.0f, "", 0.0f, false);
UIWidgets::EnhancementSliderFloat("Goron Neck Length: %f", "##Goron_NeckLength", CVAR_COSMETIC("Goron.NeckLength"), 0.0f, 5000.0f, "", 0.0f, false);
Reset_Option_Single("Reset##Goron_NeckLength", CVAR_COSMETIC("Goron.NeckLength"));
UIWidgets::EnhancementCheckbox("Unfix Goron Spin", CVAR_COSMETIC("UnfixGoronSpin"));
UIWidgets::EnhancementSliderFloat("Fairies Size: %f", "##Fairies_Size", CVAR_COSMETIC("Fairies.Size"), 0.25f, 5.0f, "", 1.0f, false);

View File

@ -1,6 +1,8 @@
#include <libultraship/bridge.h>
#include <string>
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
#include "soh/ResourceManagerHelpers.h"
extern "C" {
#include <libultraship/libultra.h>
@ -9,11 +11,6 @@ extern "C" {
#include "objects/object_gi_soldout/object_gi_soldout.h"
#include "objects/object_ik/object_ik.h"
#include "objects/object_link_child/object_link_child.h"
uint32_t ResourceMgr_GameHasMasterQuest();
uint32_t ResourceMgr_GameHasOriginal();
void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction);
void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName);
}
typedef struct {

View File

@ -26,6 +26,10 @@ static const std::unordered_map<std::string, std::string> percentColors = { { "w
{ "b", QM_BLUE }, { "c", QM_LBLUE }, { "p", QM_PINK },
{ "y", QM_YELLOW }, { "B", QM_BLACK } };
static const std::unordered_map<std::string, std::string> colorToPercent = { { QM_WHITE, "%w" }, { QM_RED, "%r"}, { QM_GREEN, "%g" },
{ QM_BLUE, "%b" }, { QM_LBLUE, "%c"}, { QM_PINK, "%p" },
{ QM_YELLOW, "%y" }, { QM_BLACK, "%B" } };
static const std::unordered_map<std::string, ItemID> altarIcons = {
{ "0", ITEM_KOKIRI_EMERALD },
{ "1", ITEM_GORON_RUBY },
@ -153,6 +157,8 @@ void CustomMessage::ProcessMessageFormat(std::string& str, MessageFormat format)
CleanString(str);
} else if (format == MF_AUTO_FORMAT){
AutoFormatString(str);
}else if (format == MF_ENCODE){
EncodeColors(str);
}
}
@ -296,6 +302,12 @@ void CustomMessage::Clean() {
}
}
void CustomMessage::Encode() {
for (std::string& str : messages) {
EncodeColors(str);
}
}
void CustomMessage::FormatString(std::string& str) const {
std::replace(str.begin(), str.end(), '&', NEWLINE()[0]);
std::replace(str.begin(), str.end(), '^', WAIT_FOR_INPUT()[0]);
@ -521,7 +533,23 @@ const char* Interface_ReplaceSpecialCharacters(char text[]) {
return textChar;
}
void CustomMessage::EncodeColors(std::string& str) const {
for (std::string color: colors) {
if (const size_t firstHashtag = str.find('#'); firstHashtag != std::string::npos) {
str.replace(firstHashtag, 1, colorToPercent.at(color));
if (const size_t secondHashtag = str.find('#', firstHashtag + 1); secondHashtag != std::string::npos) {
str.replace(secondHashtag, 1, "%w");
} else {
SPDLOG_DEBUG("non-matching hashtags in string: \"%s\"", str);
}
}
}
// Remove any remaining '#' characters.
std::erase(str, '#');
}
void CustomMessage::ReplaceColors(std::string& str) const {
EncodeColors(str);
for (const auto& colorPair : percentColors) {
std::string textToReplace = "%";
textToReplace += colorPair.first;
@ -531,18 +559,6 @@ void CustomMessage::ReplaceColors(std::string& str) const {
start_pos += textToReplace.length();
}
}
for (auto color: colors) {
if (const size_t firstHashtag = str.find('#'); firstHashtag != std::string::npos) {
str.replace(firstHashtag, 1, COLOR(color));
if (const size_t secondHashtag = str.find('#', firstHashtag + 1); secondHashtag != std::string::npos) {
str.replace(secondHashtag, 1, COLOR(QM_WHITE));
} else {
SPDLOG_DEBUG("non-matching hashtags in string: \"%s\"", str);
}
}
}
// Remove any remaining '#' characters.
std::erase(str, '#');
}
void CustomMessage::ReplaceAltarIcons(std::string& str) const {
@ -634,6 +650,8 @@ CustomMessage CustomMessageManager::RetrieveMessage(std::string tableID, uint16_
message.AutoFormat();
} else if (format == MF_CLEAN){
message.Clean();
} else if (format == MF_ENCODE){
message.Encode();
}
return message;

View File

@ -26,7 +26,8 @@ typedef enum {
MF_FORMATTED,
MF_CLEAN,
MF_RAW,
MF_AUTO_FORMAT
MF_AUTO_FORMAT,
MF_ENCODE,
} MessageFormat;
/**
@ -111,6 +112,11 @@ class CustomMessage {
*/
void ReplaceSpecialCharacters(std::string& str) const;
/**
* @brief Replaces hashtags with stored colors.
*/
void EncodeColors(std::string& str) const;
/**
* @brief Replaces our color variable strings with the OoT control codes.
*/
@ -163,6 +169,11 @@ class CustomMessage {
*/
void Clean();
/**
* @brief Replaces variable characters with fixed ones to store the sata in string form
*/
void Encode();
/**
* @brief Replaces various symbols with the control codes necessary to
* display them in OoT's textboxes for a single string

View File

@ -6,6 +6,7 @@
#include <vector>
#include <string>
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
#include <soh/Enhancements/item-tables/ItemTableManager.h>
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/cosmetics/CosmeticsEditor.h"

View File

@ -6,6 +6,7 @@
#include "../custom-message/CustomMessageManager.h"
#include "functions.h"
#include "macros.h"
#include "soh/cvar_prefixes.h"
#include "message_data_static.h"
#include "variables.h"
#include "soh/util.h"

View File

@ -13,6 +13,7 @@
#include <libultraship/bridge.h>
#include <libultraship/libultraship.h>
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
extern "C" {
#include <z64.h>

View File

@ -15,6 +15,7 @@ extern "C" {
#include "variables.h"
#include "functions.h"
#include "macros.h"
#include "soh/cvar_prefixes.h"
extern PlayState* gPlayState;
}

View File

@ -18,6 +18,7 @@ extern "C" {
#include "variables.h"
#include "functions.h"
#include "macros.h"
#include "soh/cvar_prefixes.h"
#include "soh/Enhancements/randomizer/adult_trade_shuffle.h"
extern PlayState* gPlayState;
@ -1206,7 +1207,7 @@ void DrawQuestStatusTab() {
ImGui::SameLine();
DrawQuestItemButton(QUEST_GERUDO_CARD);
for (const SongMapEntry& entry : songMapping) {
for (const auto& [quest, entry] : songMapping) {
if ((entry.id != QUEST_SONG_MINUET) && (entry.id != QUEST_SONG_LULLABY)) {
ImGui::SameLine();
}

View File

@ -7,6 +7,7 @@ extern "C" {
#include "variables.h"
#include "functions.h"
#include "macros.h"
#include "soh/cvar_prefixes.h"
extern PlayState* gPlayState;
void GfxPrint_SetColor(GfxPrint* printer, u32 r, u32 g, u32 b, u32 a);
void GfxPrint_SetPos(GfxPrint* printer, s32 x, s32 y);

View File

@ -6,13 +6,13 @@
#include "soh/Enhancements/enhancementTypes.h"
#include "variables.h"
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
#include "soh/ResourceManagerHelpers.h"
extern "C" {
#include <z64.h>
}
extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum);
const char* enemyCVarList[] = {
CVAR_ENHANCEMENT("RandomizedEnemyList.Armos"), CVAR_ENHANCEMENT("RandomizedEnemyList.Arwing"),
CVAR_ENHANCEMENT("RandomizedEnemyList.BabyDodongo"), CVAR_ENHANCEMENT("RandomizedEnemyList.Bari"),

View File

@ -8,6 +8,7 @@
extern "C" {
#include "variables.h"
#include "macros.h"
#include "soh/cvar_prefixes.h"
#include "functions.h"
extern PlayState* gPlayState;
}

View File

@ -1,11 +1,10 @@
extern "C" {
#include "gameplaystats.h"
}
#include "gameplaystatswindow.h"
#include "soh/SaveManager.h"
#include "functions.h"
#include "macros.h"
#include "soh/cvar_prefixes.h"
#include "../UIWidgets.hpp"
#include "soh/util.h"

View File

@ -1,5 +1,17 @@
#pragma once
#include "soh/cvar_prefixes.h"
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
uint64_t GetUnixTimestamp(void);
char* GameplayStats_GetCurrentTime();
#ifdef __cplusplus
};
#endif
// When using RTA timing
// get the diff since the save was created,
// unless the game is complete in which we use the defeated ganon timestamp
@ -17,7 +29,6 @@
gSaveContext.sohStats.sceneTimer)
void InitStatTracker();
char* GameplayStats_GetCurrentTime();
typedef enum {
// 0x00 to 0x9B (0 to 155) used for getting items,

View File

@ -3,6 +3,9 @@
#include "game-interactor/GameInteractor.h"
#include "tts/tts.h"
#include "soh/OTRGlobals.h"
#include "soh/SaveManager.h"
#include "soh/ResourceManagerHelpers.h"
#include "soh/Enhancements/boss-rush/BossRushTypes.h"
#include "soh/Enhancements/boss-rush/BossRush.h"
#include "soh/Enhancements/enhancementTypes.h"
#include "soh/Enhancements/randomizer/3drando/random.hpp"
@ -42,18 +45,16 @@ extern "C" {
#include <z64.h>
#include "align_asset_macro.h"
#include "macros.h"
#include "soh/cvar_prefixes.h"
#include "functions.h"
#include "variables.h"
#include "functions.h"
#include "src/overlays/actors/ovl_En_Door/z_en_door.h"
void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction);
void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName);
extern SaveContext gSaveContext;
extern PlayState* gPlayState;
extern "C" s16 gEnSnowballId;
extern void Overlay_DisplayText(float duration, const char* text);
uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum);
}
// GreyScaleEndDlist

View File

@ -10,6 +10,7 @@
extern "C" {
#include "z64.h"
#include "macros.h"
#include "soh/cvar_prefixes.h"
#include "functions.h"
#include "variables.h"
#include "textures/message_static/message_static.h"

View File

@ -74,7 +74,9 @@ void DrawPresetSelector(PresetType presetTypeId) {
applyPreset(selectedPresetDef.entries);
}
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
Rando::Context::GetInstance()->GetSettings()->ReloadOptions();
if (presetTypeId == PRESET_TYPE_RANDOMIZER){
Rando::Context::GetInstance()->GetSettings()->ReloadOptions();
}
}
ImGui::PopStyleVar(1);
}

View File

@ -8,6 +8,7 @@
#include "soh/Enhancements/randomizer/randomizerTypes.h"
#include "soh/Enhancements/enhancementTypes.h"
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
enum PresetEntryType {
PRESET_ENTRY_TYPE_S32,

View File

@ -2253,6 +2253,118 @@ void StaticData::HintTable_Init() {
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_1] = HintText(CustomMessage("They say that %gGanondorf's Mom%w is going out with %ySqueak%w!",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_2] = HintText(CustomMessage("They say that %gProxySaw%w is still fixing %yCaladius's Bugs%w...",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_3] = HintText(CustomMessage("They say that %gItsHeckinPat%w is still just %yEyeballing it%w.",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_4] = HintText(CustomMessage("They say that %gCaladius%w is working on %yV2%w of something.",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_5] = HintText(CustomMessage("They say that %gdice%w is a funny name for a %ytaco%w.",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_6] = HintText(CustomMessage("They say %g2Ship Rando%w is still blocked by %yV3%w...",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_7] = HintText(CustomMessage("They say if you click your heels and say %gframebuffer%w 3 times, %yArchez%w appears!",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_8] = HintText(CustomMessage("They say %gVB%w stands for %yVirtual Bananas%w... Probably.",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_9] = HintText(CustomMessage("They say %gZeru%w is still routing his %yHundo%w.",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_10] = HintText(CustomMessage("They say %gRaccoonCloud%w is still looking for his %yHover Boots%w.",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_11] = HintText(CustomMessage("They say %gItsHeckinPat%w foreclosed on his %yHut%w.",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_12] = HintText(CustomMessage("They say %gRaccoonCloud%w is part of the %yInner Circle%w.",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_13] = HintText(CustomMessage("They say %gMoonlitxShadows%w is the %rleader%w of the %yDork Army%w.",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_14] = HintText(CustomMessage("They say %gGanondorf%w hates the %yInternet%w.",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_15] = HintText(CustomMessage("They say %gMido's House%w hoards %yTrash%w.",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_16] = HintText(CustomMessage("They say %gSweettalking Ganondorf%w rewards %yHis Heart%w.",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_17] = HintText(CustomMessage("They say %gaMannus%w said %yGo To Bed%w!",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_18] = HintText(CustomMessage("They say %gCaladius%w is a %yPinhead%w!",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_19] = HintText(CustomMessage("They say %gRaccoonCloud%w loves the %yIce Cavern%w.",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_20] = HintText(CustomMessage("They say %gNo One%w should forget %yHover Scrub%w!",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_21] = HintText(CustomMessage("They say %gMoonlitxShadows%w likes to %ySlide%w.",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_23] = HintText(CustomMessage("They say that %gBackwalking%w should be %rBanned%w!",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_24] = HintText(CustomMessage("They say that %gGorons%w should always have %yLong Necks%w!",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_25] = HintText(CustomMessage("They say that %gCaladius%w has a %ytendency to lose his shirt%w!",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_26] = HintText(CustomMessage("They say that if your %rSkip keeps Failing%w, you're probably an %yESS Off%w.",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_27] = HintText(CustomMessage("They say that %gLogic%w is just a %ySuggestion%w.",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_28] = HintText(CustomMessage("They say there's %gAlways Logic%w in %yNo Logic%w...",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
hintTextTable[RHT_JUNK_CREW_29] = HintText(CustomMessage("They said that %rFredomato%w has just %yone more push up%w to do!",
/*german*/ "",
/*french*/ HINT_TEXT_NEEDS_TRANSLATION_FR));
/*--------------------------
| DUNGEON HINT TEXT |
---------------------------*/

View File

@ -113,8 +113,8 @@ StaticHintInfo::StaticHintInfo(HintType _type, std::vector<RandomizerHintTextKey
RandomizerHintTextKey GetRandomJunkHint(){
//temp code to handle random junk hints now I work in keys instead of a vector of HintText
// Will be replaced with a better system once more customisable hint pools are added
uint32_t range = RHT_JUNK_SG_8 - RHT_JUNK02;
//Will be replaced with a better system once more customisable hint pools are added
uint32_t range = RHT_JUNK_CREW_29 - RHT_JUNK02;
return (RandomizerHintTextKey)(Random(0, range) + RHT_JUNK02);
}
@ -757,7 +757,7 @@ void CreateStaticHintFromData(RandomizerHint hint, StaticHintInfo staticData){
//If we get to here then it means a location got through with no area assignment, which means something went wrong elsewhere.
SPDLOG_DEBUG("Attempted to hint location with no areas: ");
SPDLOG_DEBUG(Rando::StaticData::GetLocation(loc)->GetName());
assert(false);
//assert(false);
areas.push_back(RA_NONE);
} else {
areas.push_back(ctx->GetItemLocation(loc)->GetRandomArea());

View File

@ -69,6 +69,8 @@ struct StaticHintInfo{
std::vector<RandomizerCheck> _hintChecks = {}, bool _yourPocket = false, int _num = 0);
};
RandomizerHintTextKey GetRandomJunkHint();
extern void CreateAllHints();
extern void CreateWarpSongTexts();
void CreateStaticHints();
void CreateStaticHints();
RandomizerHintTextKey GetRandomJunkHint();

View File

@ -10,6 +10,7 @@
#include "soh/Enhancements/randomizer/randomizerTypes.h"
#include "variables.h"
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
#include "../option.h"
#include "soh/Enhancements/debugger/performanceTimer.h"

View File

@ -9,6 +9,7 @@
#include <Context.h>
#include <libultraship/libultra/types.h>
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
void RandoMain::GenerateRando(std::set<RandomizerCheck> excludedLocations, std::set<RandomizerTrick> enabledTricks,
std::string seedString) {

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,52 @@
#pragma once
#ifndef PLANDOMIZER_H
#define PLANDOMIZER_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif // PLANDOMIZER_H
#include <libultraship/libultraship.h>
#include "soh/Enhancements/randomizer/item.h"
#ifdef __cplusplus
class PlandomizerWindow : public Ship::GuiWindow {
public:
using GuiWindow::GuiWindow;
void InitElement() override;
void DrawElement() override;
void UpdateElement() override{};
};
typedef struct {
std::string checkName;
Rando::Item checkRewardItem;
int32_t shopPrice;
Rando::Item iceTrapModel;
std::string iceTrapName;
} SpoilerCheckObject;
typedef struct {
std::string hintName;
std::string hintType;
std::string hintText;
} SpoilerHintObject;
typedef enum {
TAB_HINTS,
TAB_LOCATIONS
};
typedef enum {
HINT_SINGLE,
HINT_ALL,
};
#endif

View File

@ -5,6 +5,7 @@
#include "functions.h"
#include "variables.h"
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
#include "randomizerTypes.h"
#include <array>
#include "objects/object_gi_key/object_gi_key.h"

View File

@ -1,5 +1,6 @@
#include <libultraship/bridge.h>
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
#include "soh/Enhancements/enhancementTypes.h"
#include "soh/Enhancements/custom-message/CustomMessageTypes.h"
#include "soh/Enhancements/item-tables/ItemTableManager.h"
@ -10,6 +11,7 @@
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/ImGuiUtils.h"
#include "soh/Notification/Notification.h"
#include "soh/SaveManager.h"
extern "C" {
#include "macros.h"
@ -1397,6 +1399,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l
}
break;
}
case VB_FREEZE_ON_SKULL_TOKEN:
case VB_TRADE_TIMER_ODD_MUSHROOM:
case VB_TRADE_TIMER_EYEDROPS:
case VB_TRADE_TIMER_FROG:
@ -1834,7 +1837,7 @@ void RandomizerOnActorInitHandler(void* actorRef) {
if (
actor->id == ACTOR_OBJ_OSHIHIKI &&
LINK_IS_CHILD &&
IsGameMasterQuest() &&
ResourceMgr_IsGameMasterQuest() &&
gPlayState->sceneNum == SCENE_SPIRIT_TEMPLE && actor->room == 6 && // Spirit Temple silver block hallway
actor->params == 0x9C7 // Silver block that is marked as in the hole
) {
@ -2193,7 +2196,7 @@ void RandomizerRegisterHooks() {
onGameFrameUpdateHook = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameFrameUpdate>(RandomizerOnGameFrameUpdateHandler);
onSceneSpawnActorsHook = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnSceneSpawnActors>(RandomizerOnSceneSpawnActorsHandler);
onPlayDestroyHook = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnPlayDestroy>(RandomizerOnPlayDestroyHandler);
onPlayDestroyHook = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnExitGame>(RandomizerOnExitGameHandler);
onExitGameHook = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnExitGame>(RandomizerOnExitGameHandler);
onKaleidoUpdateHook = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnKaleidoscopeUpdate>(RandomizerOnKaleidoscopeUpdateHandler);
if (RAND_GET_OPTION(RSK_FISHSANITY) != RO_FISHSANITY_OFF) {

View File

@ -1103,10 +1103,10 @@ namespace Rando {
bool Logic::CanBuildRainbowBridge(){
return ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_ALWAYS_OPEN) ||
(ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_VANILLA) && HasItem(RG_SHADOW_MEDALLION) && HasItem(RG_SPIRIT_MEDALLION) && CanUse(RG_LIGHT_ARROWS)) ||
(ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_STONES) && StoneCount() + (HasItem(RG_GREG_RUPEE) && ctx->GetOption(RSK_BRIDGE_OPTIONS).Is(RO_BRIDGE_GREG)) >= ctx->GetOption(RSK_RAINBOW_BRIDGE_STONE_COUNT).Value<uint8_t>()) ||
(ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_MEDALLIONS) && MedallionCount() + (HasItem(RG_GREG_RUPEE) && ctx->GetOption(RSK_BRIDGE_OPTIONS).Is(RO_BRIDGE_GREG)) >= ctx->GetOption(RSK_RAINBOW_BRIDGE_MEDALLION_COUNT).Value<uint8_t>()) ||
(ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_DUNGEON_REWARDS) && StoneCount() + MedallionCount() + (HasItem(RG_GREG_RUPEE) && ctx->GetOption(RSK_BRIDGE_OPTIONS).Is(RO_BRIDGE_GREG)) >= ctx->GetOption(RSK_RAINBOW_BRIDGE_REWARD_COUNT).Value<uint8_t>()) ||
(ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_DUNGEONS) && DungeonCount() + (HasItem(RG_GREG_RUPEE) && ctx->GetOption(RSK_BRIDGE_OPTIONS).Is(RO_BRIDGE_GREG)) >= ctx->GetOption(RSK_RAINBOW_BRIDGE_DUNGEON_COUNT).Value<uint8_t>()) ||
(ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_STONES) && StoneCount() + (HasItem(RG_GREG_RUPEE) && ctx->GetOption(RSK_BRIDGE_OPTIONS).Is(RO_BRIDGE_GREG_REWARD)) >= ctx->GetOption(RSK_RAINBOW_BRIDGE_STONE_COUNT).Value<uint8_t>()) ||
(ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_MEDALLIONS) && MedallionCount() + (HasItem(RG_GREG_RUPEE) && ctx->GetOption(RSK_BRIDGE_OPTIONS).Is(RO_BRIDGE_GREG_REWARD)) >= ctx->GetOption(RSK_RAINBOW_BRIDGE_MEDALLION_COUNT).Value<uint8_t>()) ||
(ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_DUNGEON_REWARDS) && StoneCount() + MedallionCount() + (HasItem(RG_GREG_RUPEE) && ctx->GetOption(RSK_BRIDGE_OPTIONS).Is(RO_BRIDGE_GREG_REWARD)) >= ctx->GetOption(RSK_RAINBOW_BRIDGE_REWARD_COUNT).Value<uint8_t>()) ||
(ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_DUNGEONS) && DungeonCount() + (HasItem(RG_GREG_RUPEE) && ctx->GetOption(RSK_BRIDGE_OPTIONS).Is(RO_BRIDGE_GREG_REWARD)) >= ctx->GetOption(RSK_RAINBOW_BRIDGE_DUNGEON_COUNT).Value<uint8_t>()) ||
(ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_TOKENS) && GetGSCount() >= ctx->GetOption(RSK_RAINBOW_BRIDGE_TOKEN_COUNT).Value<uint8_t>()) ||
(ctx->GetOption(RSK_RAINBOW_BRIDGE).Is(RO_BRIDGE_GREG) && HasItem(RG_GREG_RUPEE));
}

View File

@ -10,7 +10,7 @@
#include <textures/icon_item_static/icon_item_static.h>
#include <textures/icon_item_24_static/icon_item_24_static.h>
std::array<Sprite, 100> gSeedTextures = { {
inline std::array<Sprite, 100> gSeedTextures = { {
{ dgItemIconDekuNutTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 0 },
{ dgItemIconDekuStickTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 1 },
{ dgItemIconBombTex, 32, 32, G_IM_FMT_RGBA, G_IM_SIZ_32b, 2 },

View File

@ -10,7 +10,9 @@
#include <textures/icon_item_24_static/icon_item_24_static.h>
#include "3drando/rando_main.hpp"
#include "3drando/random.hpp"
#include "3drando/custom_messages.hpp"
#include "soh/ResourceManagerHelpers.h"
#include "soh/UIWidgets.hpp"
#include "3drando/custom_messages.hpp"
#include "../../UIWidgets.hpp"
#ifndef IMGUI_DEFINE_MATH_OPERATORS
#define IMGUI_DEFINE_MATH_OPERATORS
@ -41,9 +43,6 @@
#include "fishsanity.h"
#include "randomizerTypes.h"
extern "C" uint32_t ResourceMgr_IsGameMasterQuest();
extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum);
extern std::map<RandomizerCheckArea, std::string> rcAreaNames;
using json = nlohmann::json;

View File

@ -2627,6 +2627,35 @@ typedef enum {
RHT_JUNK_SG_6,
RHT_JUNK_SG_7,
RHT_JUNK_SG_8,
RHT_JUNK_CREW_1,
RHT_JUNK_CREW_2,
RHT_JUNK_CREW_3,
RHT_JUNK_CREW_4,
RHT_JUNK_CREW_5,
RHT_JUNK_CREW_6,
RHT_JUNK_CREW_7,
RHT_JUNK_CREW_8,
RHT_JUNK_CREW_9,
RHT_JUNK_CREW_10,
RHT_JUNK_CREW_11,
RHT_JUNK_CREW_12,
RHT_JUNK_CREW_13,
RHT_JUNK_CREW_14,
RHT_JUNK_CREW_15,
RHT_JUNK_CREW_16,
RHT_JUNK_CREW_17,
RHT_JUNK_CREW_18,
RHT_JUNK_CREW_19,
RHT_JUNK_CREW_20,
RHT_JUNK_CREW_21,
RHT_JUNK_CREW_22,
RHT_JUNK_CREW_23,
RHT_JUNK_CREW_24,
RHT_JUNK_CREW_25,
RHT_JUNK_CREW_26,
RHT_JUNK_CREW_27,
RHT_JUNK_CREW_28,
RHT_JUNK_CREW_29,
// Locations
RHT_LINKS_POCKET,
RHT_QUEEN_GOHMA,

View File

@ -6,6 +6,7 @@
#include <libultraship/bridge.h>
#include "z64.h"
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
#include "fishsanity.h"
std::map<RandomizerCheckArea, std::string> rcAreaNames = {

View File

@ -2,9 +2,12 @@
#include "randomizer_entrance_tracker.h"
#include "randomizer_item_tracker.h"
#include "randomizerTypes.h"
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
#include "soh/SaveManager.h"
#include "soh/ResourceManagerHelpers.h"
#include "soh/UIWidgets.hpp"
#include "dungeon.h"
#include "../../OTRGlobals.h"
#include "../../UIWidgets.hpp"
#include "3drando/location_access.hpp"
#include <string>
@ -24,7 +27,6 @@ extern "C" {
#include "macros.h"
extern PlayState* gPlayState;
}
extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum);
extern "C" GetItemEntry ItemTable_RetrieveEntry(s16 modIndex, s16 getItemID);
extern std::vector<ItemTrackerItem> dungeonRewardStones;
@ -32,8 +34,6 @@ extern std::vector<ItemTrackerItem> dungeonRewardMedallions;
extern std::vector<ItemTrackerItem> songItems;
extern std::vector<ItemTrackerItem> equipmentItems;
#define RCO_RAORU { RC_GIFT_FROM_SAGES, RCVORMQ_BOTH, RCTYPE_DUNGEON_REWARD, RCAREA_MARKET, ACTOR_ID_MAX, SCENE_ID_MAX, 0x00, GI_NONE, false, "Gift from Raoru", "Gift from Raoru", true };
using json = nlohmann::json;
namespace CheckTracker {
@ -216,34 +216,6 @@ static ImGuiTextFilter checkSearch;
std::array<bool, RCAREA_INVALID> filterAreasHidden = { 0 };
std::array<bool, RC_MAX> filterChecksHidden = { 0 };
void SongFromImpa() {
if (IS_RANDO) {
if (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SKIP_CHILD_ZELDA) == RO_GENERIC_ON && IS_RANDO) {
//if (gSaveContext.checkTrackerData[RC_SONG_FROM_IMPA].status != RCSHOW_SAVED) {
// gSaveContext.checkTrackerData[RC_SONG_FROM_IMPA].status = RCSHOW_SAVED;
//}
}
}
}
void GiftFromSages() {
if (!IS_RANDO) {
//DefaultCheckData(RC_GIFT_FROM_SAGES);
}
}
std::vector<RandomizerCheck> checks;
// Function for adding Link's Pocket check
void LinksPocket() {
/*if (IS_RANDO) {
if (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_LINKS_POCKET) != RO_LINKS_POCKET_NOTHING ||
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_DUNGEON_REWARDS) == RO_DUNGEON_REWARDS_END_OF_DUNGEON) {
DefaultCheckData(RC_LINKS_POCKET);
gSaveContext.checkTrackerData[RC_LINKS_POCKET].status = RCSHOW_SAVED;
}
}*/
}
void TrySetAreas() {
if (checksByArea.empty()) {
for (int i = RCAREA_KOKIRI_FOREST; i < RCAREA_INVALID; i++) {
@ -507,9 +479,6 @@ void CheckTrackerLoadGame(int32_t fileNum) {
showVOrMQ = (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_MQ_DUNGEON_RANDOM) == RO_MQ_DUNGEONS_RANDOM_NUMBER ||
(OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_MQ_DUNGEON_RANDOM) == RO_MQ_DUNGEONS_SET_NUMBER &&
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_MQ_DUNGEON_COUNT) < 12));
LinksPocket();
SongFromImpa();
GiftFromSages();
initialized = true;
UpdateAllOrdering();
UpdateInventoryChecks();
@ -1254,7 +1223,6 @@ bool IsCheckShuffled(RandomizerCheck rc) {
(loc->GetRCType() != RCTYPE_SHOP ||
(showShops && OTRGlobals::Instance->gRandomizer->IdentifyShopItem(loc->GetScene(), loc->GetActorParams() + 1).enGirlAShopItem == 50)) &&
(rc != RC_TRIFORCE_COMPLETED || !hideTriforceCompleted) &&
(rc != RC_GIFT_FROM_SAGES || !IS_RANDO) &&
(loc->GetRCType() != RCTYPE_SCRUB ||
showScrubs ||
(showMajorScrubs && (rc == RC_LW_DEKU_SCRUB_NEAR_BRIDGE || // The 3 scrubs that are always randomized

View File

@ -9,6 +9,8 @@
#include "randomizer_entrance.h"
#include "randomizer_grotto.h"
#include "soh/OTRGlobals.h"
#include "soh/SaveManager.h"
#include <string.h>
#include "global.h"
@ -159,7 +161,7 @@ void Entrance_Init(void) {
}
// Initialize all boss room save/death warps with their vanilla dungeon entryway
for (s16 i = 1; i < SHUFFLEABLE_BOSS_COUNT; i++) {
for (s16 i = 0; i < SHUFFLEABLE_BOSS_COUNT; i++) {
bossSceneSaveDeathWarps[i] = dungeons[i].entryway;
}
@ -183,7 +185,7 @@ void Entrance_Init(void) {
// Search for boss room overrides and look for the matching save/death warp value to use
// If the boss room is in a dungeon, use the dungeons entryway as the save warp
// Otherwise use the "exit" value for the entrance that lead to the boss room
for (int j = 0; j <= SHUFFLEABLE_BOSS_COUNT; j++) {
for (int j = 0; j < SHUFFLEABLE_BOSS_COUNT; j++) {
if (overrideIndex == dungeons[j].bossDoor) {
bossScene = dungeons[j].bossScene;
}

View File

@ -1,5 +1,6 @@
#include "randomizer_entrance_tracker.h"
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
#include "soh/UIWidgets.hpp"
#include <map>

View File

@ -4,6 +4,7 @@
*/
#include "randomizer_grotto.h"
#include "soh/OTRGlobals.h"
#include "global.h"
@ -272,7 +273,7 @@ void Grotto_OverrideActorEntrance(Actor* thisx) {
void Grotto_ForceGrottoReturnOnSpecialEntrance(void) {
if (lastEntranceType == GROTTO_RETURN && (Randomizer_GetSettingValue(RSK_SHUFFLE_GROTTO_ENTRANCES) || Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_SPAWNS) || Randomizer_GetSettingValue(RSK_SHUFFLE_WARP_SONGS))) {
gSaveContext.respawnFlag = 2;
gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams = 0x4FF;
gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams = 0x04FF;
gSaveContext.respawn[RESPAWN_MODE_RETURN].pos = grottoReturnTable[grottoId].pos;
// Clear current temp flags
gSaveContext.respawn[RESPAWN_MODE_RETURN].tempSwchFlags = 0;
@ -307,7 +308,7 @@ void Grotto_ForceRegularVoidOut(void) {
// so that Sun's Song and Game Over will behave correctly
void Grotto_SetupReturnInfoOnFWReturn(void) {
if (Randomizer_GetSettingValue(RSK_SHUFFLE_GROTTO_ENTRANCES) || Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_SPAWNS) || Randomizer_GetSettingValue(RSK_SHUFFLE_WARP_SONGS) &&
gSaveContext.fw.playerParams == 0x4FF) {
gSaveContext.fw.playerParams == 0x04FF) {
gSaveContext.respawn[RESPAWN_MODE_RETURN] = gSaveContext.respawn[RESPAWN_MODE_TOP];
gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams = 0x0DFF;
lastEntranceType = GROTTO_RETURN;

View File

@ -1,7 +1,10 @@
#include "randomizer_item_tracker.h"
#include "../../util.h"
#include "../../OTRGlobals.h"
#include "../../UIWidgets.hpp"
#include "soh/util.h"
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
#include "soh/SaveManager.h"
#include "soh/ResourceManagerHelpers.h"
#include "soh/UIWidgets.hpp"
#include "randomizerTypes.h"
#include <map>
@ -22,7 +25,6 @@ extern PlayState* gPlayState;
#include "textures/icon_item_static/icon_item_static.h"
#include "textures/icon_item_24_static/icon_item_24_static.h"
}
extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum);
void DrawEquip(ItemTrackerItem item);
void DrawItem(ItemTrackerItem item);

View File

@ -1,5 +1,6 @@
#include "savefile.h"
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
extern "C" {
@ -8,7 +9,6 @@ extern "C" {
#include "functions.h"
#include "macros.h"
uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum);
uint8_t Randomizer_GetSettingValue(RandomizerSettingKey randoSettingKey);
GetItemEntry Randomizer_GetItemFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId);
}

View File

@ -1773,22 +1773,67 @@ void Settings::UpdateOptionProperties() {
}
}
// Show mixed entrance pool options if mixed entrance pools are enabled at all.
if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("MixedEntrances"), RO_GENERIC_OFF)) {
mOptions[RSK_MIXED_ENTRANCE_POOLS].RemoveFlag(IMFLAG_SEPARATOR_BOTTOM);
mOptions[RSK_MIX_DUNGEON_ENTRANCES].Unhide();
mOptions[RSK_MIX_BOSS_ENTRANCES].Unhide();
mOptions[RSK_MIX_OVERWORLD_ENTRANCES].Unhide();
mOptions[RSK_MIX_INTERIOR_ENTRANCES].Unhide();
mOptions[RSK_MIX_GROTTO_ENTRANCES].Unhide();
int dungeonShuffle = CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleDungeonsEntrances"), RO_DUNGEON_ENTRANCE_SHUFFLE_OFF);
int bossShuffle = CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleBossEntrances"), RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF);
int overworldShuffle = CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleOverworldEntrances"), RO_GENERIC_OFF);
int interiorShuffle = CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleInteriorsEntrances"), RO_GENERIC_OFF);
int grottoShuffle = CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleGrottosEntrances"), RO_GENERIC_OFF);
// Hide Mixed Entrances option if no applicable entrance shuffles are visible
if (!dungeonShuffle && !bossShuffle && !overworldShuffle && !interiorShuffle && !grottoShuffle) {
mOptions[RSK_MIXED_ENTRANCE_POOLS].Hide();
} else {
mOptions[RSK_MIXED_ENTRANCE_POOLS].Unhide();
}
// Show mixed entrance pool options if mixed entrance pools are enabled, but only the ones that aren't off
if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("MixedEntrances"), RO_GENERIC_OFF) == RO_GENERIC_OFF || mOptions[RSK_MIXED_ENTRANCE_POOLS].IsHidden()) {
mOptions[RSK_MIXED_ENTRANCE_POOLS].AddFlag(IMFLAG_SEPARATOR_BOTTOM);
mOptions[RSK_MIX_DUNGEON_ENTRANCES].Hide();
mOptions[RSK_MIX_BOSS_ENTRANCES].Hide();
mOptions[RSK_MIX_OVERWORLD_ENTRANCES].Hide();
mOptions[RSK_MIX_INTERIOR_ENTRANCES].Hide();
mOptions[RSK_MIX_GROTTO_ENTRANCES].Hide();
} else {
mOptions[RSK_MIXED_ENTRANCE_POOLS].RemoveFlag(IMFLAG_SEPARATOR_BOTTOM);
mOptions[RSK_MIX_DUNGEON_ENTRANCES].RemoveFlag(IMFLAG_SEPARATOR_BOTTOM);
mOptions[RSK_MIX_BOSS_ENTRANCES].RemoveFlag(IMFLAG_SEPARATOR_BOTTOM);
mOptions[RSK_MIX_OVERWORLD_ENTRANCES].RemoveFlag(IMFLAG_SEPARATOR_BOTTOM);
mOptions[RSK_MIX_INTERIOR_ENTRANCES].RemoveFlag(IMFLAG_SEPARATOR_BOTTOM);
mOptions[RSK_MIX_GROTTO_ENTRANCES].RemoveFlag(IMFLAG_SEPARATOR_BOTTOM);
RandomizerSettingKey lastKey = RSK_MIXED_ENTRANCE_POOLS;
if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleDungeonsEntrances"), RO_DUNGEON_ENTRANCE_SHUFFLE_OFF) == RO_DUNGEON_ENTRANCE_SHUFFLE_OFF) {
mOptions[RSK_MIX_DUNGEON_ENTRANCES].Hide();
} else {
mOptions[RSK_MIX_DUNGEON_ENTRANCES].Unhide();
lastKey = RSK_MIX_DUNGEON_ENTRANCES;
}
if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleBossEntrances"), RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF) == RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF) {
mOptions[RSK_MIX_BOSS_ENTRANCES].Hide();
} else {
mOptions[RSK_MIX_BOSS_ENTRANCES].Unhide();
lastKey = RSK_MIX_BOSS_ENTRANCES;
}
if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleOverworldEntrances"), RO_GENERIC_OFF) == RO_GENERIC_OFF) {
mOptions[RSK_MIX_OVERWORLD_ENTRANCES].Hide();
} else {
mOptions[RSK_MIX_OVERWORLD_ENTRANCES].Unhide();
lastKey = RSK_MIX_OVERWORLD_ENTRANCES;
}
if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleInteriorsEntrances"), RO_GENERIC_OFF) == RO_GENERIC_OFF) {
mOptions[RSK_MIX_INTERIOR_ENTRANCES].Hide();
} else {
mOptions[RSK_MIX_INTERIOR_ENTRANCES].Unhide();
lastKey = RSK_MIX_INTERIOR_ENTRANCES;
}
if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleGrottosEntrances"), RO_GENERIC_OFF) == RO_GENERIC_OFF) {
mOptions[RSK_MIX_GROTTO_ENTRANCES].Hide();
} else {
mOptions[RSK_MIX_GROTTO_ENTRANCES].Unhide();
lastKey = RSK_MIX_GROTTO_ENTRANCES;
}
mOptions[lastKey].AddFlag(IMFLAG_SEPARATOR_BOTTOM);
}
// Shuffle Weird Egg - Disabled when Skip Child Zelda is active
if (CVarGetInteger(CVAR_RANDOMIZER_SETTING("SkipChildZelda"), RO_GENERIC_DONT_SKIP)) {
mOptions[RSK_SHUFFLE_WEIRD_EGG].Disable("This option is disabled because \"Skip Child Zelda\" is enabled.");

View File

@ -5,6 +5,7 @@
#include <soh/UIWidgets.hpp>
#include <graphic/Fast3D/gfx_pc.h>
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
/* Console Variables are grouped under gAdvancedResolution. (e.g. CVAR_PREFIX_ADVANCED_RESOLUTION ".Enabled")

View File

@ -310,6 +310,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li
case ACTOR_BG_SPOT05_SOKO:
case ACTOR_BG_SPOT18_BASKET:
case ACTOR_BG_HIDAN_CURTAIN:
case ACTOR_BG_MORI_HINERI:
*should = false;
RateLimitedSuccessChime();
break;
@ -907,114 +908,136 @@ void TimeSaverOnSceneInitHandler(int16_t sceneNum) {
GetItemEntry vanillaQueuedItemEntry = GET_ITEM_NONE;
void TimeSaverOnFlagSetHandler(int16_t flagType, int16_t flag) {
if (!CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) return;
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) {
switch (flagType) {
case FLAG_EVENT_CHECK_INF:
switch (flag) {
case EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FAIRY_OCARINA).GetGIEntry_Copy();
break;
case EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_KOKIRI_EMERALD).GetGIEntry_Copy();
break;
case EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_GORON_RUBY).GetGIEntry_Copy();
break;
case EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_ZORA_SAPPHIRE).GetGIEntry_Copy();
break;
case EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FOREST_MEDALLION).GetGIEntry_Copy();
break;
case EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FIRE_MEDALLION).GetGIEntry_Copy();
break;
case EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_WATER_MEDALLION).GetGIEntry_Copy();
break;
case EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_LIGHT_ARROWS).GetGIEntry_Copy();
break;
case EVENTCHKINF_TIME_TRAVELED_TO_ADULT:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_LIGHT_MEDALLION).GetGIEntry_Copy();
break;
}
break;
case FLAG_RANDOMIZER_INF:
switch (flag) {
case RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SHADOW_MEDALLION).GetGIEntry_Copy();
break;
case RAND_INF_DUNGEONS_DONE_SPIRIT_TEMPLE:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SPIRIT_MEDALLION).GetGIEntry_Copy();
break;
}
break;
}
}
switch (flagType) {
case FLAG_EVENT_CHECK_INF:
switch (flag) {
case EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FAIRY_OCARINA).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_ZELDAS_LULLABY:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_ZELDAS_LULLABY).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_MINUET_OF_FOREST:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_MINUET_OF_FOREST).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_BOLERO_OF_FIRE:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_BOLERO_OF_FIRE).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_SERENADE_OF_WATER:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SERENADE_OF_WATER).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_REQUIEM_OF_SPIRIT).GetGIEntry_Copy();
break;
case EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_NOCTURNE_OF_SHADOW).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_PRELUDE_OF_LIGHT).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_SARIAS_SONG:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SARIAS_SONG).GetGIEntry_Copy();
break;
case EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_KOKIRI_EMERALD).GetGIEntry_Copy();
break;
case EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_GORON_RUBY).GetGIEntry_Copy();
break;
case EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_ZORA_SAPPHIRE).GetGIEntry_Copy();
break;
case EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FOREST_MEDALLION).GetGIEntry_Copy();
break;
case EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FIRE_MEDALLION).GetGIEntry_Copy();
break;
case EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_WATER_MEDALLION).GetGIEntry_Copy();
break;
case EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_LIGHT_ARROWS).GetGIEntry_Copy();
break;
case EVENTCHKINF_TIME_TRAVELED_TO_ADULT:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_LIGHT_MEDALLION).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_SONG_OF_TIME:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SONG_OF_TIME).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_SONG_OF_STORMS:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SONG_OF_STORMS).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_SUNS_SONG:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SUNS_SONG).GetGIEntry_Copy();
break;
}
break;
case FLAG_RANDOMIZER_INF:
switch (flag) {
case RAND_INF_LEARNED_EPONA_SONG:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_EPONAS_SONG).GetGIEntry_Copy();
break;
case RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SHADOW_MEDALLION).GetGIEntry_Copy();
break;
case RAND_INF_DUNGEONS_DONE_SPIRIT_TEMPLE:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SPIRIT_MEDALLION).GetGIEntry_Copy();
break;
case RAND_INF_ZF_GREAT_FAIRY_REWARD:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FARORES_WIND).GetGIEntry_Copy();
break;
case RAND_INF_HC_GREAT_FAIRY_REWARD:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_DINS_FIRE).GetGIEntry_Copy();
break;
case RAND_INF_COLOSSUS_GREAT_FAIRY_REWARD:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_NAYRUS_LOVE).GetGIEntry_Copy();
break;
case RAND_INF_DMT_GREAT_FAIRY_REWARD:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_MAGIC_SINGLE).GetGIEntry_Copy();
break;
case RAND_INF_DMC_GREAT_FAIRY_REWARD:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_MAGIC_DOUBLE).GetGIEntry_Copy();
break;
case RAND_INF_OGC_GREAT_FAIRY_REWARD:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_DOUBLE_DEFENSE).GetGIEntry_Copy();
break;
}
break;
case FLAG_ITEM_GET_INF:
switch (flag) {
case ITEMGETINF_OBTAINED_STICK_UPGRADE_FROM_STAGE:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_DEKU_STICK_CAPACITY_30).GetGIEntry_Copy();
break;
case ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_DEKU_NUT_CAPACITY_40).GetGIEntry_Copy();
break;
}
break;
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO)) {
switch (flagType) {
case FLAG_RANDOMIZER_INF:
switch (flag) {
case RAND_INF_ZF_GREAT_FAIRY_REWARD:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FARORES_WIND).GetGIEntry_Copy();
break;
case RAND_INF_HC_GREAT_FAIRY_REWARD:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_DINS_FIRE).GetGIEntry_Copy();
break;
case RAND_INF_COLOSSUS_GREAT_FAIRY_REWARD:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_NAYRUS_LOVE).GetGIEntry_Copy();
break;
case RAND_INF_DMT_GREAT_FAIRY_REWARD:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_MAGIC_SINGLE).GetGIEntry_Copy();
break;
case RAND_INF_DMC_GREAT_FAIRY_REWARD:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_MAGIC_DOUBLE).GetGIEntry_Copy();
break;
case RAND_INF_OGC_GREAT_FAIRY_REWARD:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_DOUBLE_DEFENSE).GetGIEntry_Copy();
break;
}
break;
case FLAG_ITEM_GET_INF:
switch (flag) {
case ITEMGETINF_OBTAINED_STICK_UPGRADE_FROM_STAGE:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_DEKU_STICK_CAPACITY_30).GetGIEntry_Copy();
break;
case ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_DEKU_NUT_CAPACITY_40).GetGIEntry_Copy();
break;
}
break;
}
}
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO)) {
switch (flagType) {
case FLAG_EVENT_CHECK_INF:
switch (flag) {
case EVENTCHKINF_LEARNED_ZELDAS_LULLABY:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_ZELDAS_LULLABY).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_MINUET_OF_FOREST:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_MINUET_OF_FOREST).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_BOLERO_OF_FIRE:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_BOLERO_OF_FIRE).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_SERENADE_OF_WATER:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SERENADE_OF_WATER).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_REQUIEM_OF_SPIRIT).GetGIEntry_Copy();
break;
case EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_NOCTURNE_OF_SHADOW).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_PRELUDE_OF_LIGHT).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_SARIAS_SONG:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SARIAS_SONG).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_SONG_OF_TIME:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SONG_OF_TIME).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_SONG_OF_STORMS:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SONG_OF_STORMS).GetGIEntry_Copy();
break;
case EVENTCHKINF_LEARNED_SUNS_SONG:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SUNS_SONG).GetGIEntry_Copy();
break;
}
break;
case FLAG_RANDOMIZER_INF:
switch (flag) {
case RAND_INF_LEARNED_EPONA_SONG:
vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_EPONAS_SONG).GetGIEntry_Copy();
break;
}
break;
}
}
}

View File

@ -745,14 +745,18 @@ void TimeSplitsDrawOptionsMenu() {
ImGui::SeparatorText("Window Options");
if (ImGui::ColorEdit4("Background Color", (float*)&windowColor, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel)) {
Color_RGBA8 color;
color.r = windowColor.x;
color.g = windowColor.y;
color.b = windowColor.z;
color.a = windowColor.w;
color.r = windowColor.x * 255.0;
color.g = windowColor.y * 255.0;
color.b = windowColor.z * 255.0;
color.a = windowColor.w * 255.0;
CVarSetColor("TimeSplits.WindowColor", color);
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
}
ImGui::SameLine();
if (ImGui::Button("Reset")) {
windowColor = { 0.0f, 0.0f, 0.0f, 1.0f };
CVarSetColor("TimeSplits.WindowColor", {0, 0, 0, 1});
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
}
if (UIWidgets::PaddedEnhancementSliderFloat("Window Size: %.1fx", "##windowSize",
@ -914,6 +918,9 @@ static bool initialized = false;
void TimeSplitWindow::DrawElement() {
ImGui::SetWindowFontScale(timeSplitsWindowSize);
if (!initialized) {
Color_RGBA8 defaultColour = {0, 0, 0, 255};
Color_RGBA8 color = CVarGetColor("TimeSplits.WindowColor", defaultColour);
windowColor = {(float)color.r / 255.0f, (float)color.g / 255.0f, (float)color.b / 255.0f, (float)color.a / 255.0f};
InitializeSplitDataFile();
initialized = true;
}

View File

@ -1,6 +1,7 @@
#include "ImGuiUtils.h"
#include <Context.h>
#include "assets/soh_assets.h"
#include "soh/Enhancements/randomizer/rando_hash.h"
std::map<uint32_t, ItemMapEntry> itemMapping = {
ITEM_MAP_ENTRY(ITEM_STICK),
@ -150,7 +151,7 @@ std::map<uint32_t, QuestMapEntry> questMapping = {
QUEST_MAP_ENTRY(QUEST_SKULL_TOKEN, dgQuestIconGoldSkulltulaTex),
};
std::array<SongMapEntry, 12> songMapping = { {
std::map<QuestItem, SongMapEntry> songMapping = {
SONG_MAP_ENTRY(QUEST_SONG_LULLABY, 224, 107, 255),
SONG_MAP_ENTRY(QUEST_SONG_EPONA, 255, 195, 60),
SONG_MAP_ENTRY(QUEST_SONG_SARIA, 127, 255, 137),
@ -163,7 +164,7 @@ std::array<SongMapEntry, 12> songMapping = { {
SONG_MAP_ENTRY(QUEST_SONG_REQUIEM, 255, 160, 0),
SONG_MAP_ENTRY(QUEST_SONG_NOCTURNE, 255, 100, 255),
SONG_MAP_ENTRY(QUEST_SONG_PRELUDE, 255, 240, 100),
} };
};
std::array<SongMapEntry, 12> vanillaSongMapping = { {
VANILLA_SONG_MAP_ENTRY(QUEST_SONG_LULLABY, 255, 255, 255),
@ -212,7 +213,7 @@ void RegisterImGuiItemIcons() {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f));
}
for (const auto& entry : songMapping) {
for (const auto& [quest, entry] : songMapping) {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.name, gSongNoteTex, entry.color);
ImVec4 fadedCol = entry.color;
fadedCol.w = 0.3f;
@ -225,4 +226,8 @@ void RegisterImGuiItemIcons() {
fadedCol.w = 0.3f;
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.nameFaded, gSongNoteTex, fadedCol);
}
for (const auto& entry : gSeedTextures) {
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture(entry.tex, entry.tex, ImVec4(1, 1, 1, 1));
}
}

View File

@ -67,11 +67,11 @@ typedef struct {
#define SONG_MAP_ENTRY(id, r, g, b) \
{ \
id, #id, #id "_Faded", ImVec4(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f) \
id, { id, #id, #id "_Faded", ImVec4(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f) } \
}
// Maps song ids to info for use in ImGui
extern std::array<SongMapEntry, 12> songMapping;
extern std::map<QuestItem, SongMapEntry> songMapping;
#define VANILLA_SONG_MAP_ENTRY(id, r, g, b) \
{ \

View File

@ -6,17 +6,14 @@
#include <fstream>
#include <chrono>
#include <ResourceManager.h>
#include "ResourceManagerHelpers.h"
#include "graphic/Fast3D/Fast3dWindow.h"
#include <File.h>
#include <DisplayList.h>
#include <Window.h>
#include <GameVersions.h>
#include "z64animation.h"
#include "z64bgcheck.h"
#include "Enhancements/gameconsole.h"
#include <libultraship/libultra/gbi.h>
#ifdef _WIN32
#include <Windows.h>
#else
@ -27,7 +24,6 @@
#include "Enhancements/controls/SohInputEditorWindow.h"
#include "Enhancements/cosmetics/CosmeticsEditor.h"
#include "Enhancements/audio/AudioCollection.h"
#include "Enhancements/audio/AudioEditor.h"
#include "Enhancements/enhancementTypes.h"
#include "Enhancements/debugconsole.h"
#include "Enhancements/randomizer/randomizer.h"
@ -56,7 +52,6 @@
#endif
#include <Fast3D/gfx_pc.h>
#include <Fast3D/gfx_rendering_api.h>
#ifdef __APPLE__
#include <SDL_scancode.h>
@ -77,6 +72,7 @@
#include "Enhancements/item-tables/ItemTableManager.h"
#include "SohGui.hpp"
#include "ActorDB.h"
#include "SaveManager.h"
#ifdef ENABLE_REMOTE_CONTROL
#include "soh/Network/CrowdControl/CrowdControl.h"
@ -506,18 +502,11 @@ uint32_t OTRGlobals::GetInterpolationFPS() {
return std::min<uint32_t>(Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), CVarGetInteger(CVAR_SETTING("InterpolationFPS"), 20));
}
struct ExtensionEntry {
std::string path;
std::string ext;
};
extern "C" void OTRMessage_Init();
extern "C" void AudioMgr_CreateNextAudioBuffer(s16* samples, u32 num_samples);
extern "C" void AudioPlayer_Play(const uint8_t* buf, uint32_t len);
extern "C" int AudioPlayer_Buffered(void);
extern "C" int AudioPlayer_GetDesiredBuffered(void);
extern "C" void ResourceMgr_LoadDirectory(const char* resName);
extern "C" SequenceData ResourceMgr_LoadSeqByName(const char* path);
std::unordered_map<std::string, ExtensionEntry> ExtensionCache;
void OTRAudio_Thread() {
@ -1491,269 +1480,7 @@ extern "C" uint16_t OTRGetPixelDepth(float x, float y) {
return wnd->GetPixelDepth(x, y);
}
extern "C" uint32_t ResourceMgr_GetNumGameVersions() {
return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions().size();
}
extern "C" uint32_t ResourceMgr_GetGameVersion(int index) {
return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index];
}
extern "C" uint32_t ResourceMgr_GetGamePlatform(int index) {
uint32_t version = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index];
switch (version) {
case OOT_NTSC_US_10:
case OOT_NTSC_US_11:
case OOT_NTSC_US_12:
case OOT_PAL_10:
case OOT_PAL_11:
return GAME_PLATFORM_N64;
case OOT_NTSC_JP_GC:
case OOT_NTSC_US_GC:
case OOT_PAL_GC:
case OOT_NTSC_JP_MQ:
case OOT_NTSC_US_MQ:
case OOT_PAL_MQ:
case OOT_PAL_GC_DBG1:
case OOT_PAL_GC_DBG2:
case OOT_PAL_GC_MQ_DBG:
return GAME_PLATFORM_GC;
}
}
extern "C" uint32_t ResourceMgr_GetGameRegion(int index) {
uint32_t version = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index];
switch (version) {
case OOT_NTSC_US_10:
case OOT_NTSC_US_11:
case OOT_NTSC_US_12:
case OOT_NTSC_JP_GC:
case OOT_NTSC_US_GC:
case OOT_NTSC_JP_MQ:
case OOT_NTSC_US_MQ:
return GAME_REGION_NTSC;
case OOT_PAL_10:
case OOT_PAL_11:
case OOT_PAL_GC:
case OOT_PAL_MQ:
case OOT_PAL_GC_DBG1:
case OOT_PAL_GC_DBG2:
case OOT_PAL_GC_MQ_DBG:
return GAME_REGION_PAL;
}
}
uint32_t IsSceneMasterQuest(s16 sceneNum) {
uint32_t value = 0;
uint8_t mqMode = CVarGetInteger(CVAR_GENERAL("BetterDebugWarpScreenMQMode"), WARP_MODE_OVERRIDE_OFF);
if (mqMode == WARP_MODE_OVERRIDE_MQ_AS_VANILLA) {
return 1;
} else if (mqMode == WARP_MODE_OVERRIDE_VANILLA_AS_MQ) {
return 0;
} else {
if (OTRGlobals::Instance->HasMasterQuest()) {
if (!OTRGlobals::Instance->HasOriginal()) {
value = 1;
} else if (IS_MASTER_QUEST) {
value = 1;
} else {
value = 0;
if (IS_RANDO) {
auto dungeon = OTRGlobals::Instance->gRandoContext->GetDungeons()->GetDungeonFromScene(sceneNum);
if (dungeon != nullptr && dungeon->IsMQ()) {
value = 1;
}
}
}
}
}
return value;
}
uint32_t IsGameMasterQuest() {
return gPlayState != NULL ? IsSceneMasterQuest(gPlayState->sceneNum) : 0;
}
extern "C" uint32_t ResourceMgr_GameHasMasterQuest() {
return OTRGlobals::Instance->HasMasterQuest();
}
extern "C" uint32_t ResourceMgr_GameHasOriginal() {
return OTRGlobals::Instance->HasOriginal();
}
extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum) {
return IsSceneMasterQuest(sceneNum);
}
extern "C" uint32_t ResourceMgr_IsGameMasterQuest() {
return IsGameMasterQuest();
}
extern "C" void ResourceMgr_LoadDirectory(const char* resName) {
Ship::Context::GetInstance()->GetResourceManager()->LoadDirectory(resName);
}
extern "C" void ResourceMgr_DirtyDirectory(const char* resName) {
Ship::Context::GetInstance()->GetResourceManager()->DirtyDirectory(resName);
}
extern "C" void ResourceMgr_UnloadResource(const char* resName) {
std::string path = resName;
if (path.substr(0, 7) == "__OTR__") {
path = path.substr(7);
}
auto res = Ship::Context::GetInstance()->GetResourceManager()->UnloadResource(path);
}
// OTRTODO: There is probably a more elegant way to go about this...
// Kenix: This is definitely leaking memory when it's called.
extern "C" char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize) {
auto lst = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles(searchMask);
char** result = (char**)malloc(lst->size() * sizeof(char*));
for (size_t i = 0; i < lst->size(); i++) {
char* str = (char*)malloc(lst.get()[0][i].size() + 1);
memcpy(str, lst.get()[0][i].data(), lst.get()[0][i].size());
str[lst.get()[0][i].size()] = '\0';
result[i] = str;
}
*resultSize = lst->size();
return result;
}
extern "C" uint8_t ResourceMgr_FileExists(const char* filePath) {
std::string path = filePath;
if(path.substr(0, 7) == "__OTR__"){
path = path.substr(7);
}
return ExtensionCache.contains(path);
}
extern "C" uint8_t ResourceMgr_FileAltExists(const char* filePath) {
std::string path = filePath;
if (path.substr(0, 7) == "__OTR__") {
path = path.substr(7);
}
if (path.substr(0, 4) != "alt/") {
path = "alt/" + path;
}
return ExtensionCache.contains(path);
}
extern "C" bool ResourceMgr_IsAltAssetsEnabled() {
return Ship::Context::GetInstance()->GetResourceManager()->IsAltAssetsEnabled();
}
// Unloads a resource if an alternate version exists when alt assets are enabled
// The resource is only removed from the internal cache to prevent it from used in the next resource lookup
extern "C" void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName) {
if (ResourceMgr_IsAltAssetsEnabled() && ResourceMgr_FileAltExists((char*)resName)) {
ResourceMgr_UnloadResource((char*) resName);
}
}
std::shared_ptr<Ship::IResource> GetResourceByNameHandlingMQ(const char* path) {
std::string Path = path;
if (ResourceMgr_IsGameMasterQuest()) {
size_t pos = 0;
if ((pos = Path.find("/nonmq/", 0)) != std::string::npos) {
Path.replace(pos, 7, "/mq/");
}
}
return Ship::Context::GetInstance()->GetResourceManager()->LoadResource(Path.c_str());
}
extern "C" char* GetResourceDataByNameHandlingMQ(const char* path) {
auto res = GetResourceByNameHandlingMQ(path);
if (res == nullptr) {
return nullptr;
}
return (char*)res->GetRawPointer();
}
extern "C" uint8_t ResourceMgr_TexIsRaw(const char* texPath) {
auto res = std::static_pointer_cast<LUS::Texture>(GetResourceByNameHandlingMQ(texPath));
return res->Flags & TEX_FLAG_LOAD_AS_RAW;
}
extern "C" uint8_t ResourceMgr_ResourceIsBackground(char* texPath) {
auto res = GetResourceByNameHandlingMQ(texPath);
return res->GetInitData()->Type == static_cast<uint32_t>(SOH::ResourceType::SOH_Background);
}
extern "C" char* ResourceMgr_LoadJPEG(char* data, size_t dataSize)
{
static char* finalBuffer = 0;
if (finalBuffer == 0)
finalBuffer = (char*)malloc(dataSize);
int w;
int h;
int comp;
unsigned char* pixels = stbi_load_from_memory((const unsigned char*)data, 320 * 240 * 2, &w, &h, &comp, STBI_rgb_alpha);
//unsigned char* pixels = stbi_load_from_memory((const unsigned char*)data, 480 * 240 * 2, &w, &h, &comp, STBI_rgb_alpha);
int idx = 0;
for (int y = 0; y < h; y++)
{
for (int x = 0; x < w; x++)
{
uint16_t* bufferTest = (uint16_t*)finalBuffer;
int pixelIdx = ((y * w) + x) * 4;
uint8_t r = pixels[pixelIdx + 0] / 8;
uint8_t g = pixels[pixelIdx + 1] / 8;
uint8_t b = pixels[pixelIdx + 2] / 8;
uint8_t alphaBit = pixels[pixelIdx + 3] != 0;
uint16_t data = (r << 11) + (g << 6) + (b << 1) + alphaBit;
finalBuffer[idx++] = (data & 0xFF00) >> 8;
finalBuffer[idx++] = (data & 0x00FF);
}
}
return (char*)finalBuffer;
}
extern "C" uint16_t ResourceMgr_LoadTexWidthByName(char* texPath);
extern "C" uint16_t ResourceMgr_LoadTexHeightByName(char* texPath);
extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) {
auto res = GetResourceByNameHandlingMQ(filePath);
if (res->GetInitData()->Type == static_cast<uint32_t>(LUS::ResourceType::DisplayList))
return (char*)&((std::static_pointer_cast<LUS::DisplayList>(res))->Instructions[0]);
else if (res->GetInitData()->Type == static_cast<uint32_t>(SOH::ResourceType::SOH_Array))
return (char*)(std::static_pointer_cast<SOH::Array>(res))->Vertices.data();
else {
return (char*)GetResourceDataByNameHandlingMQ(filePath);
}
}
extern "C" char* ResourceMgr_LoadIfDListByName(const char* filePath) {
auto res = GetResourceByNameHandlingMQ(filePath);
if (res->GetInitData()->Type == static_cast<uint32_t>(LUS::ResourceType::DisplayList))
return (char*)&((std::static_pointer_cast<LUS::DisplayList>(res))->Instructions[0]);
return nullptr;
}
extern "C" Sprite* GetSeedTexture(uint8_t index) {
return OTRGlobals::Instance->gRandoContext->GetSeedTexture(index);
}
@ -1761,157 +1488,6 @@ extern "C" uint8_t GetSeedIconIndex(uint8_t index) {
return OTRGlobals::Instance->gRandoContext->hashIconIndexes[index];
}
extern "C" char* ResourceMgr_LoadPlayerAnimByName(const char* animPath) {
auto anim = std::static_pointer_cast<SOH::PlayerAnimation>(GetResourceByNameHandlingMQ(animPath));
return (char*)&anim->limbRotData[0];
}
extern "C" void ResourceMgr_PushCurrentDirectory(char* path)
{
gfx_push_current_dir(path);
}
extern "C" Gfx* ResourceMgr_LoadGfxByName(const char* path)
{
// When an alt resource exists for the DL, we need to unload the original asset
// to clear the cache so the alt asset will be loaded instead
// OTRTODO: If Alt loading over original cache is fixed, this line can most likely be removed
ResourceMgr_UnloadOriginalWhenAltExists(path);
auto res = std::static_pointer_cast<LUS::DisplayList>(GetResourceByNameHandlingMQ(path));
return (Gfx*)&res->Instructions[0];
}
extern "C" uint8_t ResourceMgr_FileIsCustomByName(const char* path) {
auto res = std::static_pointer_cast<LUS::DisplayList>(GetResourceByNameHandlingMQ(path));
return res->GetInitData()->IsCustom;
}
typedef struct {
int index;
Gfx instruction;
} GfxPatch;
std::unordered_map<std::string, std::unordered_map<std::string, GfxPatch>> originalGfx;
// Attention! This is primarily for cosmetics & bug fixes. For things like mods and model replacement you should be using OTRs
// instead (When that is available). Index can be found using the commented out section below.
extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction) {
auto res = std::static_pointer_cast<LUS::DisplayList>(
Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path));
// Leaving this here for people attempting to find the correct Dlist index to patch
/*if (strcmp("__OTR__objects/object_gi_longsword/gGiBiggoronSwordDL", path) == 0) {
for (int i = 0; i < res->instructions.size(); i++) {
Gfx* gfx = (Gfx*)&res->instructions[i];
// Log all commands
// SPDLOG_INFO("index:{} command:{}", i, gfx->words.w0 >> 24);
// Log only SetPrimColors
if (gfx->words.w0 >> 24 == 250) {
SPDLOG_INFO("index:{} r:{} g:{} b:{} a:{}", i, _SHIFTR(gfx->words.w1, 24, 8), _SHIFTR(gfx->words.w1, 16, 8), _SHIFTR(gfx->words.w1, 8, 8), _SHIFTR(gfx->words.w1, 0, 8));
}
}
}*/
// Index refers to individual gfx words, which are half the size on 32-bit
// if (sizeof(uintptr_t) < 8) {
// index /= 2;
// }
// Do not patch custom assets as they most likely do not have the same instructions as authentic assets
if (res->GetInitData()->IsCustom) {
return;
}
Gfx* gfx = (Gfx*)&res->Instructions[index];
if (!originalGfx.contains(path) || !originalGfx[path].contains(patchName)) {
originalGfx[path][patchName] = {
index,
*gfx
};
}
*gfx = instruction;
}
extern "C" void ResourceMgr_PatchGfxCopyCommandByName(const char* path, const char* patchName, int destinationIndex, int sourceIndex) {
auto res = std::static_pointer_cast<LUS::DisplayList>(
Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path));
// Do not patch custom assets as they most likely do not have the same instructions as authentic assets
if (res->GetInitData()->IsCustom) {
return;
}
Gfx* destinationGfx = (Gfx*)&res->Instructions[destinationIndex];
Gfx sourceGfx = *(Gfx*)&res->Instructions[sourceIndex];
if (!originalGfx.contains(path) || !originalGfx[path].contains(patchName)) {
originalGfx[path][patchName] = {
destinationIndex,
*destinationGfx
};
}
*destinationGfx = sourceGfx;
}
extern "C" void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName) {
if (originalGfx.contains(path) && originalGfx[path].contains(patchName)) {
auto res = std::static_pointer_cast<LUS::DisplayList>(
Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path));
Gfx* gfx = (Gfx*)&res->Instructions[originalGfx[path][patchName].index];
*gfx = originalGfx[path][patchName].instruction;
originalGfx[path].erase(patchName);
}
}
extern "C" char* ResourceMgr_LoadArrayByName(const char* path)
{
auto res = std::static_pointer_cast<SOH::Array>(GetResourceByNameHandlingMQ(path));
return (char*)res->Scalars.data();
}
// Return of LoadArrayByNameAsVec3s must be freed by the caller
extern "C" char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path) {
auto res = std::static_pointer_cast<SOH::Array>(GetResourceByNameHandlingMQ(path));
// if (res->CachedGameAsset != nullptr)
// return (char*)res->CachedGameAsset;
// else
// {
Vec3s* data = (Vec3s*)malloc(sizeof(Vec3s) * res->Scalars.size());
for (size_t i = 0; i < res->Scalars.size(); i += 3) {
data[(i / 3)].x = res->Scalars[i + 0].s16;
data[(i / 3)].y = res->Scalars[i + 1].s16;
data[(i / 3)].z = res->Scalars[i + 2].s16;
}
// res->CachedGameAsset = data;
return (char*)data;
// }
}
extern "C" CollisionHeader* ResourceMgr_LoadColByName(const char* path) {
return (CollisionHeader*) ResourceGetDataByName(path);
}
extern "C" Vtx* ResourceMgr_LoadVtxByName(char* path) {
return (Vtx*) ResourceGetDataByName(path);
}
extern "C" SequenceData ResourceMgr_LoadSeqByName(const char* path) {
SequenceData* sequence = (SequenceData*) ResourceGetDataByName(path);
return *sequence;
}
std::map<std::string, SoundFontSample*> cachedCustomSFs;
extern "C" SoundFontSample* ReadCustomSample(const char* path) {
@ -1972,81 +1548,6 @@ extern "C" SoundFontSample* ReadCustomSample(const char* path) {
*/
}
extern "C" SoundFontSample* ResourceMgr_LoadAudioSample(const char* path) {
return (SoundFontSample*) ResourceGetDataByName(path);
}
extern "C" SoundFont* ResourceMgr_LoadAudioSoundFont(const char* path) {
return (SoundFont*) ResourceGetDataByName(path);
}
extern "C" int ResourceMgr_OTRSigCheck(char* imgData)
{
uintptr_t i = (uintptr_t)(imgData);
// if (i == 0xD9000000 || i == 0xE7000000 || (i & 1) == 1)
if ((i & 1) == 1)
return 0;
// if ((i & 0xFF000000) != 0xAB000000 && (i & 0xFF000000) != 0xCD000000 && i != 0) {
if (i != 0) {
if (imgData[0] == '_' && imgData[1] == '_' && imgData[2] == 'O' && imgData[3] == 'T' && imgData[4] == 'R' &&
imgData[5] == '_' && imgData[6] == '_')
return 1;
}
return 0;
}
extern "C" AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path) {
return (AnimationHeaderCommon*) ResourceGetDataByName(path);
}
extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, SkelAnime* skelAnime) {
std::string pathStr = std::string(path);
static const std::string sOtr = "__OTR__";
if (pathStr.starts_with(sOtr)) {
pathStr = pathStr.substr(sOtr.length());
}
bool isAlt = ResourceMgr_IsAltAssetsEnabled();
if (isAlt) {
pathStr = Ship::IResource::gAltAssetPrefix + pathStr;
}
SkeletonHeader* skelHeader = (SkeletonHeader*) ResourceGetDataByName(pathStr.c_str());
// If there isn't an alternate model, load the regular one
if (isAlt && skelHeader == NULL) {
skelHeader = (SkeletonHeader*) ResourceGetDataByName(path);
}
// This function is only called when a skeleton is initialized.
// Therefore we can take this oppurtunity to take note of the Skeleton that is created...
if (skelAnime != nullptr) {
auto stringPath = std::string(path);
SOH::SkeletonPatcher::RegisterSkeleton(stringPath, skelAnime);
}
return skelHeader;
}
extern "C" void ResourceMgr_UnregisterSkeleton(SkelAnime* skelAnime) {
if (skelAnime != nullptr)
SOH::SkeletonPatcher::UnregisterSkeleton(skelAnime);
}
extern "C" void ResourceMgr_ClearSkeletons(SkelAnime* skelAnime) {
if (skelAnime != nullptr)
SOH::SkeletonPatcher::ClearSkeletons();
}
extern "C" s32* ResourceMgr_LoadCSByName(const char* path) {
return (s32*)GetResourceDataByNameHandlingMQ(path);
}
std::filesystem::path GetSaveFile(std::shared_ptr<Ship::Config> Conf) {
const std::string fileName = Conf->GetString("Game.SaveName", Ship::Context::GetPathRelativeToAppDirectory("oot_save.sav"));
std::filesystem::path saveFile = std::filesystem::absolute(fileName);
@ -2897,7 +2398,7 @@ extern "C" void Gfx_TextureCacheDelete(const uint8_t* texAddr) {
}
if (ResourceMgr_OTRSigCheck(imgName)) {
texAddr = (const uint8_t*)GetResourceDataByNameHandlingMQ(imgName);
texAddr = (const uint8_t*)ResourceMgr_GetResourceDataByNameHandlingMQ(imgName);
}
gfx_texture_cache_delete(texAddr);

View File

@ -3,15 +3,6 @@
#pragma once
#include "SaveManager.h"
#include <soh/Enhancements/item-tables/ItemTableTypes.h>
#define GAME_REGION_NTSC 0
#define GAME_REGION_PAL 1
#define GAME_PLATFORM_N64 0
#define GAME_PLATFORM_GC 1
#define BTN_CUSTOM_MODIFIER1 0x0040
#define BTN_CUSTOM_MODIFIER2 0x0080
@ -29,6 +20,14 @@
#include "Enhancements/savestates.h"
#include "Enhancements/randomizer/randomizer.h"
#include <vector>
#include <string>
struct ExtensionEntry {
std::string path;
std::string ext;
};
extern std::unordered_map<std::string, ExtensionEntry> ExtensionCache;
#include "Enhancements/randomizer/context.h"
const std::string customMessageTableID = "BaseGameOverrides";
@ -42,60 +41,39 @@ const uint32_t defaultImGuiScale = 1;
const float imguiScaleOptionToValue[4] = { 0.75f, 1.0f, 1.5f, 2.0f };
class OTRGlobals
{
public:
static OTRGlobals* Instance;
class OTRGlobals {
public:
static OTRGlobals* Instance;
std::shared_ptr<Ship::Context> context;
std::shared_ptr<SaveStateMgr> gSaveStateMgr;
std::shared_ptr<Randomizer> gRandomizer;
std::shared_ptr<Rando::Context> gRandoContext;
ImFont* defaultFontSmaller;
ImFont* defaultFontLarger;
ImFont* defaultFontLargest;
ImFont* defaultFontSmaller;
ImFont* defaultFontLarger;
ImFont* defaultFontLargest;
OTRGlobals();
~OTRGlobals();
void ScaleImGui();
OTRGlobals();
~OTRGlobals();
bool HasMasterQuest();
bool HasOriginal();
uint32_t GetInterpolationFPS();
std::shared_ptr<std::vector<std::string>> ListFiles(std::string path);
void ScaleImGui();
private:
void CheckSaveFile(size_t sramSize) const;
bool hasMasterQuest;
bool hasOriginal;
ImFont* CreateDefaultFontWithSize(float size);
bool HasMasterQuest();
bool HasOriginal();
uint32_t GetInterpolationFPS();
std::shared_ptr<std::vector<std::string>> ListFiles(std::string path);
private:
void CheckSaveFile(size_t sramSize) const;
bool hasMasterQuest;
bool hasOriginal;
ImFont* CreateDefaultFontWithSize(float size);
};
uint32_t IsGameMasterQuest();
#endif
#define CVAR_RANDOMIZER_ENHANCEMENT(var) CVAR_PREFIX_RANDOMIZER_ENHANCEMENT "." var
#define CVAR_RANDOMIZER_SETTING(var) CVAR_PREFIX_RANDOMIZER_SETTING "." var
#define CVAR_COSMETIC(var) CVAR_PREFIX_COSMETIC "." var
#define CVAR_AUDIO(var) CVAR_PREFIX_AUDIO "." var
#define CVAR_CHEAT(var) CVAR_PREFIX_CHEAT "." var
#define CVAR_ENHANCEMENT(var) CVAR_PREFIX_ENHANCEMENT "." var
#define CVAR_SETTING(var) CVAR_PREFIX_SETTING "." var
#define CVAR_WINDOW(var) CVAR_PREFIX_WINDOW "." var
#define CVAR_TRACKER(var) CVAR_PREFIX_TRACKER "." var
#define CVAR_TRACKER_ITEM(var) CVAR_TRACKER(".ItemTracker." var)
#define CVAR_TRACKER_CHECK(var) CVAR_TRACKER(".CheckTracker." var)
#define CVAR_TRACKER_ENTRANCE(var) CVAR_TRACKER(".EntranceTracker." var)
#define CVAR_DEVELOPER_TOOLS(var) CVAR_PREFIX_DEVELOPER_TOOLS "." var
#define CVAR_GENERAL(var) CVAR_PREFIX_GENERAL "." var
#define CVAR_REMOTE(var) CVAR_PREFIX_REMOTE "." var
#define CVAR_REMOTE_CROWD_CONTROL(var) CVAR_REMOTE(".CrowdControl." var)
#define CVAR_REMOTE_SAIL(var) CVAR_REMOTE(".Sail." var)
#ifndef __cplusplus
void InitOTR(void);
void InitOTR(void);
void DeinitOTR(void);
void VanillaItemTable_Init();
void OTRAudio_Init();
@ -109,53 +87,12 @@ void OTRGfxPrint(const char* str, void* printer, void (*printImpl)(void*, char))
void OTRGetPixelDepthPrepare(float x, float y);
uint16_t OTRGetPixelDepth(float x, float y);
int32_t OTRGetLastScancode();
uint32_t ResourceMgr_IsGameMasterQuest();
uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum);
uint32_t ResourceMgr_GameHasMasterQuest();
uint32_t ResourceMgr_GameHasOriginal();
uint32_t ResourceMgr_GetNumGameVersions();
uint32_t ResourceMgr_GetGameVersion(int index);
uint32_t ResourceMgr_GetGamePlatform(int index);
uint32_t ResourceMgr_GetGameRegion(int index);
void ResourceMgr_LoadDirectory(const char* resName);
void ResourceMgr_UnloadResource(const char* resName);
char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize);
uint8_t ResourceMgr_FileExists(const char* resName);
uint8_t ResourceMgr_FileAltExists(const char* resName);
void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName);
char* GetResourceDataByNameHandlingMQ(const char* path);
uint8_t ResourceMgr_TexIsRaw(const char* texPath);
uint8_t ResourceMgr_ResourceIsBackground(char* texPath);
char* ResourceMgr_LoadJPEG(char* data, size_t dataSize);
uint16_t ResourceMgr_LoadTexWidthByName(char* texPath);
uint16_t ResourceMgr_LoadTexHeightByName(char* texPath);
char* ResourceMgr_LoadTexOrDListByName(const char* filePath);
char* ResourceMgr_LoadPlayerAnimByName(const char* animPath);
AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path);
char* ResourceMgr_GetNameByCRC(uint64_t crc, char* alloc);
Gfx* ResourceMgr_LoadGfxByCRC(uint64_t crc);
Gfx* ResourceMgr_LoadGfxByName(const char* path);
uint8_t ResourceMgr_FileIsCustomByName(const char* path);
void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction);
void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName);
char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path);
Vtx* ResourceMgr_LoadVtxByCRC(uint64_t crc);
Vtx* ResourceMgr_LoadVtxByName(char* path);
SoundFont* ResourceMgr_LoadAudioSoundFont(const char* path);
SequenceData ResourceMgr_LoadSeqByName(const char* path);
SoundFontSample* ResourceMgr_LoadAudioSample(const char* path);
CollisionHeader* ResourceMgr_LoadColByName(const char* path);
void Ctx_ReadSaveFile(uintptr_t addr, void* dramAddr, size_t size);
void Ctx_WriteSaveFile(uintptr_t addr, void* dramAddr, size_t size);
uint64_t GetPerfCounter();
bool ResourceMgr_IsAltAssetsEnabled();
struct SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, SkelAnime* skelAnime);
void ResourceMgr_UnregisterSkeleton(SkelAnime* skelAnime);
void ResourceMgr_ClearSkeletons();
s32* ResourceMgr_LoadCSByName(const char* path);
int ResourceMgr_OTRSigCheck(char* imgData);
uint64_t osGetTime(void);
uint32_t osGetCount(void);
uint32_t OTRGetCurrentWidth(void);

View File

@ -0,0 +1,505 @@
#include "ResourceManagerHelpers.h"
#include "OTRGlobals.h"
#include "variables.h"
#include "z64.h"
#include "cvar_prefixes.h"
#include "Enhancements/enhancementTypes.h"
#include "Enhancements/randomizer/dungeon.h"
#include <libultraship/libultraship.h>
#include <GameVersions.h>
#include "resource/type/SohResourceType.h"
#include "resource/type/Array.h"
#include "resource/type/Skeleton.h"
#include "resource/type/PlayerAnimation.h"
#include <Fast3D/gfx_pc.h>
#include <DisplayList.h>
extern "C" PlayState* gPlayState;
extern "C" uint32_t ResourceMgr_GetNumGameVersions() {
return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions().size();
}
extern "C" uint32_t ResourceMgr_GetGameVersion(int index) {
return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index];
}
extern "C" uint32_t ResourceMgr_GetGamePlatform(int index) {
uint32_t version = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index];
switch (version) {
case OOT_NTSC_US_10:
case OOT_NTSC_US_11:
case OOT_NTSC_US_12:
case OOT_PAL_10:
case OOT_PAL_11:
return GAME_PLATFORM_N64;
case OOT_NTSC_JP_GC:
case OOT_NTSC_US_GC:
case OOT_PAL_GC:
case OOT_NTSC_JP_MQ:
case OOT_NTSC_US_MQ:
case OOT_PAL_MQ:
case OOT_PAL_GC_DBG1:
case OOT_PAL_GC_DBG2:
case OOT_PAL_GC_MQ_DBG:
return GAME_PLATFORM_GC;
}
}
extern "C" uint32_t ResourceMgr_GetGameRegion(int index) {
uint32_t version = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[index];
switch (version) {
case OOT_NTSC_US_10:
case OOT_NTSC_US_11:
case OOT_NTSC_US_12:
case OOT_NTSC_JP_GC:
case OOT_NTSC_US_GC:
case OOT_NTSC_JP_MQ:
case OOT_NTSC_US_MQ:
return GAME_REGION_NTSC;
case OOT_PAL_10:
case OOT_PAL_11:
case OOT_PAL_GC:
case OOT_PAL_MQ:
case OOT_PAL_GC_DBG1:
case OOT_PAL_GC_DBG2:
case OOT_PAL_GC_MQ_DBG:
return GAME_REGION_PAL;
}
}
u32 IsSceneMasterQuest(s16 sceneNum) {
u8 mqMode = CVarGetInteger(CVAR_GENERAL("BetterDebugWarpScreenMQMode"), WARP_MODE_OVERRIDE_OFF);
if (mqMode == WARP_MODE_OVERRIDE_MQ_AS_VANILLA) {
return true;
}
if (mqMode == WARP_MODE_OVERRIDE_VANILLA_AS_MQ) {
return false;
}
if (OTRGlobals::Instance->HasMasterQuest()) {
if (!OTRGlobals::Instance->HasOriginal()) {
return true;
}
if (IS_MASTER_QUEST) {
return true;
}
if (IS_RANDO) {
auto dungeon = OTRGlobals::Instance->gRandoContext->GetDungeons()->GetDungeonFromScene(sceneNum);
if (dungeon != nullptr && dungeon->IsMQ()) {
return true;
}
}
}
return false;
}
extern "C" uint32_t ResourceMgr_GameHasMasterQuest() {
return OTRGlobals::Instance->HasMasterQuest();
}
extern "C" uint32_t ResourceMgr_GameHasOriginal() {
return OTRGlobals::Instance->HasOriginal();
}
extern "C" uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum) {
return IsSceneMasterQuest(sceneNum);
}
extern "C" uint32_t ResourceMgr_IsGameMasterQuest() {
return gPlayState != NULL ? IsSceneMasterQuest(gPlayState->sceneNum) : 0;
}
extern "C" void ResourceMgr_LoadDirectory(const char* resName) {
Ship::Context::GetInstance()->GetResourceManager()->LoadDirectory(resName);
}
extern "C" void ResourceMgr_DirtyDirectory(const char* resName) {
Ship::Context::GetInstance()->GetResourceManager()->DirtyDirectory(resName);
}
extern "C" void ResourceMgr_UnloadResource(const char* resName) {
std::string path = resName;
if (path.substr(0, 7) == "__OTR__") {
path = path.substr(7);
}
auto res = Ship::Context::GetInstance()->GetResourceManager()->UnloadResource(path);
}
// OTRTODO: There is probably a more elegant way to go about this...
// Kenix: This is definitely leaking memory when it's called.
extern "C" char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize) {
auto lst = Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->ListFiles(searchMask);
char** result = (char**)malloc(lst->size() * sizeof(char*));
for (size_t i = 0; i < lst->size(); i++) {
char* str = (char*)malloc(lst.get()[0][i].size() + 1);
memcpy(str, lst.get()[0][i].data(), lst.get()[0][i].size());
str[lst.get()[0][i].size()] = '\0';
result[i] = str;
}
*resultSize = lst->size();
return result;
}
extern "C" uint8_t ResourceMgr_FileExists(const char* filePath) {
std::string path = filePath;
if(path.substr(0, 7) == "__OTR__"){
path = path.substr(7);
}
return ExtensionCache.contains(path);
}
extern "C" uint8_t ResourceMgr_FileAltExists(const char* filePath) {
std::string path = filePath;
if (path.substr(0, 7) == "__OTR__") {
path = path.substr(7);
}
if (path.substr(0, 4) != "alt/") {
path = "alt/" + path;
}
return ExtensionCache.contains(path);
}
extern "C" bool ResourceMgr_IsAltAssetsEnabled() {
return Ship::Context::GetInstance()->GetResourceManager()->IsAltAssetsEnabled();
}
// Unloads a resource if an alternate version exists when alt assets are enabled
// The resource is only removed from the internal cache to prevent it from used in the next resource lookup
extern "C" void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName) {
if (ResourceMgr_IsAltAssetsEnabled() && ResourceMgr_FileAltExists((char*)resName)) {
ResourceMgr_UnloadResource((char*) resName);
}
}
std::shared_ptr<Ship::IResource> ResourceMgr_GetResourceByNameHandlingMQ(const char* path) {
std::string Path = path;
if (ResourceMgr_IsGameMasterQuest()) {
size_t pos = 0;
if ((pos = Path.find("/nonmq/", 0)) != std::string::npos) {
Path.replace(pos, 7, "/mq/");
}
}
return Ship::Context::GetInstance()->GetResourceManager()->LoadResource(Path.c_str());
}
extern "C" char* ResourceMgr_GetResourceDataByNameHandlingMQ(const char* path) {
auto res = ResourceMgr_GetResourceByNameHandlingMQ(path);
if (res == nullptr) {
return nullptr;
}
return (char*)res->GetRawPointer();
}
extern "C" uint8_t ResourceMgr_TexIsRaw(const char* texPath) {
auto res = std::static_pointer_cast<LUS::Texture>(ResourceMgr_GetResourceByNameHandlingMQ(texPath));
return res->Flags & TEX_FLAG_LOAD_AS_RAW;
}
extern "C" uint8_t ResourceMgr_ResourceIsBackground(char* texPath) {
auto res = ResourceMgr_GetResourceByNameHandlingMQ(texPath);
return res->GetInitData()->Type == static_cast<uint32_t>(SOH::ResourceType::SOH_Background);
}
extern "C" char* ResourceMgr_LoadJPEG(char* data, size_t dataSize) {
static char* finalBuffer = 0;
if (finalBuffer == 0) {
finalBuffer = (char*)malloc(dataSize);
}
int w;
int h;
int comp;
unsigned char* pixels = stbi_load_from_memory((const unsigned char*)data, 320 * 240 * 2, &w, &h, &comp, STBI_rgb_alpha);
//unsigned char* pixels = stbi_load_from_memory((const unsigned char*)data, 480 * 240 * 2, &w, &h, &comp, STBI_rgb_alpha);
int idx = 0;
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
uint16_t* bufferTest = (uint16_t*)finalBuffer;
int pixelIdx = ((y * w) + x) * 4;
uint8_t r = pixels[pixelIdx + 0] / 8;
uint8_t g = pixels[pixelIdx + 1] / 8;
uint8_t b = pixels[pixelIdx + 2] / 8;
uint8_t alphaBit = pixels[pixelIdx + 3] != 0;
uint16_t data = (r << 11) + (g << 6) + (b << 1) + alphaBit;
finalBuffer[idx++] = (data & 0xFF00) >> 8;
finalBuffer[idx++] = (data & 0x00FF);
}
}
return (char*)finalBuffer;
}
extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) {
auto res = ResourceMgr_GetResourceByNameHandlingMQ(filePath);
if (res->GetInitData()->Type == static_cast<uint32_t>(LUS::ResourceType::DisplayList)) {
return (char*)&((std::static_pointer_cast<LUS::DisplayList>(res))->Instructions[0]);
}
if (res->GetInitData()->Type == static_cast<uint32_t>(SOH::ResourceType::SOH_Array)) {
return (char*)(std::static_pointer_cast<SOH::Array>(res))->Vertices.data();
}
return (char*)ResourceMgr_GetResourceDataByNameHandlingMQ(filePath);
}
extern "C" char* ResourceMgr_LoadIfDListByName(const char* filePath) {
auto res = ResourceMgr_GetResourceByNameHandlingMQ(filePath);
if (res->GetInitData()->Type == static_cast<uint32_t>(LUS::ResourceType::DisplayList)) {
return (char*)&((std::static_pointer_cast<LUS::DisplayList>(res))->Instructions[0]);
}
return nullptr;
}
extern "C" char* ResourceMgr_LoadPlayerAnimByName(const char* animPath) {
auto anim = std::static_pointer_cast<SOH::PlayerAnimation>(ResourceMgr_GetResourceByNameHandlingMQ(animPath));
return (char*)&anim->limbRotData[0];
}
extern "C" void ResourceMgr_PushCurrentDirectory(char* path) {
gfx_push_current_dir(path);
}
extern "C" Gfx* ResourceMgr_LoadGfxByName(const char* path) {
// When an alt resource exists for the DL, we need to unload the original asset
// to clear the cache so the alt asset will be loaded instead
// OTRTODO: If Alt loading over original cache is fixed, this line can most likely be removed
ResourceMgr_UnloadOriginalWhenAltExists(path);
auto res = std::static_pointer_cast<LUS::DisplayList>(ResourceMgr_GetResourceByNameHandlingMQ(path));
return (Gfx*)&res->Instructions[0];
}
extern "C" uint8_t ResourceMgr_FileIsCustomByName(const char* path) {
auto res = std::static_pointer_cast<LUS::DisplayList>(ResourceMgr_GetResourceByNameHandlingMQ(path));
return res->GetInitData()->IsCustom;
}
typedef struct {
int index;
Gfx instruction;
} GfxPatch;
std::unordered_map<std::string, std::unordered_map<std::string, GfxPatch>> originalGfx;
// Attention! This is primarily for cosmetics & bug fixes. For things like mods and model replacement you should be using OTRs
// instead (When that is available). Index can be found using the commented out section below.
extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction) {
auto res = std::static_pointer_cast<LUS::DisplayList>(
Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path));
// Leaving this here for people attempting to find the correct Dlist index to patch
/*if (strcmp("__OTR__objects/object_gi_longsword/gGiBiggoronSwordDL", path) == 0) {
for (int i = 0; i < res->instructions.size(); i++) {
Gfx* gfx = (Gfx*)&res->instructions[i];
// Log all commands
// SPDLOG_INFO("index:{} command:{}", i, gfx->words.w0 >> 24);
// Log only SetPrimColors
if (gfx->words.w0 >> 24 == 250) {
SPDLOG_INFO("index:{} r:{} g:{} b:{} a:{}", i, _SHIFTR(gfx->words.w1, 24, 8), _SHIFTR(gfx->words.w1, 16, 8), _SHIFTR(gfx->words.w1, 8, 8), _SHIFTR(gfx->words.w1, 0, 8));
}
}
}*/
// Index refers to individual gfx words, which are half the size on 32-bit
// if (sizeof(uintptr_t) < 8) {
// index /= 2;
// }
// Do not patch custom assets as they most likely do not have the same instructions as authentic assets
if (res->GetInitData()->IsCustom) {
return;
}
Gfx* gfx = (Gfx*)&res->Instructions[index];
if (!originalGfx.contains(path) || !originalGfx[path].contains(patchName)) {
originalGfx[path][patchName] = {
index,
*gfx
};
}
*gfx = instruction;
}
extern "C" void ResourceMgr_PatchGfxCopyCommandByName(const char* path, const char* patchName, int destinationIndex, int sourceIndex) {
auto res = std::static_pointer_cast<LUS::DisplayList>(
Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path));
// Do not patch custom assets as they most likely do not have the same instructions as authentic assets
if (res->GetInitData()->IsCustom) {
return;
}
Gfx* destinationGfx = (Gfx*)&res->Instructions[destinationIndex];
Gfx sourceGfx = *(Gfx*)&res->Instructions[sourceIndex];
if (!originalGfx.contains(path) || !originalGfx[path].contains(patchName)) {
originalGfx[path][patchName] = {
destinationIndex,
*destinationGfx
};
}
*destinationGfx = sourceGfx;
}
extern "C" void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName) {
if (originalGfx.contains(path) && originalGfx[path].contains(patchName)) {
auto res = std::static_pointer_cast<LUS::DisplayList>(
Ship::Context::GetInstance()->GetResourceManager()->LoadResource(path));
Gfx* gfx = (Gfx*)&res->Instructions[originalGfx[path][patchName].index];
*gfx = originalGfx[path][patchName].instruction;
originalGfx[path].erase(patchName);
}
}
extern "C" char* ResourceMgr_LoadArrayByName(const char* path) {
auto res = std::static_pointer_cast<SOH::Array>(ResourceMgr_GetResourceByNameHandlingMQ(path));
return (char*)res->Scalars.data();
}
// Return of LoadArrayByNameAsVec3s must be freed by the caller
extern "C" char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path) {
auto res = std::static_pointer_cast<SOH::Array>(ResourceMgr_GetResourceByNameHandlingMQ(path));
// if (res->CachedGameAsset != nullptr)
// return (char*)res->CachedGameAsset;
// else
// {
Vec3s* data = (Vec3s*)malloc(sizeof(Vec3s) * res->Scalars.size());
for (size_t i = 0; i < res->Scalars.size(); i += 3) {
data[(i / 3)].x = res->Scalars[i + 0].s16;
data[(i / 3)].y = res->Scalars[i + 1].s16;
data[(i / 3)].z = res->Scalars[i + 2].s16;
}
// res->CachedGameAsset = data;
return (char*)data;
// }
}
extern "C" CollisionHeader* ResourceMgr_LoadColByName(const char* path) {
return (CollisionHeader*) ResourceGetDataByName(path);
}
extern "C" Vtx* ResourceMgr_LoadVtxByName(char* path) {
return (Vtx*) ResourceGetDataByName(path);
}
extern "C" SequenceData ResourceMgr_LoadSeqByName(const char* path) {
SequenceData* sequence = (SequenceData*) ResourceGetDataByName(path);
return *sequence;
}
extern "C" SoundFontSample* ResourceMgr_LoadAudioSample(const char* path) {
return (SoundFontSample*) ResourceGetDataByName(path);
}
extern "C" SoundFont* ResourceMgr_LoadAudioSoundFont(const char* path) {
return (SoundFont*) ResourceGetDataByName(path);
}
extern "C" int ResourceMgr_OTRSigCheck(char* imgData) {
uintptr_t i = (uintptr_t)(imgData);
// if (i == 0xD9000000 || i == 0xE7000000 || (i & 1) == 1)
if ((i & 1) == 1)
return 0;
// if ((i & 0xFF000000) != 0xAB000000 && (i & 0xFF000000) != 0xCD000000 && i != 0) {
if (i != 0) {
if (
imgData[0] == '_' &&
imgData[1] == '_' &&
imgData[2] == 'O' &&
imgData[3] == 'T' &&
imgData[4] == 'R' &&
imgData[5] == '_' &&
imgData[6] == '_'
) {
return 1;
}
}
return 0;
}
extern "C" AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path) {
return (AnimationHeaderCommon*) ResourceGetDataByName(path);
}
extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, SkelAnime* skelAnime) {
std::string pathStr = std::string(path);
static const std::string sOtr = "__OTR__";
if (pathStr.starts_with(sOtr)) {
pathStr = pathStr.substr(sOtr.length());
}
bool isAlt = ResourceMgr_IsAltAssetsEnabled();
if (isAlt) {
pathStr = Ship::IResource::gAltAssetPrefix + pathStr;
}
SkeletonHeader* skelHeader = (SkeletonHeader*) ResourceGetDataByName(pathStr.c_str());
// If there isn't an alternate model, load the regular one
if (isAlt && skelHeader == NULL) {
skelHeader = (SkeletonHeader*) ResourceGetDataByName(path);
}
// This function is only called when a skeleton is initialized.
// Therefore we can take this oppurtunity to take note of the Skeleton that is created...
if (skelAnime != nullptr) {
auto stringPath = std::string(path);
SOH::SkeletonPatcher::RegisterSkeleton(stringPath, skelAnime);
}
return skelHeader;
}
extern "C" void ResourceMgr_UnregisterSkeleton(SkelAnime* skelAnime) {
if (skelAnime != nullptr) {
SOH::SkeletonPatcher::UnregisterSkeleton(skelAnime);
}
}
extern "C" void ResourceMgr_ClearSkeletons() {
SOH::SkeletonPatcher::ClearSkeletons();
}
extern "C" s32* ResourceMgr_LoadCSByName(const char* path) {
return (s32*)ResourceMgr_GetResourceDataByNameHandlingMQ(path);
}

View File

@ -0,0 +1,66 @@
#pragma once
#include "libultraship/libultra/types.h"
#define GAME_REGION_NTSC 0
#define GAME_REGION_PAL 1
#define GAME_PLATFORM_N64 0
#define GAME_PLATFORM_GC 1
#ifdef __cplusplus
#include <memory>
#include <Resource.h>
std::shared_ptr<Ship::IResource> ResourceMgr_GetResourceByNameHandlingMQ(const char* path);
extern "C" {
#endif // __cplusplus
#include "z64animation.h"
#include "z64audio.h"
#include "z64bgcheck.h"
uint32_t ResourceMgr_IsGameMasterQuest();
uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum);
uint32_t ResourceMgr_GameHasMasterQuest();
uint32_t ResourceMgr_GameHasOriginal();
uint32_t ResourceMgr_GetNumGameVersions();
uint32_t ResourceMgr_GetGameVersion(int index);
uint32_t ResourceMgr_GetGamePlatform(int index);
uint32_t ResourceMgr_GetGameRegion(int index);
void ResourceMgr_LoadDirectory(const char* resName);
void ResourceMgr_UnloadResource(const char* resName);
char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize);
uint8_t ResourceMgr_FileExists(const char* resName);
uint8_t ResourceMgr_FileAltExists(const char* resName);
void ResourceMgr_UnloadOriginalWhenAltExists(const char* resName);
uint8_t ResourceMgr_TexIsRaw(const char* texPath);
uint8_t ResourceMgr_ResourceIsBackground(char* texPath);
char* ResourceMgr_LoadJPEG(char* data, size_t dataSize);
uint16_t ResourceMgr_LoadTexWidthByName(char* texPath);
uint16_t ResourceMgr_LoadTexHeightByName(char* texPath);
char* ResourceMgr_LoadTexOrDListByName(const char* filePath);
char* ResourceMgr_LoadPlayerAnimByName(const char* animPath);
AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path);
char* ResourceMgr_GetNameByCRC(uint64_t crc, char* alloc);
Gfx* ResourceMgr_LoadGfxByCRC(uint64_t crc);
Gfx* ResourceMgr_LoadGfxByName(const char* path);
uint8_t ResourceMgr_FileIsCustomByName(const char* path);
void ResourceMgr_PatchGfxByName(const char* path, const char* patchName, int index, Gfx instruction);
void ResourceMgr_UnpatchGfxByName(const char* path, const char* patchName);
char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path);
Vtx* ResourceMgr_LoadVtxByCRC(uint64_t crc);
Vtx* ResourceMgr_LoadVtxByName(char* path);
SoundFont* ResourceMgr_LoadAudioSoundFont(const char* path);
SequenceData ResourceMgr_LoadSeqByName(const char* path);
SoundFontSample* ResourceMgr_LoadAudioSample(const char* path);
CollisionHeader* ResourceMgr_LoadColByName(const char* path);
bool ResourceMgr_IsAltAssetsEnabled();
SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path, SkelAnime* skelAnime);
void ResourceMgr_UnregisterSkeleton(SkelAnime* skelAnime);
void ResourceMgr_ClearSkeletons();
s32* ResourceMgr_LoadCSByName(const char* path);
int ResourceMgr_OTRSigCheck(char* imgData);
char* ResourceMgr_GetResourceDataByNameHandlingMQ(const char* path);
#ifdef __cplusplus
}
#endif // __cplusplus

View File

@ -10,6 +10,7 @@
#include "Enhancements/randomizer/item.h"
#include "z64.h"
#include "cvar_prefixes.h"
#include "functions.h"
#include "macros.h"
#include <variables.h>

View File

@ -1,6 +1,7 @@
#pragma once
#include <libultraship/libultra/gbi.h>
#include "z64save.h"
#define SECTION_PARENT_NONE -1
typedef struct {
@ -45,8 +46,6 @@ typedef struct {
#define BS_THREAD_POOL_ENABLE_PAUSE
#include <BS_thread_pool.hpp>
#include "z64save.h"
#include <nlohmann/json.hpp>
class SaveManager {

View File

@ -132,6 +132,7 @@ namespace SohGui {
std::shared_ptr<ItemTrackerSettingsWindow> mItemTrackerSettingsWindow;
std::shared_ptr<ItemTrackerWindow> mItemTrackerWindow;
std::shared_ptr<TimeSplitWindow> mTimeSplitWindow;
std::shared_ptr<PlandomizerWindow> mPlandomizerWindow;
std::shared_ptr<RandomizerSettingsWindow> mRandomizerSettingsWindow;
std::shared_ptr<AdvancedResolutionSettings::AdvancedResolutionSettingsWindow> mAdvancedResolutionSettingsWindow;
std::shared_ptr<SohModalWindow> mModalWindow;
@ -212,6 +213,8 @@ namespace SohGui {
gui->AddGuiWindow(mRandomizerSettingsWindow);
mTimeSplitWindow = std::make_shared<TimeSplitWindow>(CVAR_WINDOW("TimeSplitEnabled"), "Time Splits", ImVec2(450, 660));
gui->AddGuiWindow(mTimeSplitWindow);
mPlandomizerWindow = std::make_shared<PlandomizerWindow>(CVAR_WINDOW("PlandomizerWindow"), "Plandomizer Editor", ImVec2(850, 760));
gui->AddGuiWindow(mPlandomizerWindow);
mAdvancedResolutionSettingsWindow = std::make_shared<AdvancedResolutionSettings::AdvancedResolutionSettingsWindow>(CVAR_WINDOW("AdvancedResolutionEditor"), "Advanced Resolution Settings", ImVec2(497, 599));
gui->AddGuiWindow(mAdvancedResolutionSettingsWindow);
mModalWindow = std::make_shared<SohModalWindow>(CVAR_WINDOW("ModalWindow"), "Modal Window");
@ -258,6 +261,7 @@ namespace SohGui {
mInputViewerSettings = nullptr;
mTimeSplitWindow = nullptr;
mCaladiusWindow = nullptr;
mPlandomizerWindow = nullptr;
}
void RegisterPopup(std::string title, std::string message, std::string button1, std::string button2, std::function<void()> button1callback, std::function<void()> button2callback) {

View File

@ -25,6 +25,7 @@
#include "Enhancements/randomizer/randomizer_item_tracker.h"
#include "Enhancements/randomizer/randomizer_settings_window.h"
#include "Enhancements/timesplits/TimeSplits.h"
#include "Enhancements/randomizer/Plandomizer.h"
#include "SohModals.h"
#ifdef __cplusplus

View File

@ -10,7 +10,9 @@
#include "include/z64audio.h"
#include "graphic/Fast3D/gfx_rendering_api.h"
#include "OTRGlobals.h"
#include "SaveManager.h"
#include "z64.h"
#include "cvar_prefixes.h"
#include "macros.h"
#include "Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/presets.h"
@ -42,6 +44,7 @@
#include "Enhancements/enemyrandomizer.h"
#include "Enhancements/timesplits/TimeSplits.h"
#include "Enhancements/Holiday/Holiday.hpp"
#include "Enhancements/randomizer/Plandomizer.h"
// FA icons are kind of wonky, if they worked how I expected them to the "+ 2.0f" wouldn't be needed, but
// they don't work how I expect them to so I added that because it looked good when I eyeballed it
@ -2047,6 +2050,7 @@ extern std::shared_ptr<EntranceTrackerWindow> mEntranceTrackerWindow;
extern std::shared_ptr<EntranceTrackerSettingsWindow> mEntranceTrackerSettingsWindow;
extern std::shared_ptr<CheckTracker::CheckTrackerWindow> mCheckTrackerWindow;
extern std::shared_ptr<CheckTracker::CheckTrackerSettingsWindow> mCheckTrackerSettingsWindow;
extern std::shared_ptr<PlandomizerWindow> mPlandomizerWindow;
extern "C" u8 Randomizer_GetSettingValue(RandomizerSettingKey randoSettingKey);
void DrawRandomizerMenu() {
@ -2076,6 +2080,14 @@ void DrawRandomizerMenu() {
static float separationToOptionsButton = 5.0f;
#endif
if (mPlandomizerWindow) {
if (ImGui::Button(GetWindowButtonText("Plandomizer Editor", CVarGetInteger(CVAR_WINDOW("PlandomizerWindow"), 0)).c_str(), buttonSize)) {
mPlandomizerWindow->ToggleVisibility();
}
}
UIWidgets::Spacer(0);
if (mRandomizerSettingsWindow) {
if (ImGui::Button(GetWindowButtonText("Randomizer Settings", CVarGetInteger(CVAR_WINDOW("RandomizerSettings"), 0)).c_str(), buttonSize)) {
mRandomizerSettingsWindow->ToggleVisibility();

17
soh/soh/cvar_prefixes.h Normal file
View File

@ -0,0 +1,17 @@
#define CVAR_RANDOMIZER_ENHANCEMENT(var) CVAR_PREFIX_RANDOMIZER_ENHANCEMENT "." var
#define CVAR_RANDOMIZER_SETTING(var) CVAR_PREFIX_RANDOMIZER_SETTING "." var
#define CVAR_COSMETIC(var) CVAR_PREFIX_COSMETIC "." var
#define CVAR_AUDIO(var) CVAR_PREFIX_AUDIO "." var
#define CVAR_CHEAT(var) CVAR_PREFIX_CHEAT "." var
#define CVAR_ENHANCEMENT(var) CVAR_PREFIX_ENHANCEMENT "." var
#define CVAR_SETTING(var) CVAR_PREFIX_SETTING "." var
#define CVAR_WINDOW(var) CVAR_PREFIX_WINDOW "." var
#define CVAR_TRACKER(var) CVAR_PREFIX_TRACKER "." var
#define CVAR_TRACKER_ITEM(var) CVAR_TRACKER(".ItemTracker." var)
#define CVAR_TRACKER_CHECK(var) CVAR_TRACKER(".CheckTracker." var)
#define CVAR_TRACKER_ENTRANCE(var) CVAR_TRACKER(".EntranceTracker." var)
#define CVAR_DEVELOPER_TOOLS(var) CVAR_PREFIX_DEVELOPER_TOOLS "." var
#define CVAR_GENERAL(var) CVAR_PREFIX_GENERAL "." var
#define CVAR_REMOTE(var) CVAR_PREFIX_REMOTE "." var
#define CVAR_REMOTE_CROWD_CONTROL(var) CVAR_REMOTE(".CrowdControl." var)
#define CVAR_REMOTE_SAIL(var) CVAR_REMOTE(".Sail." var)

View File

@ -1,5 +1,6 @@
#include "Resource.h"
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
namespace SOH {
void LogPathAsXML(std::shared_ptr<Ship::IResource> resource);

View File

@ -1,5 +1,6 @@
#include "Resource.h"
#include "soh/OTRGlobals.h"
#include "soh/cvar_prefixes.h"
namespace SOH {

View File

@ -1,4 +1,5 @@
#include "OTRGlobals.h"
#include "ResourceManagerHelpers.h"
#include <libultraship/libultraship.h>
#include "soh/resource/type/Scene.h"
#include <utils/StringHelper.h>
@ -35,7 +36,7 @@ extern "C" void OTRPlay_SpawnScene(PlayState* play, s32 sceneId, s32 spawn) {
std::string sceneVersion = "shared";
if (inNonSharedScene) {
sceneVersion = IsGameMasterQuest() ? "mq" : "nonmq";
sceneVersion = ResourceMgr_IsGameMasterQuest() ? "mq" : "nonmq";
}
std::string scenePath = StringHelper::Sprintf("scenes/%s/%s/%s", sceneVersion.c_str(), scene->sceneFile.fileName, scene->sceneFile.fileName);

View File

@ -1,4 +1,5 @@
#include "OTRGlobals.h"
#include "ResourceManagerHelpers.h"
#include <libultraship/libultraship.h>
#include "soh/resource/type/Scene.h"
#include <utils/StringHelper.h>
@ -39,9 +40,6 @@ extern "C" s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId);
extern "C" RomFile sNaviMsgFiles[];
s32 OTRScene_ExecuteCommands(PlayState* play, SOH::Scene* scene);
// Forward Declaration of function declared in OTRGlobals.cpp
std::shared_ptr<Ship::IResource> GetResourceByNameHandlingMQ(const char* path);
bool Scene_CommandSpawnList(PlayState* play, SOH::ISceneCommand* cmd) {
// SOH::SetStartPositionList* cmdStartPos = std::static_pointer_cast<SOH::SetStartPositionList>(cmd);
SOH::SetStartPositionList* cmdStartPos = (SOH::SetStartPositionList*)cmd;
@ -512,7 +510,7 @@ extern "C" s32 OTRfunc_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomN
//&roomCtx->loadQueue, NULL, __FILE__, __LINE__);
auto roomData =
std::static_pointer_cast<SOH::Scene>(GetResourceByNameHandlingMQ(play->roomList[roomNum].fileName));
std::static_pointer_cast<SOH::Scene>(ResourceMgr_GetResourceByNameHandlingMQ(play->roomList[roomNum].fileName));
roomCtx->status = 1;
roomCtx->roomToLoad = roomData.get();

View File

@ -7,6 +7,7 @@
#include "soh/OTRGlobals.h"
#include "soh/Enhancements/audio/AudioCollection.h"
#include "soh/Enhancements/audio/AudioEditor.h"
#include "soh/ResourceManagerHelpers.h"
#define MK_ASYNC_MSG(retData, tableType, id, status) (((retData) << 24) | ((tableType) << 16) | ((id) << 8) | (status))
#define ASYNC_TBLTYPE(v) ((u8)(v >> 16))

View File

@ -1,4 +1,5 @@
#include "global.h"
#include "soh/ResourceManagerHelpers.h"
#include <libultraship/bridge.h>
extern bool gUseLegacySD;

View File

@ -4,6 +4,7 @@
#include "global.h"
#include "soh/Enhancements/audio/AudioEditor.h"
#include "soh/ResourceManagerHelpers.h"
extern char** sequenceMap;

View File

@ -1,5 +1,6 @@
#include <libultraship/libultra.h>
#include "global.h"
#include "soh/OTRGlobals.h"
#include "soh/Enhancements/audio/AudioEditor.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"

View File

@ -4,6 +4,7 @@
#include "libultraship/bridge.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/ResourceManagerHelpers.h"
SpeedMeter D_801664D0;
VisCvg sVisCvg;

View File

@ -1,5 +1,7 @@
#include "global.h"
#include "align_asset_macro.h"
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
u16 sGfxPrintFontTLUT[64] = {
0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000,

View File

@ -3,6 +3,8 @@
#include <string.h>
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
s32 D_8012D280 = 1;

View File

@ -13,6 +13,7 @@
#include "soh/Enhancements/nametag.h"
#include "soh/ActorDB.h"
#include "soh/OTRGlobals.h"
#include <string.h>
#include <stdlib.h>

View File

@ -1,7 +1,8 @@
#include "global.h"
#include "vt.h"
#include <soh/OTRGlobals.h>
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
#include <assert.h>
#define SS_NULL 0xFFFF

View File

@ -1,4 +1,5 @@
#include "global.h"
#include "soh/ResourceManagerHelpers.h"
void Gfx_DrawDListOpa(PlayState* play, Gfx* dlist) {
OPEN_DISPS(play->state.gfxCtx);

View File

@ -32,6 +32,8 @@
#include "scenes/misc/hakaana_ouke/hakaana_ouke_scene.h"
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
u16 D_8011E1C0 = 0;

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "z64elf_message.h"
#include <assert.h>
#include "soh/OTRGlobals.h"
ElfMessage sChildSariaMsgs[] = {
ELF_MSG_STRENGTH_UPG(SKIP, 3, false, 0),

View File

@ -4,6 +4,7 @@
#include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h"
#include "textures/icon_item_static/icon_item_static.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/OTRGlobals.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#define FLAGS 0

View File

@ -1,5 +1,7 @@
#include "global.h"
#include <string.h>
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
// unused
Gfx sCircleNullDList[] = {

View File

@ -1,5 +1,6 @@
#include "global.h"
#include <assert.h>
#include "soh/ResourceManagerHelpers.h"
void SkelCurve_Clear(SkelAnimeCurve* skelCurve) {
skelCurve->limbCount = 0;

View File

@ -1,4 +1,5 @@
#include "global.h"
#include "soh/OTRGlobals.h"
void GameOver_Init(PlayState* play) {
play->gameOverCtx.state = GAMEOVER_INACTIVE;

View File

@ -4,6 +4,8 @@
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/gameplay_field_keep/gameplay_field_keep.h"
#include "soh/frame_interpolation.h"
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
typedef enum {
/* 0 */ LENS_FLARE_CIRCLE0,

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "textures/parameter_static/parameter_static.h"
#include "soh/frame_interpolation.h"
#include "soh/OTRGlobals.h"
s16 Top_LM_Margin = 0;
s16 Left_LM_Margin = 0;

View File

@ -5,6 +5,7 @@
#include "objects/gameplay_keep/gameplay_keep.h"
#include "soh/frame_interpolation.h"
#include "soh/OTRGlobals.h"
#define LIGHTS_BUFFER_SIZE 32
//#define LIGHTS_BUFFER_SIZE 1024 // Kill me

View File

@ -5,6 +5,7 @@
#include "textures/map_i_static/map_i_static.h"
#include "textures/map_grand_static/map_grand_static.h"
#include <assert.h>
#include "soh/OTRGlobals.h"
MapData* gMapData;

View File

@ -1,6 +1,8 @@
#include "global.h"
#include "vt.h"
#include "textures/parameter_static/parameter_static.h"
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
typedef struct {
/* 0x00 */ void* texture;

View File

@ -21,6 +21,9 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/Enhancements/randomizer/randomizer_grotto.h"
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
#include "soh/Enhancements/gameplaystats.h"
#define DO_ACTION_TEX_WIDTH() 48
#define DO_ACTION_TEX_HEIGHT() 16

View File

@ -11,6 +11,8 @@
#include <overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h>
#include "soh/Enhancements/enhancementTypes.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/OTRGlobals.h"
#include "soh/SaveManager.h"
#include "soh/framebuffer_effects.h"
#include <libultraship/libultraship.h>

View File

@ -8,6 +8,7 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/randomizer/draw.h"
#include "soh/ResourceManagerHelpers.h"
#include <stdlib.h>
#include <soh_assets.h>
@ -1761,7 +1762,7 @@ Vec3f sLeftHandArrowVec3 = { 398.0f, 1419.0f, 244.0f };
BowStringData sBowStringData[] = {
{ gLinkAdultBowStringDL, { 0.0f, -360.4f, 0.0f } }, // bow
{ gLinkChildSlinghotStringDL, { 606.0f, 236.0f, 0.0f } }, // slingshot
{ gLinkChildSlingshotStringDL, { 606.0f, 236.0f, 0.0f } }, // slingshot
};
Vec3f sRightHandLimbModelShieldQuadVertices[] = {

View File

@ -1,5 +1,6 @@
#include "global.h"
#include <assert.h>
#include "soh/OTRGlobals.h"
Gfx sSetupDL[SETUPDL_MAX][6] = {
{

View File

@ -9,6 +9,8 @@
#include <assert.h>
#include "public/bridge/gfxbridge.h"
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
void func_80095AB4(PlayState* play, Room* room, u32 flags);
void func_80095D04(PlayState* play, Room* room, u32 flags);

View File

@ -25,6 +25,8 @@
#include "soh/mq_asset_hacks.h"
#include "soh/Enhancements/randomizer/adult_trade_shuffle.h"
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
// Entrance Table definition
#define DEFINE_ENTRANCE(_0, sceneId, spawn, continueBgm, displayTitleCard, endTransType, startTransType) \

View File

@ -3,6 +3,8 @@
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
#define ANIM_INTERP 1

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "overlays/actors/ovl_En_fHG/z_en_fhg.h"
#include <assert.h>
#include "soh/ResourceManagerHelpers.h"
/**
* Initialises the Vtx buffers used for limb at index `limbIndex`

View File

@ -5,6 +5,8 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/Enhancements/randomizer/savefile.h"
#include "soh/OTRGlobals.h"
#include "soh/SaveManager.h"
#define NUM_DUNGEONS 8
#define NUM_COWS 10

View File

@ -1,5 +1,6 @@
#include <libultraship/libultra.h>
#include "global.h"
#include "soh/OTRGlobals.h"
#include <stdio.h>
#include <assert.h>

View File

@ -8,6 +8,7 @@
#include "scenes/dungeons/ddan/ddan_scene.h"
#include "objects/object_bwall/object_bwall.h"
#include "objects/object_kingdodongo/object_kingdodongo.h"
#include "soh/OTRGlobals.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"

View File

@ -11,6 +11,8 @@
#include "scenes/indoors/yousei_izumi_yoko/yousei_izumi_yoko_scene.h"
#include "scenes/indoors/daiyousei_izumi/daiyousei_izumi_scene.h"
#include "soh/frame_interpolation.h"
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA)

Some files were not shown because too many files have changed in this diff Show More