fix compiler warnings (#6072)

This commit is contained in:
Philip Dubé
2026-01-02 20:17:44 +00:00
committed by GitHub
parent c0ba618f60
commit 31824afa4a
7 changed files with 24 additions and 35 deletions

View File

@@ -1,9 +1,9 @@
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/ResourceManagerHelpers.h"
#include "soh/ShipInit.hpp" #include "soh/ShipInit.hpp"
extern "C" { extern "C" {
#include "macros.h" #include "macros.h"
#include "soh/ResourceManagerHelpers.h"
#include "objects/object_link_boy/object_link_boy.h" #include "objects/object_link_boy/object_link_boy.h"
extern SaveContext gSaveContext; extern SaveContext gSaveContext;
} }

View File

@@ -29,7 +29,7 @@ static Gfx grayscaleWhite = gsDPSetGrayscaleColor(255, 255, 255, 255);
class ToTPatchSetup { class ToTPatchSetup {
public: public:
ToTPatchSetup(Gfx ifColored, const char* patchName, int index, const char* patchName2 = "", int index2 = 0) ToTPatchSetup(Gfx ifColored, const char* patchName, int index, const char* patchName2 = "", int index2 = 0)
: patchName(patchName), index(index), ifColored(ifColored), patchName2(patchName2), index2(index2) { : patchName(patchName), patchName2(patchName2), index(index), index2(index2), ifColored(ifColored) {
} }
void ApplyPatch(bool colored = true) { void ApplyPatch(bool colored = true) {

View File

@@ -203,10 +203,6 @@ void Kaleido::Draw(PlayState* play) {
Matrix_Translate(-108.f, 58.f, 0.0f, MTXMODE_APPLY); Matrix_Translate(-108.f, 58.f, 0.0f, MTXMODE_APPLY);
// Invert the matrix to render vertices with positive going down // Invert the matrix to render vertices with positive going down
Matrix_Scale(1.0f, -1.0f, 1.0f, MTXMODE_APPLY); Matrix_Scale(1.0f, -1.0f, 1.0f, MTXMODE_APPLY);
// The scrolling logic is in here because the built in kaleido input throttling happens
// in its Draw functions, which get called after their update functions. I hate it but fixing
// it would be a much larger Kaleido change.
bool shouldScroll = false;
bool dpad = CVarGetInteger(CVAR_SETTING("DPadOnPause"), 0); bool dpad = CVarGetInteger(CVAR_SETTING("DPadOnPause"), 0);
if (((pauseCtx->unk_1E4 == 0) || (pauseCtx->unk_1E4 == 5) || (pauseCtx->unk_1E4 == 8)) && if (((pauseCtx->unk_1E4 == 0) || (pauseCtx->unk_1E4 == 5) || (pauseCtx->unk_1E4 == 8)) &&
(pauseCtx->pageIndex == PAUSE_QUEST)) { (pauseCtx->pageIndex == PAUSE_QUEST)) {
@@ -220,7 +216,6 @@ void Kaleido::Draw(PlayState* play) {
} }
if (mCursorPos < mTopIndex) { if (mCursorPos < mTopIndex) {
mTopIndex = mCursorPos; mTopIndex = mCursorPos;
shouldScroll = true;
} }
} else if ((pauseCtx->stickRelY < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) { } else if ((pauseCtx->stickRelY < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) {
if (mCursorPos < mEntries.size() - 1) { if (mCursorPos < mEntries.size() - 1) {
@@ -230,7 +225,6 @@ void Kaleido::Draw(PlayState* play) {
} }
if (mCursorPos >= mTopIndex + mNumVisible && mTopIndex + mNumVisible < mEntries.size()) { if (mCursorPos >= mTopIndex + mNumVisible && mTopIndex + mNumVisible < mEntries.size()) {
mTopIndex = mCursorPos - mNumVisible + 1; mTopIndex = mCursorPos - mNumVisible + 1;
shouldScroll = true;
} }
} }
if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) {
@@ -258,7 +252,7 @@ void Kaleido::Draw(PlayState* play) {
} }
} }
int yOffset = 1; int yOffset = 1;
for (int i = mTopIndex; i < (mTopIndex + mNumVisible) && i < mEntries.size(); i++) { for (size_t i = mTopIndex; i < (mTopIndex + mNumVisible) && i < mEntries.size(); i++) {
auto& entry = mEntries[i]; auto& entry = mEntries[i];
entry->SetYOffset(yOffset); entry->SetYOffset(yOffset);
yOffset += 9; yOffset += 9;
@@ -275,7 +269,7 @@ void Kaleido::Draw(PlayState* play) {
} }
void Kaleido::Update(PlayState* play) { void Kaleido::Update(PlayState* play) {
for (int i = mTopIndex; i < (mTopIndex + mNumVisible) && i < mEntries.size(); i++) { for (size_t i = mTopIndex; i < (mTopIndex + mNumVisible) && i < mEntries.size(); i++) {
const auto& entry = mEntries[i]; const auto& entry = mEntries[i];
entry->Update(play); entry->Update(play);
} }
@@ -295,8 +289,8 @@ extern "C" void RandoKaleido_UpdateMiscCollectibles(int16_t inDungeonScene) {
KaleidoEntryIconFlag::KaleidoEntryIconFlag(const char* iconResourceName, int iconFormat, int iconSize, int iconWidth, KaleidoEntryIconFlag::KaleidoEntryIconFlag(const char* iconResourceName, int iconFormat, int iconSize, int iconWidth,
int iconHeight, Color_RGBA8 iconColor, FlagType flagType, int flag, int iconHeight, Color_RGBA8 iconColor, FlagType flagType, int flag,
std::string name) std::string name)
: mFlagType(flagType), mFlag(flag), : KaleidoEntryIcon(iconResourceName, iconFormat, iconSize, iconWidth, iconHeight, iconColor, std::move(name)),
KaleidoEntryIcon(iconResourceName, iconFormat, iconSize, iconWidth, iconHeight, iconColor, std::move(name)) { mFlagType(flagType), mFlag(flag) {
BuildVertices(); BuildVertices();
} }
@@ -307,8 +301,8 @@ void KaleidoEntryIconFlag::Update(PlayState* play) {
KaleidoEntryIconCountRequired::KaleidoEntryIconCountRequired(const char* iconResourceName, int iconFormat, int iconSize, KaleidoEntryIconCountRequired::KaleidoEntryIconCountRequired(const char* iconResourceName, int iconFormat, int iconSize,
int iconWidth, int iconHeight, Color_RGBA8 iconColor, int iconWidth, int iconHeight, Color_RGBA8 iconColor,
int* watch, int required, int total) int* watch, int required, int total)
: mWatch(watch), mRequired(required), mTotal(total), : KaleidoEntryIcon(iconResourceName, iconFormat, iconSize, iconWidth, iconHeight, iconColor), mWatch(watch),
KaleidoEntryIcon(iconResourceName, iconFormat, iconSize, iconWidth, iconHeight, iconColor) { mRequired(required), mTotal(total) {
mCount = *mWatch; mCount = *mWatch;
BuildText(); BuildText();
BuildVertices(); BuildVertices();
@@ -375,8 +369,8 @@ void KaleidoEntryIcon::BuildVertices() {
KaleidoEntryIcon::KaleidoEntryIcon(const char* iconResourceName, int iconFormat, int iconSize, int iconWidth, KaleidoEntryIcon::KaleidoEntryIcon(const char* iconResourceName, int iconFormat, int iconSize, int iconWidth,
int iconHeight, Color_RGBA8 iconColor, std::string text) int iconHeight, Color_RGBA8 iconColor, std::string text)
: mIconResourceName(iconResourceName), mIconFormat(iconFormat), mIconSize(iconSize), mIconWidth(iconWidth), : KaleidoEntry(std::move(text)), mIconResourceName(iconResourceName), mIconFormat(iconFormat), mIconSize(iconSize),
mIconHeight(iconHeight), mIconColor(iconColor), KaleidoEntry(std::move(text)) { mIconWidth(iconWidth), mIconHeight(iconHeight), mIconColor(iconColor) {
} }
void KaleidoEntryIcon::RebuildVertices() { void KaleidoEntryIcon::RebuildVertices() {
@@ -446,7 +440,7 @@ void KaleidoEntryOcarinaButtons::Update(PlayState* play) {
mButtonCollected[4] = GameInteractor::RawAction::CheckFlag(FLAG_RANDOMIZER_INF, RAND_INF_HAS_OCARINA_C_RIGHT) > 0; mButtonCollected[4] = GameInteractor::RawAction::CheckFlag(FLAG_RANDOMIZER_INF, RAND_INF_HAS_OCARINA_C_RIGHT) > 0;
CalculateColors(); CalculateColors();
mAchieved = false; mAchieved = false;
for (int i = 0; i < mButtonCollected.size(); i++) { for (size_t i = 0; i < mButtonCollected.size(); i++) {
if (!mButtonCollected[i]) { if (!mButtonCollected[i]) {
mButtonColors[i] = Color_RGBA8{ 109, 109, 109, 255 }; mButtonColors[i] = Color_RGBA8{ 109, 109, 109, 255 };
} else { } else {

View File

@@ -81,7 +81,7 @@ class KaleidoEntryIcon : public KaleidoEntry {
* Class representing a Kaleido Entry that can be represented with an icon * Class representing a Kaleido Entry that can be represented with an icon
* that is either colored in or Grayscale according to a flag * that is either colored in or Grayscale according to a flag
*/ */
class KaleidoEntryIconFlag : public KaleidoEntryIcon { class KaleidoEntryIconFlag final : public KaleidoEntryIcon {
public: public:
/** /**
* @param iconResourceName resource name of the icon to draw * @param iconResourceName resource name of the icon to draw
@@ -110,7 +110,7 @@ class KaleidoEntryIconFlag : public KaleidoEntryIcon {
* The `required` and `total` values can be omitted from the constructor or set to 0 to only * The `required` and `total` values can be omitted from the constructor or set to 0 to only
* render the count and not show progress towards a required amount or a total. * render the count and not show progress towards a required amount or a total.
*/ */
class KaleidoEntryIconCountRequired : public KaleidoEntryIcon { class KaleidoEntryIconCountRequired final : public KaleidoEntryIcon {
public: public:
/** /**
* @param iconResourceName resource name of the icon to draw * @param iconResourceName resource name of the icon to draw
@@ -141,7 +141,7 @@ class KaleidoEntryIconCountRequired : public KaleidoEntryIcon {
void BuildText(); void BuildText();
}; };
class KaleidoEntryOcarinaButtons : public KaleidoEntryIcon { class KaleidoEntryOcarinaButtons final : public KaleidoEntryIcon {
public: public:
KaleidoEntryOcarinaButtons(); KaleidoEntryOcarinaButtons();
void Update(PlayState* play) override; void Update(PlayState* play) override;
@@ -163,9 +163,9 @@ class Kaleido {
private: private:
std::vector<std::shared_ptr<KaleidoEntry>> mEntries; std::vector<std::shared_ptr<KaleidoEntry>> mEntries;
std::vector<Gfx> mEntryDl; std::vector<Gfx> mEntryDl;
int mTopIndex = 0; size_t mTopIndex = 0;
int mCursorPos = 0; size_t mCursorPos = 0;
int mNumVisible = 14; const size_t mNumVisible = 14;
}; };
} // namespace Rando } // namespace Rando

View File

@@ -1032,11 +1032,6 @@ void CheckTrackerWindow::DrawElement() {
RecalculateAvailableChecks(); RecalculateAvailableChecks();
} }
SceneID sceneId = SCENE_ID_MAX;
if (gPlayState != nullptr) {
sceneId = (SceneID)gPlayState->sceneNum;
}
// Quick Options // Quick Options
#ifdef __WIIU__ #ifdef __WIIU__
float headerHeight = 40.0f; float headerHeight = 40.0f;

View File

@@ -568,7 +568,7 @@ ItemTrackerNumbers GetItemCurrentAndMax(ItemTrackerItem item) {
default: default:
result.maxCapacity = 0; result.maxCapacity = 0;
SPDLOG_ERROR( SPDLOG_ERROR(
"Invalid value for RSK_GERUDO_FORTRESS: " + "Invalid value for RSK_GERUDO_FORTRESS: {}",
OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_GERUDO_FORTRESS)); OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_GERUDO_FORTRESS));
assert(false); assert(false);
break; break;
@@ -1379,17 +1379,17 @@ void DrawItemsInACircle(std::vector<ItemTrackerItem> items) {
* Loops over dungeons and creates vectors of items in the correct order * Loops over dungeons and creates vectors of items in the correct order
* to then call DrawItemsInRows * to then call DrawItemsInRows
*/ */
std::vector<ItemTrackerItem> GetDungeonItemsVector(std::vector<ItemTrackerDungeon> dungeons, int columns = 6) { std::vector<ItemTrackerItem> GetDungeonItemsVector(std::vector<ItemTrackerDungeon> dungeons, size_t columns = 6) {
std::vector<ItemTrackerItem> dungeonItems = {}; std::vector<ItemTrackerItem> dungeonItems = {};
int rowCount = 0; size_t rowCount = 0;
for (int i = 0; i < dungeons.size(); i++) { for (size_t i = 0; i < dungeons.size(); i++) {
if (dungeons[i].items.size() > rowCount) if (dungeons[i].items.size() > rowCount)
rowCount = static_cast<int32_t>(dungeons[i].items.size()); rowCount = static_cast<int32_t>(dungeons[i].items.size());
} }
for (int i = 0; i < rowCount; i++) { for (size_t i = 0; i < rowCount; i++) {
for (int j = 0; j < MIN(dungeons.size(), columns); j++) { for (size_t j = 0; j < MIN(dungeons.size(), columns); j++) {
if (dungeons[j].items.size() > i) { if (dungeons[j].items.size() > i) {
switch (dungeons[j].items[i]) { switch (dungeons[j].items[i]) {
case ITEM_KEY_SMALL: case ITEM_KEY_SMALL:

View File

@@ -364,7 +364,7 @@ SaveStateMgr::~SaveStateMgr() {
} }
SaveState::SaveState(std::shared_ptr<SaveStateMgr> mgr, unsigned int slot) SaveState::SaveState(std::shared_ptr<SaveStateMgr> mgr, unsigned int slot)
: saveStateMgr(mgr), slot(slot), info(nullptr) { : slot(slot), saveStateMgr(mgr), info(nullptr) {
this->info = std::make_shared<SaveStateInfo>(); this->info = std::make_shared<SaveStateInfo>();
} }