mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 06:13:45 -07:00
Merge branch 'develop' into SplitGF
This commit is contained in:
commit
20deaabe0b
120 changed files with 876 additions and 414 deletions
|
@ -1,7 +1,5 @@
|
|||
set(CVAR_VSYNC_ENABLED "${CVAR_PREFIX_SETTING}.VsyncEnabled" CACHE STRING "")
|
||||
set(CVAR_Z_FIGHTING_MODE "${CVAR_PREFIX_SETTING}.ZFightingMode" CACHE STRING "")
|
||||
set(CVAR_NEW_FILE_DROPPED "${CVAR_PREFIX_GENERAL}.NewFileDropped" CACHE STRING "")
|
||||
set(CVAR_DROPPED_FILE "${CVAR_PREFIX_GENERAL}.DroppedFile" CACHE STRING "")
|
||||
set(CVAR_INTERNAL_RESOLUTION "${CVAR_PREFIX_SETTING}.InternalResolution" CACHE STRING "")
|
||||
set(CVAR_MSAA_VALUE "${CVAR_PREFIX_SETTING}.MSAAValue" CACHE STRING "")
|
||||
set(CVAR_SDL_WINDOWED_FULLSCREEN "${CVAR_PREFIX_SETTING}.SdlWindowedFullscreen" CACHE STRING "")
|
||||
|
|
|
@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.26.0 FATAL_ERROR)
|
|||
|
||||
set(CMAKE_SYSTEM_VERSION 10.0 CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
|
||||
set(CMAKE_C_STANDARD 23 CACHE STRING "The C standard to use")
|
||||
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ set(CMAKE_SYSTEM_VERSION 10.0 CACHE STRING "" FORCE)
|
|||
|
||||
project(soh LANGUAGES C CXX)
|
||||
set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
|
||||
set(CMAKE_C_STANDARD 23 CACHE STRING "The C standard to use")
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
enable_language(OBJCXX)
|
||||
|
@ -511,10 +512,10 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
|||
-Wno-parentheses
|
||||
-Wno-narrowing
|
||||
-Wno-missing-braces
|
||||
-Wno-int-conversion
|
||||
$<$<COMPILE_LANGUAGE:C>:
|
||||
-Werror-implicit-function-declaration
|
||||
-Wno-incompatible-pointer-types
|
||||
-Wno-int-conversion
|
||||
>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-fpermissive>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:
|
||||
|
@ -587,11 +588,11 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
|||
-Wno-parentheses
|
||||
-Wno-narrowing
|
||||
-Wno-missing-braces
|
||||
-Wno-int-conversion
|
||||
-Wno-implicit-int
|
||||
$<$<COMPILE_LANGUAGE:C>:
|
||||
-Werror-implicit-function-declaration
|
||||
-Wno-implicit-int
|
||||
-Wno-incompatible-pointer-types
|
||||
-Wno-int-conversion
|
||||
>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-fpermissive>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion>
|
||||
|
|
|
@ -15,7 +15,7 @@ extern "C"
|
|||
#include <soh/Enhancements/randomizer/randomizer_inf.h>
|
||||
|
||||
#if defined(INCLUDE_GAME_PRINTF) && defined(_DEBUG)
|
||||
#define osSyncPrintf(fmt, ...) lusprintf(__FILE__, __LINE__, 0, fmt, __VA_ARGS__)
|
||||
#define osSyncPrintf(fmt, ...) lusprintf(__FILE__, __LINE__, 0, fmt, ##__VA_ARGS__)
|
||||
#else
|
||||
#define osSyncPrintf(fmt, ...) osSyncPrintfUnused(fmt, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
@ -1378,7 +1378,7 @@ void func_800AA0B4();
|
|||
void func_800AA0F0(void);
|
||||
u32 func_800AA148();
|
||||
void func_800AA15C();
|
||||
void func_800AA16C();
|
||||
void Rumble_ClearRequests();
|
||||
void func_800AA178(u32);
|
||||
View* View_New(GraphicsContext* gfxCtx);
|
||||
void View_Free(View* view);
|
||||
|
|
|
@ -544,7 +544,7 @@ typedef enum {
|
|||
LANGUAGE_MAX
|
||||
} Language;
|
||||
|
||||
#define TODO_TRANSLATE "__Translate_This__"
|
||||
#define TODO_TRANSLATE "TranslateThis"
|
||||
|
||||
// TODO get these properties from the textures themselves
|
||||
#define FONT_CHAR_TEX_WIDTH 16
|
||||
|
|
|
@ -245,27 +245,30 @@ typedef void (*PostCurveLimbDraw)(struct PlayState* play, SkelAnimeCurve* skelCu
|
|||
typedef s32 (*AnimUpdateFunc)();
|
||||
|
||||
typedef struct SkelAnime {
|
||||
/* 0x00 */ u8 limbCount; // Number of limbs in the skeleton
|
||||
/* 0x01 */ u8 mode; // See `AnimationMode`
|
||||
/* 0x02 */ u8 dListCount; // Number of display lists in a flexible skeleton
|
||||
/* 0x03 */ s8 taper; // Tapering to use when morphing between animations. Only used by Door_Warp1.
|
||||
/* 0x04 */ void** skeleton; // An array of pointers to limbs. Can be StandardLimb, LodLimb, or SkinLimb.
|
||||
/* 0x08 */ void* animation; // Can be an AnimationHeader or LinkAnimationHeader.
|
||||
/* 0x0C */ f32 startFrame; // In mode ANIMMODE_LOOP_PARTIAL*, start of partial loop.
|
||||
/* 0x10 */ f32 endFrame; // In mode ANIMMODE_ONCE*, Update returns true when curFrame is equal to this. In mode ANIMMODE_LOOP_PARTIAL*, end of partial loop.
|
||||
/* 0x14 */ f32 animLength; // Total number of frames in the current animation.
|
||||
/* 0x18 */ f32 curFrame; // Current frame in the animation
|
||||
/* 0x1C */ f32 playSpeed; // Multiplied by R_UPDATE_RATE / 3 to get the animation's frame rate.
|
||||
/* 0x00 */ u8 limbCount; // Number of limbs in the skeleton
|
||||
/* 0x01 */ u8 mode; // See `AnimationMode`
|
||||
/* 0x02 */ u8 dListCount; // Number of display lists in a flexible skeleton
|
||||
/* 0x03 */ s8 taper; // Tapering to use when morphing between animations. Only used by Door_Warp1.
|
||||
/* 0x04 */ void** skeleton; // An array of pointers to limbs. Can be StandardLimb, LodLimb, or SkinLimb.
|
||||
/* 0x08 */ void* animation; // Can be an AnimationHeader or LinkAnimationHeader.
|
||||
/* 0x0C */ f32 startFrame; // In mode ANIMMODE_LOOP_PARTIAL*, start of partial loop.
|
||||
/* 0x10 */ f32 endFrame; // In mode ANIMMODE_ONCE*, Update returns true when curFrame is equal to this. In mode ANIMMODE_LOOP_PARTIAL*, end of partial loop.
|
||||
/* 0x14 */ f32 animLength; // Total number of frames in the current animation.
|
||||
/* 0x18 */ f32 curFrame; // Current frame in the animation
|
||||
/* 0x1C */ f32 playSpeed; // Multiplied by R_UPDATE_RATE / 3 to get the animation's frame rate.
|
||||
/* 0x20 */ Vec3s* jointTable; // Current translation of model and rotations of all limbs
|
||||
/* 0x24 */ Vec3s* morphTable; // Table of values used to morph between animations
|
||||
/* 0x28 */ f32 morphWeight; // Weight of the current animation morph as a fraction in [0,1]
|
||||
/* 0x2C */ f32 morphRate; // Reciprocal of the number of frames in the morph
|
||||
/* 0x30 */ s32 (*update)(); // Can be Loop, Partial loop, Play once, Morph, or Tapered morph. Link only has Loop, Play once, and Morph.
|
||||
/* 0x34 */ s8 initFlags; // Flags used when initializing Link's skeleton
|
||||
/* 0x35 */ u8 moveFlags; // Flags used for animations that move the actor in worldspace.
|
||||
/* 0x36 */ s16 prevRot; // Previous rotation in worldspace.
|
||||
/* 0x38 */ Vec3s prevTransl; // Previous modelspace translation.
|
||||
/* 0x3E */ Vec3s baseTransl; // Base modelspace translation.
|
||||
/* 0x28 */ f32 morphWeight; // Weight of the current animation morph as a fraction in [0,1]
|
||||
/* 0x2C */ f32 morphRate; // Reciprocal of the number of frames in the morph
|
||||
/* 0x30 */ union {
|
||||
s32 (*normal)(struct SkelAnime*); // Can be Loop, Partial loop, Play once, Morph, or Tapered morph
|
||||
s32 (*link)(struct PlayState*, struct SkelAnime*); // Can be Loop, Play once, or Morph
|
||||
} update;
|
||||
/* 0x34 */ s8 initFlags; // Flags used when initializing Link's skeleton
|
||||
/* 0x35 */ u8 movementFlags; // Flags used for animations that move the actor in worldspace.
|
||||
/* 0x36 */ s16 prevRot; // Previous rotation in worldspace.
|
||||
/* 0x38 */ Vec3s prevTransl; // Previous modelspace translation.
|
||||
/* 0x3E */ Vec3s baseTransl; // Base modelspace translation.
|
||||
SkeletonHeader* skeletonHeader;
|
||||
} SkelAnime; // size = 0x44
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ void FasterHeavyBlockLift_Register() {
|
|||
LinkAnimationHeader* anim = va_arg(args, LinkAnimationHeader*);
|
||||
|
||||
// Same actor is used for small and large silver rocks, use actor params to identify large ones
|
||||
bool isLargeSilverRock = interactActorId == ACTOR_EN_ISHI && interactRangeActor->params & 1 == 1;
|
||||
bool isLargeSilverRock = (interactActorId == ACTOR_EN_ISHI) && ((interactRangeActor->params & 1) == 1);
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 0) &&
|
||||
(isLargeSilverRock || interactActorId == ACTOR_BG_HEAVY_BLOCK)) {
|
||||
*should = false;
|
||||
|
|
|
@ -265,6 +265,9 @@ void Draw_SfxTab(const std::string& tabId, SeqType type, const std::string& tabN
|
|||
}
|
||||
}
|
||||
|
||||
auto playingFromMenu = CVarGetInteger(CVAR_AUDIO("Playing"), 0);
|
||||
auto currentBGM = func_800FA0B4(SEQ_PLAYER_BGM_MAIN);
|
||||
|
||||
// Longest text in Audio Editor
|
||||
ImVec2 columnSize = ImGui::CalcTextSize("Navi - Look/Hey/Watchout (Target Enemy)");
|
||||
ImGui::BeginTable(tabId.c_str(), 3, ImGuiTableFlags_SizingFixedFit);
|
||||
|
@ -291,10 +294,13 @@ void Draw_SfxTab(const std::string& tabId, SeqType type, const std::string& tabN
|
|||
const std::string lockedButton = ICON_FA_LOCK + hiddenKey;
|
||||
const std::string unlockedButton = ICON_FA_UNLOCK + hiddenKey;
|
||||
const int currentValue = CVarGetInteger(cvarKey.c_str(), defaultValue);
|
||||
const bool isCurrentlyPlaying = currentValue == playingFromMenu || seqData.sequenceId == currentBGM;
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::Text("%s", seqData.label.c_str());
|
||||
ImGui::TextColored(
|
||||
UIWidgets::ColorValues.at(isCurrentlyPlaying ? UIWidgets::Colors::Yellow : UIWidgets::Colors::White), "%s",
|
||||
seqData.label.c_str());
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::PushItemWidth(-FLT_MIN);
|
||||
const int initialValue = map.contains(currentValue) ? currentValue : defaultValue;
|
||||
|
|
|
@ -49,14 +49,14 @@ void InputViewer::RenderButton(std::string btnTexture, std::string btnOutlineTex
|
|||
if (outlineMode == BUTTON_OUTLINE_ALWAYS_SHOWN || (outlineMode == BUTTON_OUTLINE_NOT_PRESSED && !state) ||
|
||||
(outlineMode == BUTTON_OUTLINE_PRESSED && state)) {
|
||||
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(btnOutlineTexture), size,
|
||||
ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255));
|
||||
ImVec2(0, 0), ImVec2(1.0f, 1.0f));
|
||||
}
|
||||
// Render button if pressed
|
||||
if (state) {
|
||||
ImGui::SetCursorPos(pos);
|
||||
ImGui::SetNextItemAllowOverlap();
|
||||
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(btnTexture), size,
|
||||
ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255));
|
||||
ImVec2(0, 0), ImVec2(1.0f, 1.0f));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ void InputViewer::DrawElement() {
|
|||
// Background
|
||||
ImGui::Image(
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Input-Viewer-Background"),
|
||||
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255));
|
||||
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f));
|
||||
}
|
||||
|
||||
// A/B
|
||||
|
@ -352,7 +352,7 @@ void InputViewer::DrawElement() {
|
|||
ImGui::SetCursorPos(aPos);
|
||||
ImGui::Image(
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Analog-Stick Outline"),
|
||||
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255));
|
||||
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f));
|
||||
}
|
||||
const int analogStickMode =
|
||||
CVarGetInteger(CVAR_INPUT_VIEWER("AnalogStick.VisibilityMode"), STICK_MODE_ALWAYS_SHOWN);
|
||||
|
@ -363,7 +363,7 @@ void InputViewer::DrawElement() {
|
|||
ImVec2(aPos.x + maxStickDistance * ((float)(pads[0].stick_x) / MAX_AXIS_RANGE) * scale,
|
||||
aPos.y - maxStickDistance * ((float)(pads[0].stick_y) / MAX_AXIS_RANGE) * scale));
|
||||
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Analog-Stick"),
|
||||
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255));
|
||||
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f));
|
||||
}
|
||||
|
||||
// Right Stick
|
||||
|
@ -376,7 +376,7 @@ void InputViewer::DrawElement() {
|
|||
ImGui::SetCursorPos(aPos);
|
||||
ImGui::Image(
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Right-Stick Outline"),
|
||||
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255));
|
||||
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f));
|
||||
}
|
||||
const int rightStickMode =
|
||||
CVarGetInteger(CVAR_INPUT_VIEWER("RightStick.VisibilityMode"), STICK_MODE_ALWAYS_HIDDEN);
|
||||
|
@ -387,7 +387,7 @@ void InputViewer::DrawElement() {
|
|||
ImVec2(aPos.x + maxRightStickDistance * ((float)(pads[0].right_stick_x) / MAX_AXIS_RANGE) * scale,
|
||||
aPos.y - maxRightStickDistance * ((float)(pads[0].right_stick_y) / MAX_AXIS_RANGE) * scale));
|
||||
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Right-Stick"),
|
||||
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, 255));
|
||||
scaledBGSize, ImVec2(0, 0), ImVec2(1.0f, 1.0f));
|
||||
}
|
||||
|
||||
// Analog stick angle text
|
||||
|
|
|
@ -642,10 +642,14 @@ void SohInputEditorWindow::DrawStickSection(uint8_t port, uint8_t stick, int32_t
|
|||
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
DrawStickDirectionLine(ICON_FA_ARROW_UP, port, stick, Ship::UP, color);
|
||||
DrawStickDirectionLine(ICON_FA_ARROW_DOWN, port, stick, Ship::DOWN, color);
|
||||
DrawStickDirectionLine(ICON_FA_ARROW_LEFT, port, stick, Ship::LEFT, color);
|
||||
DrawStickDirectionLine(ICON_FA_ARROW_RIGHT, port, stick, Ship::RIGHT, color);
|
||||
DrawStickDirectionLine(StringHelper::Sprintf("%s##%d", ICON_FA_ARROW_UP, stick).c_str(), port, stick, Ship::UP,
|
||||
color);
|
||||
DrawStickDirectionLine(StringHelper::Sprintf("%s##%d", ICON_FA_ARROW_DOWN, stick).c_str(), port, stick, Ship::DOWN,
|
||||
color);
|
||||
DrawStickDirectionLine(StringHelper::Sprintf("%s##%d", ICON_FA_ARROW_LEFT, stick).c_str(), port, stick, Ship::LEFT,
|
||||
color);
|
||||
DrawStickDirectionLine(StringHelper::Sprintf("%s##%d", ICON_FA_ARROW_RIGHT, stick).c_str(), port, stick,
|
||||
Ship::RIGHT, color);
|
||||
ImGui::EndGroup();
|
||||
ImGui::SetNextItemOpen(true, ImGuiCond_Once);
|
||||
if (ImGui::TreeNode(StringHelper::Sprintf("Analog Stick Options##%d", id).c_str())) {
|
||||
|
@ -1335,12 +1339,12 @@ void SohInputEditorWindow::DrawOcarinaControlPanel() {
|
|||
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::BulletText("Disable song detection");
|
||||
DrawButtonLine(ICON_FA_BAN, 0, BTN_CUSTOM_OCARINA_DISABLE_SONGS);
|
||||
DrawButtonLine(ICON_FA_BAN "##DisableSongDetection", 0, BTN_CUSTOM_OCARINA_DISABLE_SONGS);
|
||||
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::BulletText("Pitch");
|
||||
DrawButtonLine(ICON_FA_ARROW_UP, 0, BTN_CUSTOM_OCARINA_PITCH_UP);
|
||||
DrawButtonLine(ICON_FA_ARROW_DOWN, 0, BTN_CUSTOM_OCARINA_PITCH_DOWN);
|
||||
DrawButtonLine(ICON_FA_ARROW_UP "##Pitch", 0, BTN_CUSTOM_OCARINA_PITCH_UP);
|
||||
DrawButtonLine(ICON_FA_ARROW_DOWN "##Pitch", 0, BTN_CUSTOM_OCARINA_PITCH_DOWN);
|
||||
|
||||
if (!CVarGetInteger(CVAR_SETTING("CustomOcarina.Enabled"), 0)) {
|
||||
ImGui::EndDisabled();
|
||||
|
|
|
@ -155,12 +155,12 @@ const std::string CustomMessage::GetFrench(MessageFormat format) const {
|
|||
}
|
||||
|
||||
const std::string CustomMessage::GetForCurrentLanguage(MessageFormat format) const {
|
||||
return GetForLanguage(((Language)gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language,
|
||||
format);
|
||||
return GetForLanguage(
|
||||
((Language)gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : (Language)gSaveContext.language, format);
|
||||
}
|
||||
|
||||
const std::string CustomMessage::GetForLanguage(uint8_t language, MessageFormat format) const {
|
||||
std::string output = messages[language] != TODO_TRANSLATE ? messages[language] : messages[LANGUAGE_ENG];
|
||||
std::string output = !messages[language].starts_with(TODO_TRANSLATE) ? messages[language] : messages[LANGUAGE_ENG];
|
||||
ProcessMessageFormat(output, format);
|
||||
return output;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "soh/ActorDB.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
#include "soh/Enhancements/nametag.h"
|
||||
#include "soh/ShipInit.hpp"
|
||||
|
||||
#include <array>
|
||||
#include <bit>
|
||||
|
@ -13,6 +14,7 @@
|
|||
#include <string>
|
||||
#include <libultraship/bridge.h>
|
||||
#include <libultraship/libultraship.h>
|
||||
#include <spdlog/fmt/fmt.h>
|
||||
#include "soh/OTRGlobals.h"
|
||||
#include "soh/cvar_prefixes.h"
|
||||
|
||||
|
@ -31,6 +33,10 @@ extern PlayState* gPlayState;
|
|||
#define DEKUNUTS_FLOWER 10
|
||||
#define DEBUG_ACTOR_NAMETAG_TAG "debug_actor_viewer"
|
||||
|
||||
#define CVAR_ACTOR_NAME_TAGS(val) CVAR_DEVELOPER_TOOLS("ActorViewer.NameTags." val)
|
||||
#define CVAR_ACTOR_NAME_TAGS_ENABLED_NAME CVAR_ACTOR_NAME_TAGS("Enabled")
|
||||
#define CVAR_ACTOR_NAME_TAGS_ENABLED CVarGetInteger(CVAR_ACTOR_NAME_TAGS("Enabled"), 0)
|
||||
|
||||
typedef struct {
|
||||
u16 id;
|
||||
u16 params;
|
||||
|
@ -67,6 +73,10 @@ const std::string GetActorDescription(u16 id) {
|
|||
return ActorDB::Instance->RetrieveEntry(id).entry.valid ? ActorDB::Instance->RetrieveEntry(id).entry.desc : "???";
|
||||
}
|
||||
|
||||
const std::string GetActorDebugName(u16 id) {
|
||||
return ActorDB::Instance->RetrieveEntry(id).entry.valid ? ActorDB::Instance->RetrieveEntry(id).entry.name : "???";
|
||||
}
|
||||
|
||||
template <typename T> void DrawGroupWithBorder(T&& drawFunc, std::string section) {
|
||||
// First group encapsulates the inner portion and border
|
||||
ImGui::BeginChild(std::string("##" + section).c_str(), ImVec2(0, 0),
|
||||
|
@ -812,25 +822,37 @@ std::vector<u16> GetActorsWithDescriptionContainingString(std::string s) {
|
|||
}
|
||||
|
||||
void ActorViewer_AddTagForActor(Actor* actor) {
|
||||
int val = CVarGetInteger(CVAR_DEVELOPER_TOOLS("ActorViewer.NameTags"), ACTORVIEWER_NAMETAGS_NONE);
|
||||
auto entry = ActorDB::Instance->RetrieveEntry(actor->id);
|
||||
std::string tag;
|
||||
|
||||
if (val > 0 && entry.entry.valid) {
|
||||
switch (val) {
|
||||
case ACTORVIEWER_NAMETAGS_DESC:
|
||||
tag = entry.desc;
|
||||
break;
|
||||
case ACTORVIEWER_NAMETAGS_NAME:
|
||||
tag = entry.name;
|
||||
break;
|
||||
case ACTORVIEWER_NAMETAGS_BOTH:
|
||||
tag = entry.name + '\n' + entry.desc;
|
||||
break;
|
||||
}
|
||||
|
||||
NameTag_RegisterForActorWithOptions(actor, tag.c_str(), { .tag = DEBUG_ACTOR_NAMETAG_TAG });
|
||||
if (!CVarGetInteger(CVAR_ACTOR_NAME_TAGS("Enabled"), 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<std::string> parts;
|
||||
|
||||
if (CVarGetInteger(CVAR_ACTOR_NAME_TAGS("DisplayID"), 0)) {
|
||||
parts.push_back(GetActorDebugName(actor->id));
|
||||
}
|
||||
if (CVarGetInteger(CVAR_ACTOR_NAME_TAGS("DisplayDescription"), 0)) {
|
||||
parts.push_back(GetActorDescription(actor->id));
|
||||
}
|
||||
if (CVarGetInteger(CVAR_ACTOR_NAME_TAGS("DisplayCategory"), 0)) {
|
||||
parts.push_back(acMapping[actor->category]);
|
||||
}
|
||||
if (CVarGetInteger(CVAR_ACTOR_NAME_TAGS("DisplayParams"), 0)) {
|
||||
parts.push_back(fmt::format("0x{:04X} ({})", (u16)actor->params, actor->params));
|
||||
}
|
||||
|
||||
std::string tag = "";
|
||||
for (size_t i = 0; i < parts.size(); i++) {
|
||||
if (i != 0) {
|
||||
tag += "\n";
|
||||
}
|
||||
tag += parts.at(i);
|
||||
}
|
||||
|
||||
bool withZBuffer = CVarGetInteger(CVAR_ACTOR_NAME_TAGS("WithZBuffer"), 0);
|
||||
|
||||
NameTag_RegisterForActorWithOptions(actor, tag.c_str(),
|
||||
{ .tag = DEBUG_ACTOR_NAMETAG_TAG, .noZBuffer = !withZBuffer });
|
||||
}
|
||||
|
||||
void ActorViewer_AddTagForAllActors() {
|
||||
|
@ -881,6 +903,57 @@ void ActorViewerWindow::DrawElement() {
|
|||
}
|
||||
lastSceneId = gPlayState->sceneNum;
|
||||
|
||||
if (ImGui::BeginChild("options", ImVec2(0, 0), ImGuiChildFlags_Border | ImGuiChildFlags_AutoResizeY)) {
|
||||
bool toggled = false;
|
||||
bool optionChange = false;
|
||||
|
||||
ImGui::SeparatorText("Options");
|
||||
|
||||
toggled = UIWidgets::CVarCheckbox("Actor Name Tags", CVAR_ACTOR_NAME_TAGS("Enabled"),
|
||||
{ { .tooltip = "Adds \"name tags\" above actors for identification" } });
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
UIWidgets::Button("Display Items", { { .tooltip = "Click to add display items on the name tags" } });
|
||||
|
||||
if (ImGui::BeginPopupContextItem(nullptr, ImGuiPopupFlags_MouseButtonLeft | ImGuiPopupFlags_NoReopen)) {
|
||||
optionChange |= UIWidgets::CVarCheckbox("ID", CVAR_ACTOR_NAME_TAGS("DisplayID"));
|
||||
optionChange |= UIWidgets::CVarCheckbox("Description", CVAR_ACTOR_NAME_TAGS("DisplayDescription"));
|
||||
optionChange |= UIWidgets::CVarCheckbox("Category", CVAR_ACTOR_NAME_TAGS("DisplayCategory"));
|
||||
optionChange |= UIWidgets::CVarCheckbox("Params", CVAR_ACTOR_NAME_TAGS("DisplayParams"));
|
||||
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
optionChange |= UIWidgets::CVarCheckbox(
|
||||
"Name tags with Z-Buffer", CVAR_ACTOR_NAME_TAGS("WithZBuffer"),
|
||||
{ { .tooltip = "Allow name tags to be obstructed when behind geometry and actors" } });
|
||||
|
||||
if (toggled || optionChange) {
|
||||
bool tagsEnabled = CVarGetInteger(CVAR_ACTOR_NAME_TAGS("Enabled"), 0);
|
||||
bool noOptionsEnabled = !CVarGetInteger(CVAR_ACTOR_NAME_TAGS("DisplayID"), 0) &&
|
||||
!CVarGetInteger(CVAR_ACTOR_NAME_TAGS("DisplayDescription"), 0) &&
|
||||
!CVarGetInteger(CVAR_ACTOR_NAME_TAGS("DisplayCategory"), 0) &&
|
||||
!CVarGetInteger(CVAR_ACTOR_NAME_TAGS("DisplayParams"), 0);
|
||||
|
||||
// Save the user an extra click and prevent adding "empty" tags by enabling,
|
||||
// disabling, or setting an option based on what changed
|
||||
if (tagsEnabled && noOptionsEnabled) {
|
||||
if (toggled) {
|
||||
CVarSetInteger(CVAR_ACTOR_NAME_TAGS("DisplayID"), 1);
|
||||
} else {
|
||||
CVarSetInteger(CVAR_ACTOR_NAME_TAGS("Enabled"), 0);
|
||||
}
|
||||
} else if (optionChange && !tagsEnabled && !noOptionsEnabled) {
|
||||
CVarSetInteger(CVAR_ACTOR_NAME_TAGS("Enabled"), 1);
|
||||
}
|
||||
|
||||
NameTag_RemoveAllByTag(DEBUG_ACTOR_NAMETAG_TAG);
|
||||
ActorViewer_AddTagForAllActors();
|
||||
}
|
||||
}
|
||||
ImGui::EndChild();
|
||||
|
||||
PushStyleCombobox(THEME_COLOR);
|
||||
if (ImGui::BeginCombo("Actor Type", acMapping[category])) {
|
||||
for (int i = 0; i < acMapping.size(); i++) {
|
||||
|
@ -1160,20 +1233,6 @@ void ActorViewerWindow::DrawElement() {
|
|||
ImGui::TreePop();
|
||||
}
|
||||
PopStyleHeader();
|
||||
|
||||
static std::unordered_map<int32_t, const char*> nameTagOptions = {
|
||||
{ 0, "None" },
|
||||
{ 1, "Short Description" },
|
||||
{ 2, "Actor ID" },
|
||||
{ 3, "Both" },
|
||||
};
|
||||
|
||||
if (CVarCombobox(
|
||||
"Actor Name Tags", CVAR_DEVELOPER_TOOLS("ActorViewer.NameTags"), nameTagOptions,
|
||||
ComboboxOptions().Color(THEME_COLOR).Tooltip("Adds \"name tags\" above actors for identification"))) {
|
||||
NameTag_RemoveAllByTag(DEBUG_ACTOR_NAMETAG_TAG);
|
||||
ActorViewer_AddTagForAllActors();
|
||||
}
|
||||
} else {
|
||||
ImGui::Text("Global Context needed for actor info!");
|
||||
if (needs_reset) {
|
||||
|
@ -1190,9 +1249,9 @@ void ActorViewerWindow::DrawElement() {
|
|||
ImGui::EndDisabled();
|
||||
}
|
||||
|
||||
void ActorViewerWindow::InitElement() {
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnActorInit>([](void* refActor) {
|
||||
Actor* actor = static_cast<Actor*>(refActor);
|
||||
ActorViewer_AddTagForActor(actor);
|
||||
});
|
||||
void ActorViewer_RegisterNameTagHooks() {
|
||||
COND_HOOK(OnActorInit, CVAR_ACTOR_NAME_TAGS_ENABLED,
|
||||
[](void* actor) { ActorViewer_AddTagForActor(static_cast<Actor*>(actor)); });
|
||||
}
|
||||
|
||||
RegisterShipInitFunc nametagInit(ActorViewer_RegisterNameTagHooks, { CVAR_ACTOR_NAME_TAGS_ENABLED_NAME });
|
||||
|
|
|
@ -7,6 +7,6 @@ class ActorViewerWindow final : public Ship::GuiWindow {
|
|||
using GuiWindow::GuiWindow;
|
||||
|
||||
void DrawElement() override;
|
||||
void InitElement() override;
|
||||
void InitElement() override{};
|
||||
void UpdateElement() override{};
|
||||
};
|
||||
|
|
|
@ -29,6 +29,7 @@ DEFINE_HOOK(OnShopSlotChange, (uint8_t cursorIndex, int16_t price));
|
|||
DEFINE_HOOK(OnActorInit, (void* actor));
|
||||
DEFINE_HOOK(OnActorUpdate, (void* actor));
|
||||
DEFINE_HOOK(OnActorKill, (void* actor));
|
||||
DEFINE_HOOK(OnActorDestroy, (void* actor));
|
||||
DEFINE_HOOK(OnEnemyDefeat, (void* actor));
|
||||
DEFINE_HOOK(OnBossDefeat, (void* actor));
|
||||
DEFINE_HOOK(OnTimestamp, (u8 item));
|
||||
|
|
|
@ -122,6 +122,13 @@ void GameInteractor_ExecuteOnActorKill(void* actor) {
|
|||
GameInteractor::Instance->ExecuteHooksForFilter<GameInteractor::OnActorKill>(actor);
|
||||
}
|
||||
|
||||
void GameInteractor_ExecuteOnActorDestroy(void* actor) {
|
||||
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnActorDestroy>(actor);
|
||||
GameInteractor::Instance->ExecuteHooksForID<GameInteractor::OnActorDestroy>(((Actor*)actor)->id, actor);
|
||||
GameInteractor::Instance->ExecuteHooksForPtr<GameInteractor::OnActorDestroy>((uintptr_t)actor, actor);
|
||||
GameInteractor::Instance->ExecuteHooksForFilter<GameInteractor::OnActorDestroy>(actor);
|
||||
}
|
||||
|
||||
void GameInteractor_ExecuteOnEnemyDefeat(void* actor) {
|
||||
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnEnemyDefeat>(actor);
|
||||
GameInteractor::Instance->ExecuteHooksForID<GameInteractor::OnEnemyDefeat>(((Actor*)actor)->id, actor);
|
||||
|
|
|
@ -31,6 +31,7 @@ void GameInteractor_ExecuteOnCuccoOrChickenHatch();
|
|||
void GameInteractor_ExecuteOnActorInit(void* actor);
|
||||
void GameInteractor_ExecuteOnActorUpdate(void* actor);
|
||||
void GameInteractor_ExecuteOnActorKill(void* actor);
|
||||
void GameInteractor_ExecuteOnActorDestroy(void* actor);
|
||||
void GameInteractor_ExecuteOnEnemyDefeat(void* actor);
|
||||
void GameInteractor_ExecuteOnBossDefeat(void* actor);
|
||||
void GameInteractor_ExecuteOnTimestamp(u8 item);
|
||||
|
|
|
@ -519,6 +519,14 @@ typedef enum {
|
|||
// - `*BgHeavyBlock`
|
||||
VB_FREEZE_LINK_FOR_BLOCK_THROW,
|
||||
|
||||
// #### `result`
|
||||
// ```c
|
||||
// true
|
||||
// ```
|
||||
// #### `args`
|
||||
// - None
|
||||
VB_FREEZE_LINK_FOR_FOREST_PILLARS,
|
||||
|
||||
// #### `result`
|
||||
// ```c
|
||||
// true
|
||||
|
@ -1403,6 +1411,14 @@ typedef enum {
|
|||
// - `*BgTreemouth`
|
||||
VB_PLAY_DEKU_TREE_INTRO_CS,
|
||||
|
||||
// #### `result`
|
||||
// ```c
|
||||
// true
|
||||
// ```
|
||||
// #### `args`
|
||||
// - `*DemoKekkai`
|
||||
VB_PLAY_DISPEL_BARRIER_CS,
|
||||
|
||||
// #### `result`
|
||||
// ```c
|
||||
// true
|
||||
|
@ -1467,6 +1483,15 @@ typedef enum {
|
|||
// - None
|
||||
VB_PLAY_FIRE_ARROW_CS,
|
||||
|
||||
// #### `result`
|
||||
// ```c
|
||||
// true
|
||||
// ```
|
||||
// #### `args`
|
||||
// - `*EnHeishi2`
|
||||
// - `bool` (clearCamera - true if the code clears a sub-camera, false otherwise)
|
||||
VB_PLAY_GATE_OPENING_OR_CLOSING_CS,
|
||||
|
||||
// #### `result`
|
||||
// ```c
|
||||
// true
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "soh/Enhancements/randomizer/3drando/random.hpp"
|
||||
#include "soh/Enhancements/cosmetics/authenticGfxPatches.h"
|
||||
#include <soh/Enhancements/item-tables/ItemTableManager.h>
|
||||
#include "soh/Enhancements/nametag.h"
|
||||
#include "soh/Enhancements/timesaver_hook_handlers.h"
|
||||
#include "soh/Enhancements/TimeSavers/TimeSavers.h"
|
||||
#include "soh/Enhancements/randomizer/hook_handlers.h"
|
||||
|
@ -1090,7 +1089,6 @@ void InitMods() {
|
|||
RegisterRandomizedEnemySizes();
|
||||
RegisterOpenAllHours();
|
||||
RegisterToTMedallions();
|
||||
NameTag_RegisterHooks();
|
||||
RegisterFloorSwitchesHook();
|
||||
RegisterPatchHandHandler();
|
||||
RegisterHurtContainerModeHandler();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "soh/frame_interpolation.h"
|
||||
#include "soh/Enhancements/custom-message/CustomMessageInterfaceAddon.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
#include "soh/OTRGlobals.h"
|
||||
#include "soh/ShipUtils.h"
|
||||
|
||||
extern "C" {
|
||||
#include "z64.h"
|
||||
|
@ -26,12 +26,16 @@ typedef struct {
|
|||
int16_t height; // Textbox height
|
||||
int16_t width; // Textbox width
|
||||
int16_t yOffset; // Addition Y offset
|
||||
uint8_t noZBuffer; // Allow rendering over geometry
|
||||
Mtx* mtx; // Allocated Mtx for rendering
|
||||
Vtx* vtx; // Allocated Vtx for rendering
|
||||
} NameTag;
|
||||
|
||||
static std::vector<NameTag> nameTags;
|
||||
static std::vector<Gfx> nameTagDl;
|
||||
static bool sMirrorWorldActive = false;
|
||||
|
||||
void NameTag_RegisterHooks();
|
||||
|
||||
void FreeNameTag(NameTag* nameTag) {
|
||||
if (nameTag->vtx != nullptr) {
|
||||
|
@ -51,14 +55,14 @@ void DrawNameTag(PlayState* play, const NameTag* nameTag) {
|
|||
}
|
||||
|
||||
// Name tag is too far away to meaningfully read, don't bother rendering it
|
||||
if (nameTag->actor->xyzDistToPlayerSq > 200000.0f) {
|
||||
if (nameTag->actor->xyzDistToPlayerSq > 440000.0f) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Fade out name tags that are far away
|
||||
float alpha = 1.0f;
|
||||
if (nameTag->actor->xyzDistToPlayerSq > 160000.0f) {
|
||||
alpha = (200000.0f - nameTag->actor->xyzDistToPlayerSq) / 40000.0f;
|
||||
if (nameTag->actor->xyzDistToPlayerSq > 360000.0f) {
|
||||
alpha = (440000.0f - nameTag->actor->xyzDistToPlayerSq) / 80000.0f;
|
||||
}
|
||||
|
||||
float scale = 75.0f / 100.f;
|
||||
|
@ -79,7 +83,7 @@ void DrawNameTag(PlayState* play, const NameTag* nameTag) {
|
|||
textColor = CVarGetColor(CVAR_COSMETIC("HUD.NameTagActorText.Value"), textColor);
|
||||
}
|
||||
|
||||
FrameInterpolation_RecordOpenChild(nameTag->actor, 10);
|
||||
FrameInterpolation_RecordOpenChild(nameTag->actor, 0);
|
||||
|
||||
// Prefer the highest between world position and focus position if targetable
|
||||
float posY = nameTag->actor->world.pos.y;
|
||||
|
@ -92,7 +96,7 @@ void DrawNameTag(PlayState* play, const NameTag* nameTag) {
|
|||
// Set position, billboard effect, scale (with mirror mode), then center nametag
|
||||
Matrix_Translate(nameTag->actor->world.pos.x, posY, nameTag->actor->world.pos.z, MTXMODE_NEW);
|
||||
Matrix_ReplaceRotation(&play->billboardMtxF);
|
||||
Matrix_Scale(scale * (CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0) ? -1 : 1), -scale, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_Scale(scale * (sMirrorWorldActive ? -1.0f : 1.0f), -scale, 1.0f, MTXMODE_APPLY);
|
||||
Matrix_Translate(-(float)nameTag->width / 2, -nameTag->height, 0, MTXMODE_APPLY);
|
||||
Matrix_ToMtx(nameTag->mtx, (char*)__FILE__, __LINE__);
|
||||
|
||||
|
@ -154,15 +158,27 @@ void DrawNameTags() {
|
|||
OPEN_DISPS(gPlayState->state.gfxCtx);
|
||||
|
||||
// Setup before rendering name tags
|
||||
Gfx_SetupDL_38Xlu(gPlayState->state.gfxCtx);
|
||||
nameTagDl.push_back(gsDPSetAlphaDither(G_AD_DISABLE));
|
||||
nameTagDl.push_back(gsSPClearGeometryMode(G_SHADE));
|
||||
POLY_XLU_DISP = Gfx_SetupDL_39(POLY_XLU_DISP);
|
||||
|
||||
nameTagDl.push_back(gsDPSetAlphaCompare(G_AC_NONE));
|
||||
nameTagDl.push_back(
|
||||
gsDPSetCombineLERP(0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0));
|
||||
|
||||
bool zbufferEnabled = false;
|
||||
|
||||
// Add all the name tags
|
||||
for (const auto& nameTag : nameTags) {
|
||||
// Toggle ZBuffer mode based on last state and next tag
|
||||
if (zbufferEnabled == nameTag.noZBuffer) {
|
||||
if (nameTag.noZBuffer) {
|
||||
nameTagDl.push_back(gsSPClearGeometryMode(G_ZBUFFER));
|
||||
zbufferEnabled = false;
|
||||
} else {
|
||||
nameTagDl.push_back(gsSPSetGeometryMode(G_ZBUFFER));
|
||||
zbufferEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
DrawNameTag(gPlayState, &nameTag);
|
||||
}
|
||||
|
||||
|
@ -189,22 +205,22 @@ void UpdateNameTags() {
|
|||
|
||||
return aDistToCamera > bDistToCamera;
|
||||
});
|
||||
|
||||
sMirrorWorldActive = CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0);
|
||||
}
|
||||
|
||||
extern "C" void NameTag_RegisterForActorWithOptions(Actor* actor, const char* text, NameTagOptions options) {
|
||||
std::string processedText = std::string(Interface_ReplaceSpecialCharacters((char*)text));
|
||||
|
||||
// Strip out unsupported characters
|
||||
processedText.erase(std::remove_if(processedText.begin(), processedText.end(),
|
||||
[](const char& c) {
|
||||
// 172 is max supported texture for the in-game font system,
|
||||
// and filter anything less than a space but not the newline or nul
|
||||
// characters
|
||||
return (unsigned char)c > 172 || (c < ' ' && c != '\n' && c != '\0');
|
||||
}),
|
||||
processedText.end());
|
||||
// 172 is max supported texture for the in-game font system,
|
||||
// and filter anything less than a space but not the newline or nul characters
|
||||
processedText.erase(
|
||||
std::remove_if(processedText.begin(), processedText.end(),
|
||||
[](const char& c) { return (uint8_t)c > 172 || (c < ' ' && c != '\n' && c != '\0'); }),
|
||||
processedText.end());
|
||||
|
||||
int16_t numChar = processedText.length();
|
||||
size_t numChar = processedText.length();
|
||||
int16_t numLines = 1;
|
||||
int16_t offsetX = 0;
|
||||
int16_t maxOffsetX = 0;
|
||||
|
@ -213,7 +229,7 @@ extern "C" void NameTag_RegisterForActorWithOptions(Actor* actor, const char* te
|
|||
Vtx* vertices = (Vtx*)calloc(sizeof(Vtx[4]), numChar + 1);
|
||||
|
||||
// Set all the char vtx first to get the total size for the textbox
|
||||
for (int16_t i = 0; i < numChar; i++) {
|
||||
for (size_t i = 0; i < numChar; i++) {
|
||||
if (processedText[i] == '\n') {
|
||||
offsetX = 0;
|
||||
numLines++;
|
||||
|
@ -249,10 +265,13 @@ extern "C" void NameTag_RegisterForActorWithOptions(Actor* actor, const char* te
|
|||
nameTag.height = height;
|
||||
nameTag.width = width;
|
||||
nameTag.yOffset = options.yOffset;
|
||||
nameTag.noZBuffer = options.noZBuffer;
|
||||
nameTag.mtx = new Mtx();
|
||||
nameTag.vtx = vertices;
|
||||
|
||||
nameTags.push_back(nameTag);
|
||||
|
||||
NameTag_RegisterHooks();
|
||||
}
|
||||
|
||||
extern "C" void NameTag_RegisterForActor(Actor* actor, const char* text) {
|
||||
|
@ -268,6 +287,8 @@ extern "C" void NameTag_RemoveAllForActor(Actor* actor) {
|
|||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
NameTag_RegisterHooks();
|
||||
}
|
||||
|
||||
extern "C" void NameTag_RemoveAllByTag(const char* tag) {
|
||||
|
@ -279,6 +300,8 @@ extern "C" void NameTag_RemoveAllByTag(const char* tag) {
|
|||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
NameTag_RegisterHooks();
|
||||
}
|
||||
|
||||
void RemoveAllNameTags() {
|
||||
|
@ -287,23 +310,49 @@ void RemoveAllNameTags() {
|
|||
}
|
||||
|
||||
nameTags.clear();
|
||||
|
||||
NameTag_RegisterHooks();
|
||||
}
|
||||
|
||||
static bool sRegisteredHooks = false;
|
||||
|
||||
void NameTag_RegisterHooks() {
|
||||
if (sRegisteredHooks) {
|
||||
static HOOK_ID gameStatUpdateHookID = 0;
|
||||
static HOOK_ID drawHookID = 0;
|
||||
static HOOK_ID playDestroyHookID = 0;
|
||||
static HOOK_ID actorDestroyHookID = 0;
|
||||
static bool sRegisteredHooks = false;
|
||||
|
||||
// Hooks already (un)registered based on nametags
|
||||
if ((nameTags.size() > 0) == sRegisteredHooks) {
|
||||
return;
|
||||
}
|
||||
|
||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnGameFrameUpdate>(gameStatUpdateHookID);
|
||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnPlayDrawEnd>(drawHookID);
|
||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnPlayDestroy>(playDestroyHookID);
|
||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnActorDestroy>(actorDestroyHookID);
|
||||
gameStatUpdateHookID = 0;
|
||||
drawHookID = 0;
|
||||
playDestroyHookID = 0;
|
||||
actorDestroyHookID = 0;
|
||||
sRegisteredHooks = false;
|
||||
|
||||
if (nameTags.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
sRegisteredHooks = true;
|
||||
|
||||
// Reorder tags every frame to mimic depth rendering
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameFrameUpdate>([]() { UpdateNameTags(); });
|
||||
gameStatUpdateHookID =
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameFrameUpdate>(UpdateNameTags);
|
||||
|
||||
// Render name tags at the end of player draw to avoid overflowing the display buffers
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnPlayDrawEnd>([]() { DrawNameTags(); });
|
||||
// Render name tags at the end of the Play World drawing
|
||||
drawHookID = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnPlayDrawEnd>(DrawNameTags);
|
||||
|
||||
// Remove all name tags on play state destroy as all actors are removed anyways
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnPlayDestroy>([]() { RemoveAllNameTags(); });
|
||||
playDestroyHookID = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnPlayDestroy>(RemoveAllNameTags);
|
||||
|
||||
// Remove all name tags for actor on destroy
|
||||
actorDestroyHookID = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnActorDestroy>(
|
||||
[](void* actor) { NameTag_RemoveAllForActor((Actor*)actor); });
|
||||
}
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
#ifndef _NAMETAG_H_
|
||||
#define _NAMETAG_H_
|
||||
#include <z64.h>
|
||||
#ifndef NAMETAG_H
|
||||
#define NAMETAG_H
|
||||
|
||||
#include <libultraship/color.h>
|
||||
#include <libultraship/libultra.h>
|
||||
|
||||
struct Actor;
|
||||
|
||||
typedef struct {
|
||||
const char* tag; // Tag identifier to filter/remove multiple tags
|
||||
int16_t yOffset; // Additional Y offset to apply for the name tag
|
||||
Color_RGBA8 textColor; // Text color override. Global color is used if alpha is 0
|
||||
uint8_t noZBuffer; // Allow rendering over geometry
|
||||
} NameTagOptions;
|
||||
|
||||
// Register required hooks for nametags on startup
|
||||
|
@ -28,4 +33,4 @@ void NameTag_RemoveAllByTag(const char* tag);
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif // _NAMETAG_H_
|
||||
#endif // NAMETAG_H
|
||||
|
|
|
@ -625,6 +625,8 @@ void ValidateEntrances(bool checkPoeCollectorAccess, bool checkOtherEntranceAcce
|
|||
if (ctx->GetOption(RSK_SHUFFLE_INTERIOR_ENTRANCES).Is(RO_INTERIOR_ENTRANCE_SHUFFLE_OFF)) {
|
||||
Rando::StaticData::RetrieveItem(RG_GUARD_HOUSE_KEY).ApplyEffect();
|
||||
}
|
||||
RegionTable(RR_ROOT)->adultNight = true;
|
||||
RegionTable(RR_ROOT)->adultDay = true;
|
||||
} else {
|
||||
ApplyAllAdvancmentItems();
|
||||
}
|
||||
|
@ -710,11 +712,11 @@ static void PareDownPlaythrough() {
|
|||
auto ctx = Rando::Context::GetInstance();
|
||||
std::vector<RandomizerCheck> toAddBackItem;
|
||||
// Start at sphere before Ganon's and count down
|
||||
for (int i = ctx->playthroughLocations.size() - 2; i >= 0; i--) {
|
||||
for (int32_t i = static_cast<int32_t>(ctx->playthroughLocations.size()) - 2; i >= 0; i--) {
|
||||
// Check each item location in sphere
|
||||
std::vector<int> erasableIndices;
|
||||
std::vector<RandomizerCheck> sphere = ctx->playthroughLocations.at(i);
|
||||
for (int j = sphere.size() - 1; j >= 0; j--) {
|
||||
for (int32_t j = static_cast<int32_t>(sphere.size()) - 1; j >= 0; j--) {
|
||||
RandomizerCheck loc = sphere.at(j);
|
||||
RandomizerGet locGet = ctx->GetItemLocation(loc)->GetPlacedRandomizerGet(); // Copy out item
|
||||
|
||||
|
|
|
@ -72,4 +72,4 @@ void GeneratePlaythrough();
|
|||
|
||||
bool CheckBeatable(RandomizerGet ignore = RG_NONE);
|
||||
|
||||
void ValidateEntrances(bool checkPoeCollectorAccess, bool checkOtherEntranceAccess);
|
||||
void ValidateEntrances(bool checkPoeCollectorAccess, bool checkOtherEntranceAccess);
|
||||
|
|
|
@ -2467,13 +2467,13 @@ void StaticData::HintTable_Init() {
|
|||
/*german*/ "ein abgelegener Ort",
|
||||
/*french*/ "un lieu isolé"));
|
||||
|
||||
hintTextTable[RHT_DUNGEON_ORDINARY] = HintText(CustomMessage(" It's ordinary.",
|
||||
/*german*/ "&Sieht aus wie immer.",
|
||||
/*french*/ "&Elle vous semble %rordinaire%w."));
|
||||
hintTextTable[RHT_DUNGEON_ORDINARY] = HintText(CustomMessage("&It's %gordinary%w.",
|
||||
/*german*/ "&Sieht aus %gwie immer%w.",
|
||||
/*french*/ "&Elle vous semble %gordinaire%w."));
|
||||
|
||||
hintTextTable[RHT_DUNGEON_MASTERFUL] = HintText(CustomMessage(" It's masterful!",
|
||||
/*german*/ "&Man kann darauf die Worte&%r\"Master Quest\"%w entziffern...",
|
||||
/*french*/ "&Étrange... les mots %r\"Master&Quest\"%w sont gravés dessus."));
|
||||
hintTextTable[RHT_DUNGEON_MASTERFUL] = HintText(CustomMessage("&It's %rmasterful%w!",
|
||||
/*german*/ "&Man kann darauf die Worte %r\"Master_Quest\"%w entziffern...",
|
||||
/*french*/ "&Étrange... les mots %r\"Master_Quest\"%w sont gravés dessus."));
|
||||
|
||||
// clang-format on
|
||||
}
|
||||
|
|
|
@ -63,11 +63,11 @@ const CustomMessage& HintText::GetAmbiguous(uint8_t selection) const {
|
|||
}
|
||||
|
||||
uint8_t HintText::GetAmbiguousSize() const {
|
||||
return ambiguousText.size();
|
||||
return static_cast<uint8_t>(ambiguousText.size());
|
||||
}
|
||||
|
||||
uint8_t HintText::GetObscureSize() const {
|
||||
return obscureText.size();
|
||||
return static_cast<uint8_t>(obscureText.size());
|
||||
}
|
||||
|
||||
const CustomMessage& HintText::GetHintMessage(uint8_t selection) const {
|
||||
|
@ -598,7 +598,7 @@ static void DistributeHints(std::vector<uint8_t>& selected, size_t stoneCount,
|
|||
}
|
||||
// if stones are left, assign junk to every remaining stone as a fallback.
|
||||
if (stoneCount > 0) {
|
||||
selected[selected.size() - 1] += stoneCount;
|
||||
selected[static_cast<uint8_t>(selected.size()) - 1] += static_cast<uint8_t>(stoneCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -325,7 +325,7 @@ RandomizerGet GetJunkItem() {
|
|||
return RandomElement(JunkPoolItems);
|
||||
}
|
||||
// Ice Trap is the last item in JunkPoolItems, so subtract 1 to never hit that index
|
||||
uint8_t idx = Random(0, JunkPoolItems.size() - 1);
|
||||
uint8_t idx = Random(0, static_cast<uint32_t>(JunkPoolItems.size()) - 1);
|
||||
return JunkPoolItems[idx];
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ bool GenerateRandomizer(std::set<RandomizerCheck> excludedLocations, std::set<Ra
|
|||
ResetPerformanceTimers();
|
||||
StartPerformanceTimer(PT_WHOLE_SEED);
|
||||
|
||||
srand(time(NULL));
|
||||
srand(static_cast<uint32_t>(time(NULL)));
|
||||
// if a blank seed was entered, make a random one
|
||||
if (seedInput.empty()) {
|
||||
seedInput = std::to_string(rand() % 0xFFFFFFFF);
|
||||
|
@ -35,7 +35,7 @@ bool GenerateRandomizer(std::set<RandomizerCheck> excludedLocations, std::set<Ra
|
|||
int count;
|
||||
try {
|
||||
count = std::stoi(seedInput.substr(18), nullptr);
|
||||
} catch (std::invalid_argument& e) { count = 1; } catch (std::out_of_range& e) {
|
||||
} catch (std::invalid_argument&) { count = 1; } catch (std::out_of_range&) {
|
||||
count = 1;
|
||||
}
|
||||
Playthrough::Playthrough_Repeat(excludedLocations, enabledTricks, count);
|
||||
|
|
|
@ -13,7 +13,7 @@ double RandomDouble();
|
|||
|
||||
// Get a random element from a vector or array
|
||||
template <typename T> T RandomElement(std::vector<T>& vector, bool erase) {
|
||||
const auto idx = Random(0, vector.size());
|
||||
const auto idx = Random(0, static_cast<uint32_t>(vector.size()));
|
||||
const T selected = vector[idx];
|
||||
if (erase) {
|
||||
vector.erase(vector.begin() + idx);
|
||||
|
|
|
@ -115,7 +115,7 @@ uint16_t GetPriceFromSettings(Rando::Location* loc, PriceSettingsStruct priceSet
|
|||
if (random < ShopPriceProbability[i]) {
|
||||
// The randomly generated value has surpassed the total probability up to this point, so this is the
|
||||
// generated price i in range [0, 59], output in range [0, 295] in increments of 5
|
||||
return i * 5;
|
||||
return static_cast<uint16_t>(i) * 5;
|
||||
}
|
||||
}
|
||||
return 150;
|
||||
|
@ -196,7 +196,8 @@ uint16_t GetCheapBalancedPrice() {
|
|||
double random = RandomDouble();
|
||||
for (size_t i = 0; i < CheapPriceProbability.size(); i++) {
|
||||
if (random < CheapPriceProbability[i]) {
|
||||
return i * 5; // i in range [0, 19], output in range [0, 95] in increments of 5
|
||||
// i in range [0, 19], output in range [0, 95] in increments of 5
|
||||
return static_cast<uint16_t>(i) * 5;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
|
|
@ -632,7 +632,7 @@ void PlandomizerLoadSpoilerLog(std::string logFile) {
|
|||
PlandomizerAddToItemList(plandomizerRandoRetrieveItem(RG_SOLD_OUT));
|
||||
}
|
||||
}
|
||||
} catch (nlohmann::json::parse_error& e) {
|
||||
} catch (nlohmann::json::parse_error&) {
|
||||
Notification::Emit({ .message = "Invalid Spoiler Log Format", .remainingTime = 10.0f });
|
||||
}
|
||||
}
|
||||
|
@ -967,7 +967,7 @@ void PlandomizerDrawOptions() {
|
|||
}
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
size_t index = 0;
|
||||
int32_t index = 0;
|
||||
PlandoPushImageButtonStyle();
|
||||
for (auto& hash : plandoHash) {
|
||||
ImGui::PushID(index);
|
||||
|
@ -995,7 +995,7 @@ void PlandomizerDrawOptions() {
|
|||
ImGui::PopStyleVar();
|
||||
if (downRet) {
|
||||
if (hash == 0) {
|
||||
hash = gSeedTextures.size() - 1;
|
||||
hash = static_cast<int32_t>(gSeedTextures.size()) - 1;
|
||||
} else {
|
||||
hash--;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ void EnCow_MoveForRandomizer(EnCow* enCow, PlayState* play) {
|
|||
// Move left cow in lon lon tower
|
||||
enCow->actor.world.pos.x = -229.0f;
|
||||
enCow->actor.world.pos.z = 157.0f;
|
||||
enCow->actor.shape.rot.y = 15783.0f;
|
||||
enCow->actor.shape.rot.y = 15783;
|
||||
moved = true;
|
||||
} else if (play->sceneNum == SCENE_STABLE && enCow->actor.world.pos.x == -3 && enCow->actor.world.pos.z == -254) {
|
||||
// Move right cow in lon lon stable
|
||||
|
@ -39,7 +39,8 @@ void RegisterShuffleCows() {
|
|||
COND_VB_SHOULD(VB_GIVE_ITEM_FROM_COW, shouldRegister, {
|
||||
EnCow* enCow = va_arg(args, EnCow*);
|
||||
CowIdentity cowIdentity = OTRGlobals::Instance->gRandomizer->IdentifyCow(
|
||||
gPlayState->sceneNum, enCow->actor.world.pos.x, enCow->actor.world.pos.z);
|
||||
gPlayState->sceneNum, static_cast<int32_t>(enCow->actor.world.pos.x),
|
||||
static_cast<int32_t>(enCow->actor.world.pos.z));
|
||||
// Has this cow already rewarded an item?
|
||||
if (!Flags_GetRandomizerInf(cowIdentity.randomizerInf)) {
|
||||
Flags_SetRandomizerInf(cowIdentity.randomizerInf);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "static_data.h"
|
||||
#include <libultraship/libultra.h>
|
||||
#include "global.h"
|
||||
#include "soh/ResourceManagerHelpers.h"
|
||||
|
||||
extern "C" {
|
||||
#include "variables.h"
|
||||
|
@ -11,7 +12,6 @@ extern "C" {
|
|||
#include "overlays/actors/ovl_Obj_Kibako/z_obj_kibako.h"
|
||||
#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
|
||||
#include "soh/Enhancements/enhancementTypes.h"
|
||||
#include "soh/ResourceManagerHelpers.h"
|
||||
extern PlayState* gPlayState;
|
||||
}
|
||||
|
||||
|
@ -195,7 +195,7 @@ void ObjKibako2_RandomizerSpawnCollectible(ObjKibako2* crateActor, PlayState* pl
|
|||
item00->actor.draw = (ActorFunc)EnItem00_DrawRandomizedItem;
|
||||
item00->actor.velocity.y = 8.0f;
|
||||
item00->actor.speedXZ = 2.0f;
|
||||
item00->actor.world.rot.y = Rand_CenteredFloat(65536.0f);
|
||||
item00->actor.world.rot.y = static_cast<int16_t>(Rand_CenteredFloat(65536.0f));
|
||||
}
|
||||
|
||||
void ObjKibako_RandomizerSpawnCollectible(ObjKibako* smallCrateActor, PlayState* play) {
|
||||
|
@ -206,7 +206,7 @@ void ObjKibako_RandomizerSpawnCollectible(ObjKibako* smallCrateActor, PlayState*
|
|||
item00->actor.draw = (ActorFunc)EnItem00_DrawRandomizedItem;
|
||||
item00->actor.velocity.y = 8.0f;
|
||||
item00->actor.speedXZ = 2.0f;
|
||||
item00->actor.world.rot.y = Rand_CenteredFloat(65536.0f);
|
||||
item00->actor.world.rot.y = static_cast<int16_t>(Rand_CenteredFloat(65536.0f));
|
||||
}
|
||||
|
||||
void ObjKibako2_RandomizerInit(void* actorRef) {
|
||||
|
|
|
@ -117,7 +117,7 @@ void EnKusa_RandomizerSpawnCollectible(EnKusa* grassActor, PlayState* play) {
|
|||
item00->actor.draw = (ActorFunc)EnItem00_DrawRandomizedItem;
|
||||
item00->actor.velocity.y = 8.0f;
|
||||
item00->actor.speedXZ = 2.0f;
|
||||
item00->actor.world.rot.y = Rand_CenteredFloat(65536.0f);
|
||||
item00->actor.world.rot.y = static_cast<int16_t>(Rand_CenteredFloat(65536.0f));
|
||||
}
|
||||
|
||||
void EnKusa_RandomizerInit(void* actorRef) {
|
||||
|
|
|
@ -48,7 +48,7 @@ void ObjTsubo_RandomizerSpawnCollectible(ObjTsubo* potActor, PlayState* play) {
|
|||
item00->actor.draw = (ActorFunc)EnItem00_DrawRandomizedItem;
|
||||
item00->actor.velocity.y = 8.0f;
|
||||
item00->actor.speedXZ = 2.0f;
|
||||
item00->actor.world.rot.y = Rand_CenteredFloat(65536.0f);
|
||||
item00->actor.world.rot.y = static_cast<int16_t>(Rand_CenteredFloat(65536.0f));
|
||||
}
|
||||
|
||||
void ObjTsubo_RandomizerInit(void* actorRef) {
|
||||
|
|
|
@ -597,7 +597,7 @@ extern "C" s32 OverrideLimbDrawBarinade(PlayState* play, s32 limbIndex, Gfx** dL
|
|||
(uintptr_t)Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 8, 16, 1, 0,
|
||||
(play->gameplayFrames * -2) % 64, 16, 16));
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 200);
|
||||
Matrix_RotateX(-M_PI / 2, MTXMODE_APPLY);
|
||||
Matrix_RotateX(-M_PIf / 2.0f, MTXMODE_APPLY);
|
||||
} else if ((limbIndex >= 10) && (limbIndex < 20)) {
|
||||
rot->x -= 0x4000;
|
||||
*dList = NULL;
|
||||
|
@ -1097,7 +1097,7 @@ extern "C" void Randomizer_DrawBronzeScale(PlayState* play, GetItemEntry* getIte
|
|||
gSPSegment(POLY_XLU_DISP++, 0x08,
|
||||
(uintptr_t)Gfx_TwoTexScroll(play->state.gfxCtx, 0, 1 * (play->state.frames * 2),
|
||||
-1 * (play->state.frames * 2), 64, 64, 1, 1 * (play->state.frames * 4),
|
||||
1 * -(play->state.frames * 4), 32, 32));
|
||||
-1 * (play->state.frames * 4), 32, 32));
|
||||
|
||||
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
|
@ -1116,7 +1116,7 @@ extern "C" void Randomizer_DrawFishingPoleGI(PlayState* play, GetItemEntry* getI
|
|||
|
||||
// Draw rod
|
||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||
Matrix_Scale(0.2, 0.2, 0.2, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPDisplayList(POLY_OPA_DISP++, (Gfx*)gFishingPoleGiDL);
|
||||
|
@ -1126,8 +1126,8 @@ extern "C" void Randomizer_DrawFishingPoleGI(PlayState* play, GetItemEntry* getI
|
|||
Matrix_Scale(5.0f, 5.0f, 5.0f, MTXMODE_APPLY);
|
||||
pos = { 0.0f, -25.5f, -4.0f };
|
||||
Matrix_Translate(pos.x, pos.y, pos.z, MTXMODE_APPLY);
|
||||
Matrix_RotateZ(-M_PI_2, MTXMODE_APPLY);
|
||||
Matrix_RotateY(-M_PI_2 - 0.2f, MTXMODE_APPLY);
|
||||
Matrix_RotateZ(-M_PI_2f, MTXMODE_APPLY);
|
||||
Matrix_RotateY(-M_PI_2f - 0.2f, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.006f, 0.006f, 0.006f, MTXMODE_APPLY);
|
||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__),
|
||||
|
@ -1140,7 +1140,7 @@ extern "C" void Randomizer_DrawFishingPoleGI(PlayState* play, GetItemEntry* getI
|
|||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, (Gfx*)gFishingLureHookDL);
|
||||
Matrix_RotateZ(M_PI_2, MTXMODE_APPLY);
|
||||
Matrix_RotateZ(M_PI_2f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, (Gfx*)gFishingLureHookDL);
|
||||
|
@ -1149,7 +1149,7 @@ extern "C" void Randomizer_DrawFishingPoleGI(PlayState* play, GetItemEntry* getI
|
|||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, (Gfx*)gFishingLureHookDL);
|
||||
Matrix_RotateZ(M_PI / 2, MTXMODE_APPLY);
|
||||
Matrix_RotateZ(M_PIf / 2.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, (Gfx*)gFishingLureHookDL);
|
||||
|
|
|
@ -226,7 +226,8 @@ uint8_t Hint::GetNumberOfMessages() const {
|
|||
if (numMessages == 0) {
|
||||
numMessages = 1; // RANDOTODO make std::max actually fucking work for 3 arguments
|
||||
}
|
||||
return numMessages;
|
||||
// RANDOTODO will number of messages always be u8?
|
||||
return static_cast<uint8_t>(numMessages);
|
||||
}
|
||||
|
||||
const std::vector<std::string> Hint::GetAllMessageStrings(MessageFormat format) const {
|
||||
|
|
|
@ -1013,7 +1013,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l
|
|||
if (item00->itemEntry.getItemId == GI_SWORD_BGS) {
|
||||
gSaveContext.bgsFlag = true;
|
||||
}
|
||||
Item_Give(gPlayState, item00->itemEntry.itemId);
|
||||
Item_Give(gPlayState, static_cast<uint8_t>(item00->itemEntry.itemId));
|
||||
} else if (item00->itemEntry.modIndex == MOD_RANDOMIZER) {
|
||||
if (item00->itemEntry.getItemId == RG_ICE_TRAP) {
|
||||
gSaveContext.ship.pendingIceTrapCount++;
|
||||
|
@ -2137,23 +2137,23 @@ void RandomizerOnActorInitHandler(void* actorRef) {
|
|||
|
||||
void RandomizerOnGameFrameUpdateHandler() {
|
||||
if (Flags_GetRandomizerInf(RAND_INF_HAS_INFINITE_QUIVER)) {
|
||||
AMMO(ITEM_BOW) = CUR_CAPACITY(UPG_QUIVER);
|
||||
AMMO(ITEM_BOW) = static_cast<int8_t>(CUR_CAPACITY(UPG_QUIVER));
|
||||
}
|
||||
|
||||
if (Flags_GetRandomizerInf(RAND_INF_HAS_INFINITE_BOMB_BAG)) {
|
||||
AMMO(ITEM_BOMB) = CUR_CAPACITY(UPG_BOMB_BAG);
|
||||
AMMO(ITEM_BOMB) = static_cast<int8_t>(CUR_CAPACITY(UPG_BOMB_BAG));
|
||||
}
|
||||
|
||||
if (Flags_GetRandomizerInf(RAND_INF_HAS_INFINITE_BULLET_BAG)) {
|
||||
AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG);
|
||||
AMMO(ITEM_SLINGSHOT) = static_cast<int8_t>(CUR_CAPACITY(UPG_BULLET_BAG));
|
||||
}
|
||||
|
||||
if (Flags_GetRandomizerInf(RAND_INF_HAS_INFINITE_STICK_UPGRADE)) {
|
||||
AMMO(ITEM_STICK) = CUR_CAPACITY(UPG_STICKS);
|
||||
AMMO(ITEM_STICK) = static_cast<int8_t>(CUR_CAPACITY(UPG_STICKS));
|
||||
}
|
||||
|
||||
if (Flags_GetRandomizerInf(RAND_INF_HAS_INFINITE_NUT_UPGRADE)) {
|
||||
AMMO(ITEM_NUT) = CUR_CAPACITY(UPG_NUTS);
|
||||
AMMO(ITEM_NUT) = static_cast<int8_t>(CUR_CAPACITY(UPG_NUTS));
|
||||
}
|
||||
|
||||
if (Flags_GetRandomizerInf(RAND_INF_HAS_INFINITE_MAGIC_METER)) {
|
||||
|
@ -2165,7 +2165,7 @@ void RandomizerOnGameFrameUpdateHandler() {
|
|||
}
|
||||
|
||||
if (Flags_GetRandomizerInf(RAND_INF_HAS_INFINITE_MONEY)) {
|
||||
gSaveContext.rupees = CUR_CAPACITY(UPG_WALLET);
|
||||
gSaveContext.rupees = static_cast<int8_t>(CUR_CAPACITY(UPG_WALLET));
|
||||
}
|
||||
|
||||
if (!Flags_GetRandomizerInf(RAND_INF_HAS_WALLET)) {
|
||||
|
|
|
@ -10,9 +10,10 @@
|
|||
#include "soh/Enhancements/debugger/performanceTimer.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <soh/OTRGlobals.h>
|
||||
|
||||
#include "3drando/shops.hpp"
|
||||
extern "C" {
|
||||
extern SaveContext gSaveContext;
|
||||
extern PlayState* gPlayState;
|
||||
}
|
||||
|
||||
|
@ -45,17 +46,71 @@ bool LocationAccess::ConditionsMet(Region* parentRegion, bool calculatingAvailab
|
|||
conditionsMet = true;
|
||||
}
|
||||
|
||||
return conditionsMet &&
|
||||
(calculatingAvailableChecks || CanBuy()); // TODO: run CanBuy when price is known due to settings
|
||||
return conditionsMet && CanBuy(calculatingAvailableChecks);
|
||||
}
|
||||
|
||||
bool LocationAccess::CanBuy() const {
|
||||
return CanBuyAnother(location);
|
||||
static uint16_t GetMinimumPrice(const Rando::Location* loc) {
|
||||
extern PriceSettingsStruct shopsanityPrices;
|
||||
extern PriceSettingsStruct scrubPrices;
|
||||
extern PriceSettingsStruct merchantPrices;
|
||||
PriceSettingsStruct priceSettings = loc->GetRCType() == RCTYPE_SHOP ? shopsanityPrices
|
||||
: loc->GetRCType() == RCTYPE_SCRUB ? scrubPrices
|
||||
: merchantPrices;
|
||||
|
||||
auto ctx = Rando::Context::GetInstance();
|
||||
switch (ctx->GetOption(priceSettings.main).Get()) {
|
||||
case RO_PRICE_VANILLA:
|
||||
return loc->GetVanillaPrice();
|
||||
case RO_PRICE_CHEAP_BALANCED:
|
||||
return 0;
|
||||
case RO_PRICE_BALANCED:
|
||||
return 0;
|
||||
case RO_PRICE_FIXED:
|
||||
return ctx->GetOption(priceSettings.fixedPrice).Get() * 5;
|
||||
case RO_PRICE_RANGE: {
|
||||
uint16_t range1 = ctx->GetOption(priceSettings.range1).Get() * 5;
|
||||
uint16_t range2 = ctx->GetOption(priceSettings.range1).Get() * 5;
|
||||
return range1 < range2 ? range1 : range2;
|
||||
}
|
||||
case RO_PRICE_SET_BY_WALLET: {
|
||||
if (ctx->GetOption(priceSettings.noWallet).Get()) {
|
||||
return 0;
|
||||
} else if (ctx->GetOption(priceSettings.childWallet).Get()) {
|
||||
return 1;
|
||||
} else if (ctx->GetOption(priceSettings.adultWallet).Get()) {
|
||||
return 100;
|
||||
} else if (ctx->GetOption(priceSettings.giantWallet).Get()) {
|
||||
return 201;
|
||||
} else {
|
||||
return 501;
|
||||
}
|
||||
}
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool LocationAccess::CanBuy(bool calculatingAvailableChecks) const {
|
||||
const auto& loc = Rando::StaticData::GetLocation(location);
|
||||
const auto& itemLoc = OTRGlobals::Instance->gRandoContext->GetItemLocation(location);
|
||||
|
||||
if (loc->GetRCType() == RCTYPE_SHOP || loc->GetRCType() == RCTYPE_SCRUB || loc->GetRCType() == RCTYPE_MERCHANT) {
|
||||
// Checks should only be identified while playing
|
||||
if (calculatingAvailableChecks && itemLoc->GetCheckStatus() != RCSHOW_IDENTIFIED) {
|
||||
return CanBuyAnother(GetMinimumPrice(loc));
|
||||
} else {
|
||||
return CanBuyAnother(itemLoc->GetPrice());
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CanBuyAnother(RandomizerCheck rc) {
|
||||
uint16_t price = ctx->GetItemLocation(rc)->GetPrice();
|
||||
return CanBuyAnother(ctx->GetItemLocation(rc)->GetPrice());
|
||||
}
|
||||
|
||||
bool CanBuyAnother(uint16_t price) {
|
||||
if (price > 500) {
|
||||
return logic->HasItem(RG_TYCOON_WALLET);
|
||||
} else if (price > 200) {
|
||||
|
@ -275,7 +330,7 @@ bool BeanPlanted(const RandomizerRegion region) {
|
|||
if (gPlayState != nullptr && gPlayState->sceneNum == sceneID) {
|
||||
swch = gPlayState->actorCtx.flags.swch;
|
||||
} else if (sceneID != SCENE_ID_MAX) {
|
||||
swch = gSaveContext.sceneFlags[sceneID].swch;
|
||||
swch = Rando::Context::GetInstance()->GetLogic()->GetSaveContext()->sceneFlags[sceneID].swch;
|
||||
} else {
|
||||
swch = 0;
|
||||
}
|
||||
|
@ -486,17 +541,17 @@ std::string CleanCheckConditionString(std::string condition) {
|
|||
}
|
||||
|
||||
namespace Regions {
|
||||
const auto GetAllRegions() {
|
||||
auto GetAllRegions() {
|
||||
static const size_t regionCount = RR_MAX - (RR_NONE + 1);
|
||||
|
||||
static std::array<RandomizerRegion, regionCount> allRegions = {};
|
||||
|
||||
static bool intialized = false;
|
||||
if (!intialized) {
|
||||
static bool initialized = false;
|
||||
if (!initialized) {
|
||||
for (size_t i = 0; i < regionCount; i++) {
|
||||
allRegions[i] = (RandomizerRegion)((RR_NONE + 1) + i);
|
||||
}
|
||||
intialized = true;
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
return allRegions;
|
||||
|
@ -635,7 +690,7 @@ std::vector<Rando::Entrance*> GetShuffleableEntrances(Rando::EntranceType type,
|
|||
|
||||
Rando::Entrance* GetEntrance(RandomizerRegion source, RandomizerRegion destination) {
|
||||
for (auto& exit : RegionTable(source)->exits) {
|
||||
if (exit.GetConnectedRegionKey() == destination) {
|
||||
if (exit.GetOriginalConnectedRegionKey() == destination) {
|
||||
return &exit;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,9 +100,10 @@ class LocationAccess {
|
|||
std::string condition_str;
|
||||
|
||||
// Makes sure shop locations are buyable
|
||||
bool CanBuy() const;
|
||||
bool CanBuy(bool calculatingAvailableChecks) const;
|
||||
};
|
||||
|
||||
bool CanBuyAnother(uint16_t price);
|
||||
bool CanBuyAnother(RandomizerCheck rc);
|
||||
|
||||
namespace Rando {
|
||||
|
|
|
@ -25,7 +25,6 @@ void RegionTable_Init_BottomOfTheWell() {
|
|||
}, {
|
||||
//Locations
|
||||
LOCATION(RC_BOTTOM_OF_THE_WELL_FRONT_CENTER_BOMBABLE_CHEST, logic->HasExplosives()),
|
||||
LOCATION(RC_BOTTOM_OF_THE_WELL_FREESTANDING_KEY, (logic->HasItem(RG_BRONZE_SCALE) || logic->LoweredWaterInsideBotw) && logic->CanUse(RG_STICKS) || logic->CanUse(RG_DINS_FIRE)),
|
||||
LOCATION(RC_BOTTOM_OF_THE_WELL_UNDERWATER_FRONT_CHEST, logic->LoweredWaterInsideBotw),
|
||||
LOCATION(RC_BOTTOM_OF_THE_WELL_UNDERWATER_LEFT_CHEST, logic->LoweredWaterInsideBotw),
|
||||
LOCATION(RC_BOTTOM_OF_THE_WELL_NEAR_ENTRANCE_POT_1, logic->CanBreakPots()),
|
||||
|
|
|
@ -20,7 +20,7 @@ void RegionTable_Init_FireTemple() {
|
|||
//Exits
|
||||
Entrance(RR_FIRE_TEMPLE_ENTRYWAY, []{return true;}),
|
||||
Entrance(RR_FIRE_TEMPLE_NEAR_BOSS_ROOM, []{return logic->FireTimer() >= 24;}),
|
||||
Entrance(RR_FIRE_TEMPLE_LOOP_ENEMIES, []{return Here(RR_FIRE_TEMPLE_FIRST_ROOM, []{return logic->CanUse(RG_MEGATON_HAMMER);}) && (logic->SmallKeys(RR_FIRE_TEMPLE, 8) || !logic->IsKeysanity);}),
|
||||
Entrance(RR_FIRE_TEMPLE_LOOP_ENEMIES, []{return Here(RR_FIRE_TEMPLE_FIRST_ROOM, []{return logic->CanUse(RG_MEGATON_HAMMER);}) && (logic->SmallKeys(RR_FIRE_TEMPLE, 8) || !logic->IsFireLoopLocked);}),
|
||||
Entrance(RR_FIRE_TEMPLE_LOOP_EXIT, []{return true;}),
|
||||
Entrance(RR_FIRE_TEMPLE_BIG_LAVA_ROOM, []{return logic->SmallKeys(RR_FIRE_TEMPLE, 2) && logic->FireTimer() >= 24;}),
|
||||
});
|
||||
|
@ -43,7 +43,7 @@ void RegionTable_Init_FireTemple() {
|
|||
|
||||
areaTable[RR_FIRE_TEMPLE_LOOP_ENEMIES] = Region("Fire Temple Loop Enemies", "Fire Temple", {RA_FIRE_TEMPLE}, NO_DAY_NIGHT_CYCLE, {}, {}, {
|
||||
//Exits
|
||||
Entrance(RR_FIRE_TEMPLE_FIRST_ROOM, []{return logic->SmallKeys(RR_FIRE_TEMPLE, 8) || !logic->IsKeysanity;}),
|
||||
Entrance(RR_FIRE_TEMPLE_FIRST_ROOM, []{return logic->SmallKeys(RR_FIRE_TEMPLE, 8) || !logic->IsFireLoopLocked;}),
|
||||
Entrance(RR_FIRE_TEMPLE_LOOP_TILES, []{return Here(RR_FIRE_TEMPLE_LOOP_ENEMIES, []{return logic->CanKillEnemy(RE_TORCH_SLUG) && logic->CanKillEnemy(RE_FIRE_KEESE);});}),
|
||||
});
|
||||
|
||||
|
|
|
@ -658,7 +658,7 @@ void RegionTable_Init_WaterTemple() {
|
|||
|
||||
areaTable[RR_WATER_TEMPLE_MQ_DRAGON_ROOM_ALCOVE] = Region("Water Temple MQ Dragon Room Alcove", "Water Temple", {RA_WATER_TEMPLE}, NO_DAY_NIGHT_CYCLE, {
|
||||
//Events
|
||||
EventAccess(&logic->MQWaterDragonTorches, []{return true;}),
|
||||
EventAccess(&logic->MQWaterDragonTorches, []{return logic->HasFireSource();}),
|
||||
},
|
||||
{
|
||||
//Locations
|
||||
|
|
|
@ -1386,6 +1386,7 @@ bool Logic::SmallKeys(RandomizerRegion dungeon, uint8_t requiredAmountGlitchless
|
|||
static_cast<uint8_t>(GlitchDifficulty::INTERMEDIATE) || GetDifficultyValueFromString(GlitchHover) >=
|
||||
static_cast<uint8_t>(GlitchDifficulty::INTERMEDIATE))) { return FireTempleKeys >= requiredAmountGlitched;
|
||||
}*/
|
||||
// If the Fire Temple loop lock is removed, Small key Count is set to 1 before starting
|
||||
return GetSmallKeyCount(SCENE_FIRE_TEMPLE) >= requiredAmountGlitchless;
|
||||
|
||||
case RR_WATER_TEMPLE:
|
||||
|
@ -1813,7 +1814,7 @@ void Logic::ApplyItemEffect(Item& item, bool state) {
|
|||
if (randoGet == RG_BOTTLE_WITH_BIG_POE) {
|
||||
BigPoes++;
|
||||
}
|
||||
mSaveContext->inventory.items[slot] = itemId;
|
||||
mSaveContext->inventory.items[slot] = static_cast<uint8_t>(itemId);
|
||||
} break;
|
||||
case RG_RUTOS_LETTER:
|
||||
SetRandoInf(RAND_INF_OBTAINED_RUTOS_LETTER, state);
|
||||
|
@ -2305,7 +2306,7 @@ void Logic::SetEventChkInf(int32_t flag, bool state) {
|
|||
}
|
||||
|
||||
uint8_t Logic::GetGSCount() {
|
||||
return mSaveContext->inventory.gsTokens;
|
||||
return static_cast<uint8_t>(mSaveContext->inventory.gsTokens);
|
||||
}
|
||||
|
||||
uint8_t Logic::GetAmmo(uint32_t item) {
|
||||
|
@ -2333,9 +2334,9 @@ void Logic::Reset() {
|
|||
StartPerformanceTimer(PT_LOGIC_RESET);
|
||||
memset(inLogic, false, sizeof(inLogic));
|
||||
// Settings-dependent variables
|
||||
IsKeysanity = ctx->GetOption(RSK_KEYSANITY).Is(RO_DUNGEON_ITEM_LOC_ANYWHERE) ||
|
||||
ctx->GetOption(RSK_KEYSANITY).Is(RO_DUNGEON_ITEM_LOC_ANYWHERE) ||
|
||||
ctx->GetOption(RSK_KEYSANITY).Is(RO_DUNGEON_ITEM_LOC_ANYWHERE);
|
||||
IsFireLoopLocked = ctx->GetOption(RSK_KEYSANITY).Is(RO_DUNGEON_ITEM_LOC_ANYWHERE) ||
|
||||
ctx->GetOption(RSK_KEYSANITY).Is(RO_DUNGEON_ITEM_LOC_OVERWORLD) ||
|
||||
ctx->GetOption(RSK_KEYSANITY).Is(RO_DUNGEON_ITEM_LOC_ANY_DUNGEON);
|
||||
|
||||
// AmmoCanDrop = /*AmmoDrops.IsNot(AMMODROPS_NONE)*/ false; TODO: AmmoDrop setting
|
||||
|
||||
|
@ -2397,7 +2398,7 @@ void Logic::Reset() {
|
|||
|
||||
// If not keysanity, start with 1 logical key to account for automatically unlocking the basement door in vanilla
|
||||
// FiT
|
||||
if (!IsKeysanity && ctx->GetDungeon(Rando::FIRE_TEMPLE)->IsVanilla()) {
|
||||
if (!IsFireLoopLocked && ctx->GetDungeon(Rando::FIRE_TEMPLE)->IsVanilla()) {
|
||||
SetSmallKeyCount(SCENE_FIRE_TEMPLE, 1);
|
||||
}
|
||||
|
||||
|
@ -2498,6 +2499,7 @@ void Logic::Reset() {
|
|||
ForestOpenBossCorridor = false;
|
||||
ShadowTrialFirstChest = false;
|
||||
MQGTGMazeSwitch = false;
|
||||
MQGTGRightSideSwitch = false;
|
||||
GTGPlatformSilverRupees = false;
|
||||
MQJabuHolesRoomDoor = false;
|
||||
JabuWestTentacle = false;
|
||||
|
|
|
@ -59,7 +59,7 @@ class Logic {
|
|||
bool LightTrialClear = false;
|
||||
|
||||
// Logical keysanity
|
||||
bool IsKeysanity = false;
|
||||
bool IsFireLoopLocked = false;
|
||||
|
||||
// Bottle Count
|
||||
uint8_t Bottles = 0;
|
||||
|
|
|
@ -83,11 +83,11 @@ void Option::RestoreDelayedOption() {
|
|||
contextSelection = delayedSelection;
|
||||
}
|
||||
|
||||
void Option::SetContextIndex(size_t idx) {
|
||||
void Option::SetContextIndex(uint8_t idx) {
|
||||
// TODO: Set to Context's OptionValue array.
|
||||
contextSelection = idx;
|
||||
if (contextSelection > options.size() - 1) {
|
||||
contextSelection = options.size() - 1;
|
||||
if (contextSelection > static_cast<uint8_t>(options.size() - 1)) {
|
||||
contextSelection = static_cast<uint8_t>(options.size() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ bool Option::IsHidden() const {
|
|||
|
||||
void Option::ChangeOptions(std::vector<std::string> opts) {
|
||||
if (GetOptionIndex() >= opts.size()) {
|
||||
CVarSetInteger(cvarName.c_str(), opts.size() - 1);
|
||||
CVarSetInteger(cvarName.c_str(), static_cast<uint8_t>(opts.size() - 1));
|
||||
}
|
||||
options = std::move(opts);
|
||||
}
|
||||
|
@ -206,8 +206,8 @@ bool Option::RenderCheckbox() {
|
|||
bool Option::RenderCombobox() {
|
||||
bool changed = false;
|
||||
uint8_t selected = CVarGetInteger(cvarName.c_str(), defaultOption);
|
||||
if (selected >= options.size()) {
|
||||
selected = options.size();
|
||||
if (selected >= static_cast<uint8_t>(options.size())) {
|
||||
selected = static_cast<uint8_t>(options.size());
|
||||
CVarSetInteger(cvarName.c_str(), selected);
|
||||
changed = true;
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
||||
|
@ -231,13 +231,13 @@ bool Option::RenderSlider() {
|
|||
bool changed = false;
|
||||
int val = CVarGetInteger(cvarName.c_str(), defaultOption);
|
||||
if (val > options.size() - 1) {
|
||||
val = options.size() - 1;
|
||||
val = static_cast<int>(options.size()) - 1;
|
||||
changed = true;
|
||||
}
|
||||
UIWidgets::IntSliderOptions widgetOptions = UIWidgets::IntSliderOptions()
|
||||
.Color(THEME_COLOR)
|
||||
.Min(0)
|
||||
.Max(options.size() - 1)
|
||||
.Max(static_cast<uint8_t>(options.size() - 1))
|
||||
.Tooltip(description.c_str())
|
||||
.Format(options[val].c_str())
|
||||
.DefaultValue(defaultOption);
|
||||
|
|
|
@ -241,11 +241,11 @@ class Option {
|
|||
void RestoreDelayedOption();
|
||||
|
||||
/**
|
||||
* @brief Set the rando context index for this Option. Also calls `SetVariable()`.
|
||||
* @brief Set the rando context index for this Option.
|
||||
*
|
||||
* @param idx the index to set as the selected index.
|
||||
*/
|
||||
void SetContextIndex(size_t idx);
|
||||
void SetContextIndex(uint8_t idx);
|
||||
|
||||
/**
|
||||
* @brief Hides this Option in the menu. (Not currently being used afaik, we prefer to
|
||||
|
|
|
@ -65,7 +65,7 @@ const std::string Randomizer::NaviRandoMessageTableID = "RandomizerNavi";
|
|||
const std::string Randomizer::IceTrapRandoMessageTableID = "RandomizerIceTrap";
|
||||
const std::string Randomizer::randoMiscHintsTableID = "RandomizerMiscHints";
|
||||
|
||||
static const char* englishRupeeNames[190] = {
|
||||
static const char* englishRupeeNames[188] = {
|
||||
"[P]",
|
||||
"Bad RNG Rolls",
|
||||
"Baht",
|
||||
|
@ -111,8 +111,6 @@ static const char* englishRupeeNames[190] = {
|
|||
"Dimes",
|
||||
"Dinars",
|
||||
"DNA",
|
||||
"Doge",
|
||||
"Dogecoin",
|
||||
"Doll Hairs",
|
||||
"Dollars",
|
||||
"Dollarydoos",
|
||||
|
@ -258,25 +256,25 @@ static const char* englishRupeeNames[190] = {
|
|||
"Zorkmids",
|
||||
};
|
||||
|
||||
static const char* germanRupeeNames[80] = {
|
||||
"Baht", "Bananen", "Bitcoin", "Bonbons", "Bratwürste", "Brause UFOs", "Brötchen", "Cent",
|
||||
"Diamanten", "Dinar", "Diridari", "Dogecoin", "Dollar", "Draken", "ECU", "Elexit",
|
||||
"Erz", "Erzbrocken", "Euro", "EXP", "Forint", "Franken", "Freunde", "Gil",
|
||||
"Gold", "Groschen", "Gulden", "Gummibären", "Heller", "Juwelen", "Karolin", "Kartoffeln",
|
||||
"Kies", "Knete", "Knochen", "Kohle", "Kraniche", "Kreuzer", "Kronen", "Kronkorken",
|
||||
"Kröten", "Lira", "Mark", "Mäuse", "Monde", "Moorhühner", "Moos", "Münzen",
|
||||
"Naira", "Penunze", "Pesa", "Pfandflaschen", "Pfennig", "Pfund", "Pilze", "Plastiks",
|
||||
"Pokédollar", "Radieschen", "Rand", "Rappen", "Real", "Rial", "Riyal", "Rubine",
|
||||
"Rupien", "Saphire", "Schilling", "Seelen", "Septime", "Smaragde", "Steine", "Sterne",
|
||||
"Sternis", "Tael", "Taler", "Wagenchips", "Won", "Yen", "Yuan", "Zenny",
|
||||
static const char* germanRupeeNames[79] = {
|
||||
"Baht", "Bananen", "Bitcoin", "Bonbons", "Bratwürste", "Brause UFOs", "Brötchen", "Cent",
|
||||
"Diamanten", "Dinar", "Diridari", "Dollar", "Draken", "ECU", "Elexit", "Erz",
|
||||
"Erzbrocken", "Euro", "EXP", "Forint", "Franken", "Freunde", "Gil", "Gold",
|
||||
"Groschen", "Gulden", "Gummibären", "Heller", "Juwelen", "Karolin", "Kartoffeln", "Kies",
|
||||
"Knete", "Knochen", "Kohle", "Kraniche", "Kreuzer", "Kronen", "Kronkorken", "Kröten",
|
||||
"Lira", "Mark", "Mäuse", "Monde", "Moorhühner", "Moos", "Münzen", "Naira",
|
||||
"Penunze", "Pesa", "Pfandflaschen", "Pfennig", "Pfund", "Pilze", "Plastiks", "Pokédollar",
|
||||
"Radieschen", "Rand", "Rappen", "Real", "Rial", "Riyal", "Rubine", "Rupien",
|
||||
"Saphire", "Schilling", "Seelen", "Septime", "Smaragde", "Steine", "Sterne", "Sternis",
|
||||
"Tael", "Taler", "Wagenchips", "Won", "Yen", "Yuan", "Zenny",
|
||||
};
|
||||
|
||||
static const char* frenchRupeeNames[40] = {
|
||||
"Anneaux", "Baguettes", "Balles", "Bananes", "Bitcoin", "Blés", "Bling", "Capsules",
|
||||
"Centimes", "Champignons", "Clochettes", "Crédits", "Croissants", "Diamants", "Dogecoin", "Dollars",
|
||||
"Émeraudes", "Éthers", "Étoiles", "Euros", "Florens", "Francs", "Galds", "Gils",
|
||||
"Grouses", "Halos", "Joyaux", "Lunes", "Mailles", "Munnies", "Orbes", "Orens",
|
||||
"Pépètes", "Pièces", "Plastyks", "Pokédollars", "Pokémon", "Radis", "Rubis", "Zennies",
|
||||
static const char* frenchRupeeNames[39] = {
|
||||
"Anneaux", "Baguettes", "Balles", "Bananes", "Bitcoin", "Blés", "Bling", "Capsules",
|
||||
"Centimes", "Champignons", "Clochettes", "Crédits", "Croissants", "Diamants", "Dollars", "Émeraudes",
|
||||
"Éthers", "Étoiles", "Euros", "Florens", "Francs", "Galds", "Gils", "Grouses",
|
||||
"Halos", "Joyaux", "Lunes", "Mailles", "Munnies", "Orbes", "Orens", "Pépètes",
|
||||
"Pièces", "Plastyks", "Pokédollars", "Pokémon", "Radis", "Rubis", "Zennies",
|
||||
};
|
||||
|
||||
Randomizer::Randomizer() {
|
||||
|
@ -357,9 +355,12 @@ std::unordered_map<s16, s16> getItemIdToItemId = {
|
|||
{ GI_CLAIM_CHECK, ITEM_CLAIM_CHECK },
|
||||
};
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma optimize("", off)
|
||||
#else
|
||||
#pragma GCC push_options
|
||||
#pragma GCC optimize("O0")
|
||||
#endif
|
||||
bool Randomizer::SpoilerFileExists(const char* spoilerFileName) {
|
||||
if (strcmp(spoilerFileName, "") != 0) {
|
||||
std::ifstream spoilerFileStream(SohUtils::Sanitize(spoilerFileName));
|
||||
|
@ -372,8 +373,11 @@ bool Randomizer::SpoilerFileExists(const char* spoilerFileName) {
|
|||
|
||||
return false;
|
||||
}
|
||||
#pragma GCC pop_options
|
||||
#ifdef _MSC_VER
|
||||
#pragma optimize("", on)
|
||||
#else
|
||||
#pragma GCC pop_options
|
||||
#endif
|
||||
|
||||
void Randomizer::LoadHintMessages() {
|
||||
auto ctx = Rando::Context::GetInstance();
|
||||
|
@ -3506,9 +3510,9 @@ CrateIdentity Randomizer::IdentifyCrate(s32 sceneNum, s32 posX, s32 posZ) {
|
|||
crateSceneNum = SCENE_MARKET_DAY;
|
||||
} else if (sceneNum == SCENE_GERUDOS_FORTRESS && gPlayState->linkAgeOnLoad == 1 && posX == 310) {
|
||||
if (posZ == -1830) {
|
||||
posZ = -1842.0f;
|
||||
posZ = -1842;
|
||||
} else if (posZ == -1770) {
|
||||
posZ = -1782.0f;
|
||||
posZ = -1782;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3734,13 +3738,15 @@ void RandomizerSettingsWindow::DrawElement() {
|
|||
}
|
||||
|
||||
UIWidgets::Spacer(0);
|
||||
ImGui::BeginDisabled((gSaveContext.gameMode != GAMEMODE_FILE_SELECT) || GameInteractor::IsSaveLoaded());
|
||||
if (UIWidgets::Button("Generate Randomizer",
|
||||
UIWidgets::ButtonOptions().Size(ImVec2(250.f, 0.f)).Color(THEME_COLOR))) {
|
||||
UIWidgets::ButtonOptions options = UIWidgets::ButtonOptions().Size(ImVec2(250.f, 0.f)).Color(THEME_COLOR);
|
||||
options.Disabled((gSaveContext.gameMode != GAMEMODE_FILE_SELECT) || GameInteractor::IsSaveLoaded());
|
||||
if (options.disabled) {
|
||||
options.DisabledTooltip("Must be on File Select to generate a randomizer seed.");
|
||||
}
|
||||
if (UIWidgets::Button("Generate Randomizer", options)) {
|
||||
ctx->SetSpoilerLoaded(false);
|
||||
GenerateRandomizer(CVarGetInteger(CVAR_RANDOMIZER_SETTING("ManualSeedEntry"), 0) ? seedString : "");
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
|
||||
ImGui::SameLine();
|
||||
if (!CVarGetInteger(CVAR_RANDOMIZER_SETTING("DontGenerateSpoiler"), 0)) {
|
||||
|
@ -4100,7 +4106,7 @@ void RandomizerSettingsWindow::DrawElement() {
|
|||
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
||||
}
|
||||
}
|
||||
if (ImGui::BeginTable("trickTags", showTag.size(),
|
||||
if (ImGui::BeginTable("trickTags", static_cast<int>(showTag.size()),
|
||||
ImGuiTableFlags_Resizable | ImGuiTableFlags_NoSavedSettings |
|
||||
ImGuiTableFlags_Borders)) {
|
||||
for (auto [rtTag, isShown] : showTag) {
|
||||
|
@ -4523,6 +4529,9 @@ CustomMessage Randomizer::GetMapGetItemMessageWithHint(GetItemEntry itemEntry) {
|
|||
messageEntry.Replace("[[typeHint]]", Rando::StaticData::hintTextTable[RHT_DUNGEON_ORDINARY].GetHintMessage());
|
||||
}
|
||||
|
||||
// BUG: the icon is not in the message yet so are not accounted for, so overflows are possible
|
||||
messageEntry.AutoFormat();
|
||||
|
||||
return messageEntry;
|
||||
}
|
||||
|
||||
|
@ -5572,7 +5581,7 @@ void RandomizerSettingsWindow::InitElement() {
|
|||
// (special cases for rando items)
|
||||
void Randomizer_GameplayStats_SetTimestamp(uint16_t item) {
|
||||
|
||||
u32 time = GAMEPLAYSTAT_TOTAL_TIME;
|
||||
u32 time = static_cast<u32>(GAMEPLAYSTAT_TOTAL_TIME);
|
||||
|
||||
// Have items in Link's pocket shown as being obtained at 0.1 seconds
|
||||
if (time == 0) {
|
||||
|
@ -5868,7 +5877,7 @@ extern "C" u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) {
|
|||
case RG_GREG_RUPEE:
|
||||
Rupees_ChangeBy(1);
|
||||
Flags_SetRandomizerInf(RAND_INF_GREG_FOUND);
|
||||
gSaveContext.ship.stats.itemTimestamp[TIMESTAMP_FOUND_GREG] = GAMEPLAYSTAT_TOTAL_TIME;
|
||||
gSaveContext.ship.stats.itemTimestamp[TIMESTAMP_FOUND_GREG] = static_cast<u32>(GAMEPLAYSTAT_TOTAL_TIME);
|
||||
break;
|
||||
case RG_TRIFORCE_PIECE:
|
||||
gSaveContext.ship.quest.data.randomizer.triforcePiecesCollected++;
|
||||
|
@ -5877,7 +5886,8 @@ extern "C" u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) {
|
|||
// Teleport to credits when goal is reached.
|
||||
if (gSaveContext.ship.quest.data.randomizer.triforcePiecesCollected ==
|
||||
(OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED) + 1)) {
|
||||
gSaveContext.ship.stats.itemTimestamp[TIMESTAMP_TRIFORCE_COMPLETED] = GAMEPLAYSTAT_TOTAL_TIME;
|
||||
gSaveContext.ship.stats.itemTimestamp[TIMESTAMP_TRIFORCE_COMPLETED] =
|
||||
static_cast<u32>(GAMEPLAYSTAT_TOTAL_TIME);
|
||||
gSaveContext.ship.stats.gameComplete = 1;
|
||||
Flags_SetRandomizerInf(RAND_INF_GRANT_GANONS_BOSSKEY);
|
||||
Play_PerformSave(play);
|
||||
|
@ -5910,12 +5920,12 @@ extern "C" u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) {
|
|||
case RG_DEKU_STICK_BAG:
|
||||
Inventory_ChangeUpgrade(UPG_STICKS, 1);
|
||||
INV_CONTENT(ITEM_STICK) = ITEM_STICK;
|
||||
AMMO(ITEM_STICK) = CUR_CAPACITY(UPG_STICKS);
|
||||
AMMO(ITEM_STICK) = static_cast<int8_t>(CUR_CAPACITY(UPG_STICKS));
|
||||
break;
|
||||
case RG_DEKU_NUT_BAG:
|
||||
Inventory_ChangeUpgrade(UPG_NUTS, 1);
|
||||
INV_CONTENT(ITEM_NUT) = ITEM_NUT;
|
||||
AMMO(ITEM_NUT) = CUR_CAPACITY(UPG_NUTS);
|
||||
AMMO(ITEM_NUT) = static_cast<int8_t>(CUR_CAPACITY(UPG_NUTS));
|
||||
break;
|
||||
default:
|
||||
LUSLOG_WARN("Randomizer_Item_Give didn't have behaviour specified for getItemId=%d", item);
|
||||
|
|
|
@ -1892,16 +1892,16 @@ static std::set<std::string> rainbowCVars = {
|
|||
|
||||
int hue = 0;
|
||||
void RainbowTick() {
|
||||
float freqHue = hue * 2 * M_PI / (360 * CVarGetFloat(CVAR_COSMETIC("RainbowSpeed"), 0.6f));
|
||||
float freqHue = hue * 2 * M_PIf / (360 * CVarGetFloat(CVAR_COSMETIC("RainbowSpeed"), 0.6f));
|
||||
for (auto& cvar : rainbowCVars) {
|
||||
if (CVarGetInteger((cvar + ".Rainbow").c_str(), 0) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Color_RGBA8 newColor;
|
||||
newColor.r = sin(freqHue + 0) * 127 + 128;
|
||||
newColor.g = sin(freqHue + (2 * M_PI / 3)) * 127 + 128;
|
||||
newColor.b = sin(freqHue + (4 * M_PI / 3)) * 127 + 128;
|
||||
newColor.r = static_cast<uint8_t>(sin(freqHue + 0) * 127) + 128;
|
||||
newColor.g = static_cast<uint8_t>(sin(freqHue + (2 * M_PI / 3)) * 127) + 128;
|
||||
newColor.b = static_cast<uint8_t>(sin(freqHue + (4 * M_PI / 3)) * 127) + 128;
|
||||
newColor.a = 255;
|
||||
|
||||
CVarSetColor((cvar + ".Value").c_str(), newColor);
|
||||
|
@ -1967,7 +1967,7 @@ void RecalculateAvailableChecks() {
|
|||
StartPerformanceTimer(PT_RECALCULATE_AVAILABLE_CHECKS);
|
||||
|
||||
std::vector<RandomizerCheck> targetLocations;
|
||||
targetLocations.reserve(RR_MAX);
|
||||
targetLocations.reserve(RC_MAX);
|
||||
for (auto& location : Rando::StaticData::GetLocationTable()) {
|
||||
RandomizerCheck rc = location.GetRandomizerCheck();
|
||||
Rando::ItemLocation* itemLocation = OTRGlobals::Instance->gRandoContext->GetItemLocation(rc);
|
||||
|
@ -1979,15 +1979,8 @@ void RecalculateAvailableChecks() {
|
|||
|
||||
std::vector<RandomizerCheck> availableChecks = ReachabilitySearch(targetLocations, RG_NONE, true);
|
||||
for (auto& rc : availableChecks) {
|
||||
const auto& location = Rando::StaticData::GetLocation(rc);
|
||||
const auto& itemLocation = OTRGlobals::Instance->gRandoContext->GetItemLocation(rc);
|
||||
if (location->GetRCType() == RCTYPE_SHOP && itemLocation->GetCheckStatus() == RCSHOW_IDENTIFIED) {
|
||||
if (CanBuyAnother(rc)) {
|
||||
itemLocation->SetAvailable(true);
|
||||
}
|
||||
} else {
|
||||
itemLocation->SetAvailable(true);
|
||||
}
|
||||
itemLocation->SetAvailable(true);
|
||||
}
|
||||
|
||||
totalChecksAvailable = 0;
|
||||
|
@ -2114,7 +2107,10 @@ void CheckTrackerSettingsWindow::DrawElement() {
|
|||
"with your current progress.")
|
||||
.Color(THEME_COLOR))) {
|
||||
enableAvailableChecks = CVarGetInteger(CVAR_TRACKER_CHECK("EnableAvailableChecks"), 0);
|
||||
RecalculateAvailableChecks();
|
||||
|
||||
if (GameInteractor::IsSaveLoaded(true)) {
|
||||
RecalculateAvailableChecks();
|
||||
}
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
|
||||
|
|
|
@ -382,7 +382,7 @@ const EntranceData entranceData[] = {
|
|||
};
|
||||
|
||||
// Check if Link is in the area and return that scene/entrance for tracking
|
||||
s8 LinkIsInArea(const EntranceData* entrance) {
|
||||
int16_t LinkIsInArea(const EntranceData* entrance) {
|
||||
bool result = false;
|
||||
|
||||
if (gPlayState == nullptr) {
|
||||
|
|
|
@ -670,17 +670,17 @@ void DrawItemCount(ItemTrackerItem item, bool hideMax) {
|
|||
|
||||
void DrawEquip(ItemTrackerItem item) {
|
||||
bool hasEquip = HasEquipment(item);
|
||||
int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36);
|
||||
float iconSize = static_cast<float>(CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36));
|
||||
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
|
||||
hasEquip && IsValidSaveFile() ? item.name : item.nameFaded),
|
||||
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
|
||||
ImVec2(iconSize, iconSize), ImVec2(0.0f, 0.0f), ImVec2(1, 1));
|
||||
|
||||
Tooltip(SohUtils::GetItemName(item.id).c_str());
|
||||
}
|
||||
|
||||
void DrawQuest(ItemTrackerItem item) {
|
||||
bool hasQuestItem = HasQuestItem(item);
|
||||
int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36);
|
||||
float iconSize = static_cast<float>(CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36));
|
||||
ImGui::BeginGroup();
|
||||
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
|
||||
hasQuestItem && IsValidSaveFile() ? item.name : item.nameFaded),
|
||||
|
@ -698,7 +698,7 @@ void DrawQuest(ItemTrackerItem item) {
|
|||
void DrawItem(ItemTrackerItem item) {
|
||||
|
||||
uint32_t actualItemId = GameInteractor::IsSaveLoaded() ? INV_CONTENT(item.id) : ITEM_NONE;
|
||||
int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36);
|
||||
float iconSize = static_cast<float>(CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36));
|
||||
bool hasItem = actualItemId != ITEM_NONE;
|
||||
std::string itemName = "";
|
||||
|
||||
|
@ -1015,7 +1015,7 @@ void DrawBottle(ItemTrackerItem item) {
|
|||
item = actualItemTrackerItemMap[actualItemId];
|
||||
}
|
||||
|
||||
int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36);
|
||||
float iconSize = static_cast<float>(CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36));
|
||||
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
|
||||
hasItem && IsValidSaveFile() ? item.name : item.nameFaded),
|
||||
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
|
||||
|
@ -1027,7 +1027,7 @@ void DrawDungeonItem(ItemTrackerItem item) {
|
|||
uint32_t itemId = item.id;
|
||||
ImU32 dungeonColor = IM_COL_WHITE;
|
||||
uint32_t bitMask = 1 << (item.id - ITEM_KEY_BOSS); // Bitset starts at ITEM_KEY_BOSS == 0. the rest are sequential
|
||||
int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36);
|
||||
float iconSize = static_cast<float>(CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36));
|
||||
bool hasItem = GameInteractor::IsSaveLoaded() ? (bitMask & gSaveContext.inventory.dungeonItems[item.data]) : false;
|
||||
bool hasSmallKey = GameInteractor::IsSaveLoaded() ? ((gSaveContext.inventory.dungeonKeys[item.data]) >= 0) : false;
|
||||
ImGui::BeginGroup();
|
||||
|
@ -1078,19 +1078,19 @@ void DrawDungeonItem(ItemTrackerItem item) {
|
|||
}
|
||||
|
||||
void DrawSong(ItemTrackerItem item) {
|
||||
int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36);
|
||||
float iconSize = static_cast<float>(CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36));
|
||||
ImVec2 p = ImGui::GetCursorScreenPos();
|
||||
bool hasSong = HasSong(item);
|
||||
ImGui::SetCursorScreenPos(ImVec2(p.x + 6, p.y));
|
||||
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
|
||||
hasSong && IsValidSaveFile() ? item.name : item.nameFaded),
|
||||
ImVec2(iconSize / 1.5, iconSize), ImVec2(0, 0), ImVec2(1, 1));
|
||||
ImVec2(iconSize / 1.5f, iconSize), ImVec2(0, 0), ImVec2(1, 1));
|
||||
Tooltip(SohUtils::GetQuestItemName(item.id).c_str());
|
||||
}
|
||||
|
||||
void DrawNotes(bool resizeable = false) {
|
||||
ImGui::BeginGroup();
|
||||
int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36);
|
||||
float iconSize = static_cast<float>(CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36));
|
||||
int iconSpacing = CVarGetInteger(CVAR_TRACKER_ITEM("IconSpacing"), 12);
|
||||
|
||||
struct ItemTrackerNotes {
|
||||
|
@ -1113,7 +1113,7 @@ void DrawNotes(bool resizeable = false) {
|
|||
}
|
||||
};
|
||||
ImVec2 size = resizeable ? ImVec2(-FLT_MIN, ImGui::GetContentRegionAvail().y)
|
||||
: ImVec2(((iconSize + iconSpacing) * 6) - 8, 200);
|
||||
: ImVec2(((iconSize + iconSpacing) * 6) - 8.0f, 200.0f);
|
||||
if (GameInteractor::IsSaveLoaded()) {
|
||||
if (ItemTrackerNotes::TrackerNotesInputTextMultiline("##ItemTrackerNotes", &itemTrackerNotes, size,
|
||||
ImGuiInputTextFlags_AllowTabInput)) {
|
||||
|
@ -1185,7 +1185,7 @@ void EndFloatingWindows() {
|
|||
* Takes in a vector of ItemTrackerItem and draws them in rows of N items
|
||||
*/
|
||||
void DrawItemsInRows(std::vector<ItemTrackerItem> items, int columns = 6) {
|
||||
int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36);
|
||||
float iconSize = static_cast<float>(CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36));
|
||||
int iconSpacing = CVarGetInteger(CVAR_TRACKER_ITEM("IconSpacing"), 12);
|
||||
int topPadding =
|
||||
(CVarGetInteger(CVAR_TRACKER_ITEM("WindowType"), TRACKER_WINDOW_FLOATING) == TRACKER_WINDOW_WINDOW) ? 20 : 0;
|
||||
|
@ -1194,7 +1194,7 @@ void DrawItemsInRows(std::vector<ItemTrackerItem> items, int columns = 6) {
|
|||
int row = i / columns;
|
||||
int column = i % columns;
|
||||
ImGui::SetCursorPos(
|
||||
ImVec2((column * (iconSize + iconSpacing) + 8), (row * (iconSize + iconSpacing)) + 8 + topPadding));
|
||||
ImVec2((column * (iconSize + iconSpacing) + 8.0f), (row * (iconSize + iconSpacing)) + 8.0f + topPadding));
|
||||
items[i].drawFunc(items[i]);
|
||||
}
|
||||
}
|
||||
|
@ -1208,10 +1208,10 @@ void DrawItemsInACircle(std::vector<ItemTrackerItem> items) {
|
|||
int iconSpacing = CVarGetInteger(CVAR_TRACKER_ITEM("IconSpacing"), 12);
|
||||
|
||||
ImVec2 max = ImGui::GetWindowContentRegionMax();
|
||||
float radius = (iconSize + iconSpacing) * 2;
|
||||
float radius = (iconSize + iconSpacing) * 2.0f;
|
||||
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
float angle = (float)i / items.size() * 2.0f * M_PI;
|
||||
float angle = static_cast<float>(i / items.size() * 2.0f * M_PI);
|
||||
float x = (radius / 2.0f) * cos(angle) + max.x / 2.0f;
|
||||
float y = (radius / 2.0f) * sin(angle) + max.y / 2.0f;
|
||||
ImGui::SetCursorPos(ImVec2(x - (CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36) - 8) / 2.0f, y + 4));
|
||||
|
@ -1225,14 +1225,12 @@ void DrawItemsInACircle(std::vector<ItemTrackerItem> items) {
|
|||
* to then call DrawItemsInRows
|
||||
*/
|
||||
std::vector<ItemTrackerItem> GetDungeonItemsVector(std::vector<ItemTrackerDungeon> dungeons, int columns = 6) {
|
||||
int iconSize = CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36);
|
||||
int iconSpacing = CVarGetInteger(CVAR_TRACKER_ITEM("IconSpacing"), 12);
|
||||
std::vector<ItemTrackerItem> dungeonItems = {};
|
||||
|
||||
int rowCount = 0;
|
||||
for (int i = 0; i < dungeons.size(); i++) {
|
||||
if (dungeons[i].items.size() > rowCount)
|
||||
rowCount = dungeons[i].items.size();
|
||||
rowCount = static_cast<int32_t>(dungeons[i].items.size());
|
||||
}
|
||||
|
||||
for (int i = 0; i < rowCount; i++) {
|
||||
|
@ -1469,7 +1467,7 @@ void ItemTrackerSaveFile(SaveContext* saveContext, int sectionID, bool fullSave)
|
|||
void ItemTrackerLoadFile() {
|
||||
std::string initialTrackerNotes = "";
|
||||
SaveManager::Instance->LoadData("personalNotes", initialTrackerNotes);
|
||||
itemTrackerNotes.resize(initialTrackerNotes.length() + 1);
|
||||
itemTrackerNotes.resize(static_cast<int>(initialTrackerNotes.length() + 1));
|
||||
if (initialTrackerNotes != "") {
|
||||
SohUtils::CopyStringToCharArray(itemTrackerNotes.Data, initialTrackerNotes.c_str(), itemTrackerNotes.size());
|
||||
} else {
|
||||
|
@ -1532,8 +1530,9 @@ void ItemTrackerWindow::DrawElement() {
|
|||
|
||||
if (CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.Notes"), SECTION_DISPLAY_HIDDEN) ==
|
||||
SECTION_DISPLAY_MAIN_WINDOW &&
|
||||
CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.Main"), TRACKER_DISPLAY_ALWAYS) ==
|
||||
TRACKER_DISPLAY_ALWAYS) {
|
||||
(CVarGetInteger(CVAR_TRACKER_ITEM("WindowType"), TRACKER_WINDOW_FLOATING) == TRACKER_WINDOW_FLOATING &&
|
||||
CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.Main"), TRACKER_DISPLAY_ALWAYS) ==
|
||||
TRACKER_DISPLAY_ALWAYS)) {
|
||||
DrawNotes();
|
||||
}
|
||||
EndFloatingWindows();
|
||||
|
@ -1642,7 +1641,10 @@ void ItemTrackerWindow::DrawElement() {
|
|||
|
||||
if (CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.Notes"), SECTION_DISPLAY_HIDDEN) ==
|
||||
SECTION_DISPLAY_SEPARATE &&
|
||||
CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.Main"), TRACKER_DISPLAY_ALWAYS) == TRACKER_DISPLAY_ALWAYS) {
|
||||
(CVarGetInteger(CVAR_TRACKER_ITEM("WindowType"), TRACKER_WINDOW_FLOATING) == TRACKER_WINDOW_WINDOW ||
|
||||
(CVarGetInteger(CVAR_TRACKER_ITEM("WindowType"), TRACKER_WINDOW_FLOATING) == TRACKER_WINDOW_FLOATING &&
|
||||
CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.Main"), TRACKER_DISPLAY_ALWAYS) !=
|
||||
TRACKER_DISPLAY_COMBO_BUTTON))) {
|
||||
ImGui::SetNextWindowSize(ImVec2(400, 300), ImGuiCond_FirstUseEver);
|
||||
BeginFloatingWindows("Personal Notes", ImGuiWindowFlags_NoFocusOnAppearing);
|
||||
DrawNotes(true);
|
||||
|
@ -1943,7 +1945,10 @@ void ItemTrackerSettingsWindow::DrawElement() {
|
|||
shouldUpdateVectors = true;
|
||||
}
|
||||
|
||||
if (CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.Main"), TRACKER_DISPLAY_ALWAYS) == TRACKER_DISPLAY_ALWAYS) {
|
||||
if (CVarGetInteger(CVAR_TRACKER_ITEM("WindowType"), TRACKER_WINDOW_FLOATING) == TRACKER_WINDOW_WINDOW ||
|
||||
(CVarGetInteger(CVAR_TRACKER_ITEM("WindowType"), TRACKER_WINDOW_FLOATING) == TRACKER_WINDOW_FLOATING &&
|
||||
CVarGetInteger(CVAR_TRACKER_ITEM("DisplayType.Main"), TRACKER_DISPLAY_ALWAYS) !=
|
||||
TRACKER_DISPLAY_COMBO_BUTTON)) {
|
||||
if (CVarCombobox("Personal notes", CVAR_TRACKER_ITEM("DisplayType.Notes"), displayTypes,
|
||||
ComboboxOptions()
|
||||
.DefaultIndex(SECTION_DISPLAY_HIDDEN)
|
||||
|
|
|
@ -22,7 +22,7 @@ void StartingItemGive(GetItemEntry getItemEntry, RandomizerCheck randomizerCheck
|
|||
if (getItemEntry.getItemId == GI_SWORD_BGS) {
|
||||
gSaveContext.bgsFlag = true;
|
||||
}
|
||||
Item_Give(NULL, getItemEntry.itemId);
|
||||
Item_Give(NULL, static_cast<uint8_t>(getItemEntry.itemId));
|
||||
} else if (getItemEntry.modIndex == MOD_RANDOMIZER) {
|
||||
if (getItemEntry.getItemId == RG_ICE_TRAP) {
|
||||
gSaveContext.ship.pendingIceTrapCount++;
|
||||
|
@ -269,9 +269,9 @@ extern "C" void Randomizer_InitSaveFile() {
|
|||
|
||||
// Remove One Time Scrubs with Scrubsanity off
|
||||
if (Randomizer_GetSettingValue(RSK_SHUFFLE_SCRUBS) == RO_SCRUBS_OFF) {
|
||||
Flags_SetRandomizerInf(RAND_INF_SCRUBS_PURCHASED_LW_DEKU_SCRUB_NEAR_BRIDGE);
|
||||
Flags_SetRandomizerInf(RAND_INF_SCRUBS_PURCHASED_LW_DEKU_SCRUB_GROTTO_FRONT);
|
||||
Flags_SetRandomizerInf(RAND_INF_SCRUBS_PURCHASED_HF_DEKU_SCRUB_GROTTO);
|
||||
Flags_SetItemGetInf(ITEMGETINF_DEKU_SCRUB_HEART_PIECE);
|
||||
Flags_SetInfTable(INFTABLE_BOUGHT_STICK_UPGRADE);
|
||||
Flags_SetInfTable(INFTABLE_BOUGHT_NUT_UPGRADE);
|
||||
}
|
||||
|
||||
int startingAge = OTRGlobals::Instance->gRandoContext->GetOption(RSK_SELECTED_STARTING_AGE).Get();
|
||||
|
|
|
@ -24,7 +24,7 @@ std::vector<std::string> NumOpts(const int min, const int max, const int step =
|
|||
}
|
||||
|
||||
std::vector<std::string> MultiVecOpts(const std::vector<std::vector<std::string>>& optionsVector) {
|
||||
uint32_t totalSize = 0;
|
||||
size_t totalSize = 0;
|
||||
for (const auto& vector : optionsVector) {
|
||||
totalSize += vector.size();
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ void Settings::CreateOptions() {
|
|||
OPT_U8(RSK_LACS_REWARD_COUNT, "GCBK Reward Count", {NumOpts(0, 10)}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("LacsRewardCount"), "", WidgetType::Slider, 9, true);
|
||||
OPT_U8(RSK_LACS_DUNGEON_COUNT, "GCBK Dungeon Count", {NumOpts(0, 9)}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("LacsDungeonCount"), "", WidgetType::Slider, 8, true);
|
||||
OPT_U8(RSK_LACS_TOKEN_COUNT, "GCBK Token Count", {NumOpts(0, 100)}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("LacsTokenCount"), "", WidgetType::Slider, 100, true);
|
||||
OPT_U8(RSK_LACS_OPTIONS, "GCBK LACS Reward Options", {"Standard Reward", "Greg as Reward", "Greg as Wildcard"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("LacsRewardOptions"), "", WidgetType::Combobox, RO_LACS_STANDARD_REWARD);
|
||||
OPT_U8(RSK_LACS_OPTIONS, "GCBK LACS Reward Options", {"Standard Reward", "Greg as Reward", "Greg as Wildcard"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("LacsRewardOptions"), mOptionDescriptions[RSK_LACS_OPTIONS], WidgetType::Combobox, RO_LACS_STANDARD_REWARD);
|
||||
OPT_U8(RSK_KEYRINGS, "Key Rings", {"Off", "Random", "Count", "Selection"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("ShuffleKeyRings"), mOptionDescriptions[RSK_KEYRINGS], WidgetType::Combobox, RO_KEYRINGS_OFF);
|
||||
OPT_U8(RSK_KEYRINGS_RANDOM_COUNT, "Keyring Dungeon Count", {NumOpts(0, 9)}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("ShuffleKeyRingsRandomCount"), "", WidgetType::Slider, 8);
|
||||
OPT_U8(RSK_KEYRINGS_GERUDO_FORTRESS, "Gerudo Fortress Keyring", {"No", "Random", "Yes"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("ShuffleKeyRingsGerudoFortress"), "", WidgetType::Combobox, 0);
|
||||
|
@ -2638,7 +2638,7 @@ void Context::FinalizeSettings(const std::set<RandomizerCheck>& excludedLocation
|
|||
mqSet += 1;
|
||||
break;
|
||||
case RO_MQ_SET_RANDOM:
|
||||
randMQOption.push_back(i);
|
||||
randMQOption.push_back(static_cast<uint8_t>(i));
|
||||
dungeons[i]->SetDungeonKnown(false);
|
||||
break;
|
||||
default:
|
||||
|
@ -2659,7 +2659,7 @@ void Context::FinalizeSettings(const std::set<RandomizerCheck>& excludedLocation
|
|||
// otherwise, make everything a possibility and unknown
|
||||
} else {
|
||||
for (size_t i = 0; i < dungeons.size(); i++) {
|
||||
randMQOption.push_back(i);
|
||||
randMQOption.push_back(static_cast<uint8_t>(i));
|
||||
dungeons[i]->SetDungeonKnown(false);
|
||||
mOptions[dungeons[i]->GetMQSetting()].Set(RO_MQ_SET_RANDOM);
|
||||
}
|
||||
|
|
|
@ -13,12 +13,14 @@ extern "C" {
|
|||
#include "src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h"
|
||||
#include "src/overlays/actors/ovl_En_Owl/z_en_owl.h"
|
||||
#include "src/overlays/actors/ovl_En_Go2/z_en_go2.h"
|
||||
#include "src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h"
|
||||
#include "src/overlays/actors/ovl_En_Ko/z_en_ko.h"
|
||||
#include "src/overlays/actors/ovl_En_Ma1/z_en_ma1.h"
|
||||
#include "src/overlays/actors/ovl_En_Ru2/z_en_ru2.h"
|
||||
#include "src/overlays/actors/ovl_En_Zl4/z_en_zl4.h"
|
||||
#include "src/overlays/actors/ovl_En_Box/z_en_box.h"
|
||||
#include "src/overlays/actors/ovl_Demo_Im/z_demo_im.h"
|
||||
#include "src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.h"
|
||||
#include "src/overlays/actors/ovl_En_Sa/z_en_sa.h"
|
||||
#include "src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.h"
|
||||
#include "src/overlays/actors/ovl_En_Tk/z_en_tk.h"
|
||||
|
@ -217,6 +219,25 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li
|
|||
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Entrances"), IS_RANDO) &&
|
||||
(entranceFlag != EVENTCHKINF_EPONA_OBTAINED) && entranceIndex != ENTR_SPIRIT_TEMPLE_BOSS_ENTRANCE) {
|
||||
*should = false;
|
||||
|
||||
// Check for dispulsion of Ganon's Tower barrier
|
||||
switch (entranceIndex) {
|
||||
case ENTR_INSIDE_GANONS_CASTLE_2:
|
||||
case ENTR_INSIDE_GANONS_CASTLE_3:
|
||||
case ENTR_INSIDE_GANONS_CASTLE_4:
|
||||
case ENTR_INSIDE_GANONS_CASTLE_5:
|
||||
case ENTR_INSIDE_GANONS_CASTLE_6:
|
||||
case ENTR_INSIDE_GANONS_CASTLE_7:
|
||||
if (Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_FOREST_TRIAL) &&
|
||||
Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_WATER_TRIAL) &&
|
||||
Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_SHADOW_TRIAL) &&
|
||||
Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_FIRE_TRIAL) &&
|
||||
Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_LIGHT_TRIAL) &&
|
||||
Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_SPIRIT_TRIAL)) {
|
||||
Flags_SetEventChkInf(EVENTCHKINF_DISPELLED_GANONS_TOWER_BARRIER);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -275,6 +296,11 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li
|
|||
}
|
||||
switch (actor->id) {
|
||||
case ACTOR_OBJ_SWITCH: {
|
||||
if ((actor->params == 8224 && gPlayState->sceneNum == SCENE_DODONGOS_CAVERN) ||
|
||||
(actor->params == 6979 && gPlayState->sceneNum == SCENE_WATER_TEMPLE) &&
|
||||
CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.GlitchAiding"), 0)) {
|
||||
break;
|
||||
}
|
||||
ObjSwitch* switchActor = (ObjSwitch*)actor;
|
||||
switchActor->cooldownTimer = 0;
|
||||
*should = false;
|
||||
|
@ -349,6 +375,11 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li
|
|||
}
|
||||
break;
|
||||
}
|
||||
case VB_FREEZE_LINK_FOR_FOREST_PILLARS:
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.OnePoint"), IS_RANDO)) {
|
||||
*should = false;
|
||||
}
|
||||
break;
|
||||
case VB_SHOW_TITLE_CARD:
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.DisableTitleCard"), IS_RANDO)) {
|
||||
*should = false;
|
||||
|
@ -441,6 +472,26 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li
|
|||
*should = false;
|
||||
}
|
||||
break;
|
||||
case VB_PLAY_DISPEL_BARRIER_CS: {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.OnePoint"), IS_RANDO)) {
|
||||
static s16 trialEntrances[] = {
|
||||
0,
|
||||
ENTR_INSIDE_GANONS_CASTLE_3,
|
||||
ENTR_INSIDE_GANONS_CASTLE_6,
|
||||
ENTR_INSIDE_GANONS_CASTLE_5,
|
||||
ENTR_INSIDE_GANONS_CASTLE_4,
|
||||
ENTR_INSIDE_GANONS_CASTLE_7,
|
||||
ENTR_INSIDE_GANONS_CASTLE_2,
|
||||
};
|
||||
RateLimitedSuccessChime();
|
||||
DemoKekkai* kekkai = va_arg(args, DemoKekkai*);
|
||||
gPlayState->nextEntranceIndex = trialEntrances[kekkai->actor.params];
|
||||
gPlayState->transitionTrigger = TRANS_TRIGGER_START;
|
||||
gPlayState->transitionType = TRANS_TYPE_FADE_BLACK;
|
||||
*should = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case VB_OWL_INTERACTION: {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipOwlInteractions"), IS_RANDO) && *should) {
|
||||
EnOwl* enOwl = va_arg(args, EnOwl*);
|
||||
|
@ -720,6 +771,18 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li
|
|||
|
||||
break;
|
||||
}
|
||||
case VB_PLAY_GATE_OPENING_OR_CLOSING_CS: {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO)) {
|
||||
EnHeishi2* enHeishi2 = va_arg(args, EnHeishi2*);
|
||||
enHeishi2->unk_2F2[0] = 0;
|
||||
|
||||
// The second argument determines whether the vanilla code should be run anyway. It
|
||||
// should be set to `true` ONLY IF said code calls `Play_ClearCamera`, false otherwise.
|
||||
bool clearCamera = (bool)va_arg(args, int);
|
||||
*should = clearCamera && enHeishi2->cameraId != MAIN_CAM;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case VB_PLAY_RAINBOW_BRIDGE_CS: {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) {
|
||||
*should = false;
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "z64.h"
|
||||
#include "macros.h"
|
||||
#include "Fonts.h"
|
||||
#include "window/FileDropMgr.h"
|
||||
#include "window/gui/resource/Font.h"
|
||||
#include <utils/StringHelper.h>
|
||||
#include "Enhancements/custom-message/CustomMessageManager.h"
|
||||
|
@ -51,7 +52,7 @@
|
|||
#include "Extractor/Extract.h"
|
||||
#endif
|
||||
|
||||
#include <Fast3D/gfx_pc.h>
|
||||
#include <Fast3D/interpreter.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <SDL_scancode.h>
|
||||
|
@ -307,6 +308,7 @@ OTRGlobals::OTRGlobals() {
|
|||
context->InitGfxDebugger();
|
||||
context->InitConfiguration();
|
||||
context->InitConsoleVariables();
|
||||
context->InitFileDropMgr();
|
||||
|
||||
// tell LUS to reserve 3 SoH specific threads (Game, Audio, Save)
|
||||
context->InitResourceManager(OTRFiles, {}, 3);
|
||||
|
@ -1434,13 +1436,13 @@ extern "C" void Graph_StartFrame() {
|
|||
}
|
||||
#endif
|
||||
|
||||
if (CVarGetInteger(CVAR_NEW_FILE_DROPPED, 0)) {
|
||||
std::string filePath = SohUtils::Sanitize(CVarGetString(CVAR_DROPPED_FILE, ""));
|
||||
auto dropMgr = Ship::Context::GetInstance()->GetFileDropMgr();
|
||||
if (dropMgr->FileDropped()) {
|
||||
std::string filePath = dropMgr->GetDroppedFile();
|
||||
if (!filePath.empty()) {
|
||||
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnFileDropped>(filePath);
|
||||
}
|
||||
CVarClear(CVAR_NEW_FILE_DROPPED);
|
||||
CVarClear(CVAR_DROPPED_FILE);
|
||||
dropMgr->ClearDroppedFile();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1899,7 +1901,7 @@ extern "C" void OTRControllerCallback(uint8_t rumble) {
|
|||
}
|
||||
|
||||
extern "C" float OTRGetAspectRatio() {
|
||||
return gfx_current_dimensions.aspect_ratio;
|
||||
return Ship::Context::GetInstance()->GetWindow()->GetAspectRatio();
|
||||
}
|
||||
|
||||
extern "C" float OTRGetDimensionFromLeftEdge(float v) {
|
||||
|
@ -1912,12 +1914,34 @@ extern "C" float OTRGetDimensionFromRightEdge(float v) {
|
|||
|
||||
// Gets the width of the current render target area
|
||||
extern "C" uint32_t OTRGetGameRenderWidth() {
|
||||
return gfx_current_dimensions.width;
|
||||
auto fastWnd = dynamic_pointer_cast<Fast::Fast3dWindow>(Ship::Context::GetInstance()->GetWindow());
|
||||
auto intP = fastWnd->GetInterpreterWeak().lock();
|
||||
|
||||
if (!intP) {
|
||||
assert(false && "Lost reference to Fast::Interpreter");
|
||||
return 320;
|
||||
}
|
||||
|
||||
uint32_t height, width;
|
||||
intP->GetCurDimensions(&width, &height);
|
||||
|
||||
return width;
|
||||
}
|
||||
|
||||
// Gets the height of the current render target area
|
||||
extern "C" uint32_t OTRGetGameRenderHeight() {
|
||||
return gfx_current_dimensions.height;
|
||||
auto fastWnd = dynamic_pointer_cast<Fast::Fast3dWindow>(Ship::Context::GetInstance()->GetWindow());
|
||||
auto intP = fastWnd->GetInterpreterWeak().lock();
|
||||
|
||||
if (!intP) {
|
||||
assert(false && "Lost reference to Fast::Interpreter");
|
||||
return 240;
|
||||
}
|
||||
|
||||
uint32_t height, width;
|
||||
intP->GetCurDimensions(&width, &height);
|
||||
|
||||
return height;
|
||||
}
|
||||
|
||||
f32 floorf(f32 x); // RANDOTODO False positive error "allowing all exceptions is incompatible with previous function"
|
||||
|
@ -2423,15 +2447,15 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) {
|
|||
// animation until the text box auto-dismisses.
|
||||
// RANDOTODO: Implement a way to determine if an item came from a skulltula and
|
||||
// inject the auto-dismiss control code if it did.
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("SkulltulaFreeze"), 0) != 0 &&
|
||||
!(IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_TOKENS) != RO_TOKENSANITY_OFF)) {
|
||||
bool gsTokensShuffled = Randomizer_GetSettingValue(RSK_SHUFFLE_TOKENS) != RO_TOKENSANITY_OFF;
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("SkulltulaFreeze"), 0) != 0 && !(IS_RANDO && gsTokensShuffled)) {
|
||||
textId = TEXT_GS_NO_FREEZE;
|
||||
} else {
|
||||
textId = TEXT_GS_FREEZE;
|
||||
}
|
||||
// In vanilla, GS token count is incremented prior to the text box displaying
|
||||
// In rando we need to bump the token count by one to show the correct count
|
||||
s16 gsCount = gSaveContext.inventory.gsTokens + (IS_RANDO ? 1 : 0);
|
||||
s16 gsCount = gSaveContext.inventory.gsTokens + ((IS_RANDO && gsTokensShuffled) ? 1 : 0);
|
||||
messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, textId, MF_FORMATTED);
|
||||
messageEntry.Replace("[[gsCount]]", std::to_string(gsCount));
|
||||
} else if (CVarGetInteger(CVAR_ENHANCEMENT("SkulltulaFreeze"), 0) != 0 &&
|
||||
|
@ -2496,11 +2520,23 @@ extern "C" void EntranceTracker_SetLastEntranceOverride(s16 entranceIndex) {
|
|||
}
|
||||
|
||||
extern "C" void Gfx_RegisterBlendedTexture(const char* name, u8* mask, u8* replacement) {
|
||||
gfx_register_blended_texture(name, mask, replacement);
|
||||
if (auto intP = dynamic_pointer_cast<Fast::Fast3dWindow>(Ship::Context::GetInstance()->GetWindow())
|
||||
->GetInterpreterWeak()
|
||||
.lock()) {
|
||||
intP->RegisterBlendedTexture(name, mask, replacement);
|
||||
} else {
|
||||
assert(false && "Lost reference to Fast::Interpreter");
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void Gfx_UnregisterBlendedTexture(const char* name) {
|
||||
gfx_unregister_blended_texture(name);
|
||||
if (auto intP = dynamic_pointer_cast<Fast::Fast3dWindow>(Ship::Context::GetInstance()->GetWindow())
|
||||
->GetInterpreterWeak()
|
||||
.lock()) {
|
||||
intP->UnregisterBlendedTexture(name);
|
||||
} else {
|
||||
assert(false && "Lost reference to Fast::Interpreter");
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void Gfx_TextureCacheDelete(const uint8_t* texAddr) {
|
||||
|
@ -2514,7 +2550,13 @@ extern "C" void Gfx_TextureCacheDelete(const uint8_t* texAddr) {
|
|||
texAddr = (const uint8_t*)ResourceMgr_GetResourceDataByNameHandlingMQ(imgName);
|
||||
}
|
||||
|
||||
gfx_texture_cache_delete(texAddr);
|
||||
if (auto intP = dynamic_pointer_cast<Fast::Fast3dWindow>(Ship::Context::GetInstance()->GetWindow())
|
||||
->GetInterpreterWeak()
|
||||
.lock()) {
|
||||
intP->TextureCacheDelete(texAddr);
|
||||
} else {
|
||||
assert(false && "Lost reference to Fast::Interpreter");
|
||||
}
|
||||
}
|
||||
|
||||
void SoH_ProcessDroppedFiles(std::string filePath) {
|
||||
|
|
|
@ -15,6 +15,11 @@
|
|||
#define BTN_CUSTOM_OCARINA_PITCH_UP ((CONTROLLERBUTTONS_T)0x00400000)
|
||||
#define BTN_CUSTOM_OCARINA_PITCH_DOWN ((CONTROLLERBUTTONS_T)0x00800000)
|
||||
|
||||
#define M_PIf 3.14159265358979323846f
|
||||
#define M_PI_2f 1.57079632679489661923f // pi/2
|
||||
#define M_SQRT2f 1.41421356237309504880f
|
||||
#define M_SQRT1_2f 0.70710678118654752440f /* 1/sqrt(2) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <Context.h>
|
||||
#include "Enhancements/savestates.h"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "resource/type/Array.h"
|
||||
#include "resource/type/Skeleton.h"
|
||||
#include "resource/type/PlayerAnimation.h"
|
||||
#include <Fast3D/gfx_pc.h>
|
||||
#include <Fast3D/Fast3dWindow.h>
|
||||
#include <DisplayList.h>
|
||||
|
||||
extern "C" PlayState* gPlayState;
|
||||
|
@ -292,7 +292,7 @@ extern "C" char* ResourceMgr_LoadPlayerAnimByName(const char* animPath) {
|
|||
}
|
||||
|
||||
extern "C" void ResourceMgr_PushCurrentDirectory(char* path) {
|
||||
gfx_push_current_dir(path);
|
||||
Fast::gfx_push_current_dir(path);
|
||||
}
|
||||
|
||||
extern "C" Gfx* ResourceMgr_LoadGfxByName(const char* path) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "ImGuiUtils.h"
|
||||
#include <Context.h>
|
||||
#include <Window.h>
|
||||
#include "assets/soh_assets.h"
|
||||
#include "soh/Enhancements/randomizer/rando_hash.h"
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define MENU_H
|
||||
|
||||
#include <libultraship/libultraship.h>
|
||||
#include "graphic/Fast3D/gfx_rendering_api.h"
|
||||
#include "graphic/Fast3D/backends/gfx_rendering_api.h"
|
||||
#include "MenuTypes.h"
|
||||
|
||||
namespace Ship {
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
#include <libultraship/libultraship.h>
|
||||
|
||||
#include "soh/SohGui/UIWidgets.hpp"
|
||||
#include <graphic/Fast3D/gfx_pc.h>
|
||||
#include <graphic/Fast3D/Fast3dWindow.h>
|
||||
#include <graphic/Fast3D/interpreter.h>
|
||||
#include "soh/OTRGlobals.h"
|
||||
#include "soh/SohGui/SohMenu.h"
|
||||
#include "soh/SohGui/SohGui.hpp"
|
||||
|
@ -86,6 +87,16 @@ static bool disabled_pixelCount;
|
|||
|
||||
using namespace UIWidgets;
|
||||
|
||||
static std::weak_ptr<Fast::Interpreter> mInterpreter;
|
||||
|
||||
std::shared_ptr<Fast::Interpreter> GetInterpreter() {
|
||||
auto intP = mInterpreter.lock();
|
||||
if (!intP) {
|
||||
assert(false && "Lost reference to Fast::Interpreter");
|
||||
}
|
||||
return intP;
|
||||
}
|
||||
|
||||
void ResolutionCustomWidget(WidgetInfo& info) {
|
||||
ImGui::BeginDisabled(disabled_everything);
|
||||
// Vertical Resolution
|
||||
|
@ -368,18 +379,23 @@ void ResolutionCustomWidget(WidgetInfo& info) {
|
|||
}
|
||||
|
||||
void RegisterResolutionWidgets() {
|
||||
auto fastWnd = dynamic_pointer_cast<Fast::Fast3dWindow>(Ship::Context::GetInstance()->GetWindow());
|
||||
mInterpreter = fastWnd->GetInterpreterWeak();
|
||||
|
||||
WidgetPath path = { "Settings", "Graphics", SECTION_COLUMN_2 };
|
||||
|
||||
// Resolution visualiser
|
||||
mSohMenu->AddWidget(path, "Viewport dimensions: {} x {}", WIDGET_TEXT)
|
||||
.RaceDisable(false)
|
||||
.PreFunc([](WidgetInfo& info) {
|
||||
auto gfx_current_game_window_viewport = GetInterpreter().get()->mGameWindowViewport;
|
||||
info.name = fmt::format("Viewport dimensions: {} x {}", gfx_current_game_window_viewport.width,
|
||||
gfx_current_game_window_viewport.height);
|
||||
});
|
||||
mSohMenu->AddWidget(path, "Internal resolution: {} x {}", WIDGET_TEXT)
|
||||
.RaceDisable(false)
|
||||
.PreFunc([](WidgetInfo& info) {
|
||||
auto gfx_current_dimensions = GetInterpreter().get()->mCurDimensions;
|
||||
info.name = fmt::format("Internal resolution: {} x {}", gfx_current_dimensions.width,
|
||||
gfx_current_dimensions.height);
|
||||
});
|
||||
|
@ -486,6 +502,7 @@ void RegisterResolutionWidgets() {
|
|||
}
|
||||
} else if (showHorizontalResField) { // Show calculated aspect ratio
|
||||
if (item_aspectRatio) {
|
||||
auto gfx_current_dimensions = GetInterpreter().get()->mCurDimensions;
|
||||
ImGui::Dummy({ 0, 2 });
|
||||
const float resolvedAspectRatio =
|
||||
(float)gfx_current_dimensions.width / gfx_current_dimensions.height;
|
||||
|
@ -539,6 +556,8 @@ void UpdateResolutionVars() {
|
|||
|
||||
short integerScale_maximumBounds = 1; // can change when window is resized
|
||||
// This is mostly just for UX purposes, as Fit Automatically logic is part of LUS.
|
||||
auto gfx_current_game_window_viewport = GetInterpreter().get()->mGameWindowViewport;
|
||||
auto gfx_current_dimensions = GetInterpreter().get()->mCurDimensions;
|
||||
if (((float)gfx_current_game_window_viewport.width / gfx_current_game_window_viewport.height) >
|
||||
((float)gfx_current_dimensions.width / gfx_current_dimensions.height)) {
|
||||
// Scale to window height
|
||||
|
|
|
@ -11,10 +11,9 @@
|
|||
#include <imgui.h>
|
||||
#include <imgui_internal.h>
|
||||
#include <libultraship/libultraship.h>
|
||||
#include <Fast3D/gfx_pc.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include "graphic/Fast3D/gfx_metal.h"
|
||||
#include "graphic/Fast3D/backends/gfx_metal.h"
|
||||
#endif
|
||||
|
||||
#ifdef __SWITCH__
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <libultraship/libultraship.h>
|
||||
#include "UIWidgets.hpp"
|
||||
#include "Menu.h"
|
||||
#include "graphic/Fast3D/gfx_rendering_api.h"
|
||||
#include "graphic/Fast3D/backends/gfx_rendering_api.h"
|
||||
#include "soh/cvar_prefixes.h"
|
||||
#include "soh/Enhancements/enhancementTypes.h"
|
||||
#include "soh/Enhancements/Presets/Presets.h"
|
||||
|
@ -53,9 +53,9 @@ static const std::unordered_map<int32_t, const char*> menuThemeOptions = {
|
|||
};
|
||||
|
||||
static const std::unordered_map<int32_t, const char*> textureFilteringMap = {
|
||||
{ FILTER_THREE_POINT, "Three-Point" },
|
||||
{ FILTER_LINEAR, "Linear" },
|
||||
{ FILTER_NONE, "None" },
|
||||
{ Fast::FILTER_THREE_POINT, "Three-Point" },
|
||||
{ Fast::FILTER_LINEAR, "Linear" },
|
||||
{ Fast::FILTER_NONE, "None" },
|
||||
};
|
||||
|
||||
static const std::unordered_map<int32_t, const char*> logLevels = {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <libultraship/libultraship.h>
|
||||
#include "UIWidgets.hpp"
|
||||
#include "include/z64audio.h"
|
||||
#include "graphic/Fast3D/gfx_rendering_api.h"
|
||||
#include "graphic/Fast3D/backends/gfx_rendering_api.h"
|
||||
#include "soh/OTRGlobals.h"
|
||||
#include "soh/SaveManager.h"
|
||||
#include "z64.h"
|
||||
|
|
|
@ -336,8 +336,8 @@ void SohMenu::AddMenuEnhancements() {
|
|||
.CVar(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.GlitchAiding"))
|
||||
.Options(CheckboxOptions().Tooltip(
|
||||
"Don't skip cutscenes that are associated with useful glitches. Currently, it is "
|
||||
"only the Fire Temple Darunia CS, Forest Temple Poe Sisters CS, and the Box Skip One "
|
||||
"Point in Jabu."));
|
||||
"only the Fire Temple Darunia CS, Forest Temple Poe Sisters CS, Dodongo Boss "
|
||||
"Door Switch CS, Water Temple Dragon Switch CS, and the Box Skip One Point in Jabu."));
|
||||
|
||||
AddWidget(path, "Text", WIDGET_SEPARATOR_TEXT);
|
||||
AddWidget(path, "Skip Pickup Messages", WIDGET_CVAR_CHECKBOX)
|
||||
|
|
|
@ -20,7 +20,7 @@ ResourceFactoryBinaryArrayV0::ReadResource(std::shared_ptr<Ship::File> file,
|
|||
for (uint32_t i = 0; i < array->ArrayCount; i++) {
|
||||
if (array->ArrayType == ArrayResourceType::Vertex) {
|
||||
// OTRTODO: Implement Vertex arrays as just a vertex resource.
|
||||
F3DVtx data;
|
||||
Fast::F3DVtx data;
|
||||
data.v.ob[0] = reader->ReadInt16();
|
||||
data.v.ob[1] = reader->ReadInt16();
|
||||
data.v.ob[2] = reader->ReadInt16();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "soh/resource/importer/CollisionHeaderFactory.h"
|
||||
#include "soh/resource/type/CollisionHeader.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/Path.h"
|
||||
#include "soh/resource/logging/PathLogger.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
#include "soh/resource/type/SohResourceType.h"
|
||||
#include "soh/resource/importer/SceneFactory.h"
|
||||
#include "soh/resource/type/Scene.h"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "soh/resource/importer/SkeletonFactory.h"
|
||||
#include "soh/resource/type/Skeleton.h"
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <tinyxml2.h>
|
||||
#include <libultraship/libultraship.h>
|
||||
|
||||
namespace SOH {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "soh/resource/importer/SkeletonLimbFactory.h"
|
||||
#include "soh/resource/type/SkeletonLimb.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
#include "libultraship/libultraship.h"
|
||||
|
||||
namespace SOH {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "soh/resource/importer/TextFactory.h"
|
||||
#include "soh/resource/type/Text.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/EndMarker.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource> EndMarkerFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetActorList.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource> SetActorListFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetAlternateHeaders.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
#include "libultraship/libultraship.h"
|
||||
|
||||
namespace SOH {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetCameraSettings.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "libultraship/libultraship.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetCsCamera.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource> SetCsCameraFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include <libultraship/libultraship.h>
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource> SetCutscenesFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetEchoSettings.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource> SetEchoSettingsFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetEntranceList.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource> SetEntranceListFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetExitList.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource> SetExitListFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetLightList.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource> SetLightListFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetLightingSettings.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetMesh.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
#include "libultraship/libultraship.h"
|
||||
|
||||
namespace SOH {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetObjectList.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource> SetObjectListFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetPathways.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
#include <libultraship/libultraship.h>
|
||||
|
||||
namespace SOH {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetRoomBehavior.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource> SetRoomBehaviorFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetRoomList.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource> SetRoomListFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetSkyboxModifier.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetSkyboxSettings.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetSoundSettings.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource> SetSoundSettingsFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetSpecialObjects.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetStartPositionList.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetTimeSettings.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource> SetTimeSettingsFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetTransitionActorList.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetWindSettings.h"
|
||||
#include "soh/resource/logging/SceneCommandLoggers.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
std::shared_ptr<Ship::IResource> SetWindSettingsFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "soh/resource/type/Path.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
|
||||
namespace SOH {
|
||||
void LogPathAsXML(std::shared_ptr<Ship::IResource> resource) {
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "soh/resource/type/scenecommand/SetTransitionActorList.h"
|
||||
#include "soh/resource/type/scenecommand/SetWindSettings.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include <tinyxml2.h>
|
||||
#include <string.h>
|
||||
|
||||
namespace SOH {
|
||||
|
|
|
@ -23,7 +23,7 @@ size_t Array::GetPointerSize() {
|
|||
size_t typeSize = 0;
|
||||
switch (ArrayType) {
|
||||
case ArrayResourceType::Vertex:
|
||||
typeSize = sizeof(F3DVtx);
|
||||
typeSize = sizeof(Fast::F3DVtx);
|
||||
break;
|
||||
case ArrayResourceType::Scalar:
|
||||
default:
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
#include "resource/Resource.h"
|
||||
|
||||
namespace Fast {
|
||||
union F3DVtx;
|
||||
}
|
||||
|
||||
namespace SOH {
|
||||
typedef union ScalarData {
|
||||
uint8_t u8;
|
||||
|
@ -80,6 +83,6 @@ class Array : public Ship::Resource<void> {
|
|||
size_t ArrayCount;
|
||||
// OTRTODO: Should be a vector of resource pointers...
|
||||
std::vector<ScalarData> Scalars;
|
||||
std::vector<F3DVtx> Vertices;
|
||||
std::vector<Fast::F3DVtx> Vertices;
|
||||
};
|
||||
} // namespace SOH
|
||||
|
|
|
@ -145,7 +145,47 @@ void Audio_osWritebackDCache(void* mem, s32 size) {
|
|||
}
|
||||
|
||||
s32 osAiSetFrequency(u32 freq) {
|
||||
return 1;
|
||||
// this is based off the math from the original method
|
||||
/*
|
||||
|
||||
s32 osAiSetFrequency(u32 frequency) {
|
||||
u8 bitrate;
|
||||
f32 dacRateF = ((f32)osViClock / frequency) + 0.5f;
|
||||
u32 dacRate = dacRateF;
|
||||
|
||||
if (dacRate < 132) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
bitrate = (dacRate / 66);
|
||||
if (bitrate > 16) {
|
||||
bitrate = 16;
|
||||
}
|
||||
|
||||
HW_REG(AI_DACRATE_REG, u32) = dacRate - 1;
|
||||
HW_REG(AI_BITRATE_REG, u32) = bitrate - 1;
|
||||
return osViClock / (s32)dacRate;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// bitrate is unused
|
||||
|
||||
// osViClock comes from
|
||||
// #define VI_NTSC_CLOCK 48681812 /* Hz = 48.681812 MHz */
|
||||
// s32 osViClock = VI_NTSC_CLOCK;
|
||||
|
||||
// frequency was originally 32000
|
||||
|
||||
// given all of that, dacRate is
|
||||
// (u32)(((f32)48681812 / 32000) + 0.5f)
|
||||
// which evaluates to 1521 (which is > 132)
|
||||
|
||||
// this leaves us with a final calculation of
|
||||
// 48681812 / 1521
|
||||
// which evaluates to 32006
|
||||
|
||||
return 32006;
|
||||
}
|
||||
|
||||
void osInvalDCache(void* vaddr, s32 nbytes) {
|
||||
|
|
|
@ -84,7 +84,7 @@ void func_800AA15C(void) {
|
|||
D_80160FD0.unk_104 = 2;
|
||||
}
|
||||
|
||||
void func_800AA16C(void) {
|
||||
void Rumble_ClearRequests(void) {
|
||||
D_80160FD0.unk_104 = 0;
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue