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/ResourceManagerHelpers.h"
#include "soh/ShipInit.hpp"
extern "C" {
#include "macros.h"
#include "soh/ResourceManagerHelpers.h"
#include "objects/object_link_boy/object_link_boy.h"
extern SaveContext gSaveContext;
}

View File

@@ -29,7 +29,7 @@ static Gfx grayscaleWhite = gsDPSetGrayscaleColor(255, 255, 255, 255);
class ToTPatchSetup {
public:
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) {

View File

@@ -203,10 +203,6 @@ void Kaleido::Draw(PlayState* play) {
Matrix_Translate(-108.f, 58.f, 0.0f, MTXMODE_APPLY);
// Invert the matrix to render vertices with positive going down
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);
if (((pauseCtx->unk_1E4 == 0) || (pauseCtx->unk_1E4 == 5) || (pauseCtx->unk_1E4 == 8)) &&
(pauseCtx->pageIndex == PAUSE_QUEST)) {
@@ -220,7 +216,6 @@ void Kaleido::Draw(PlayState* play) {
}
if (mCursorPos < mTopIndex) {
mTopIndex = mCursorPos;
shouldScroll = true;
}
} else if ((pauseCtx->stickRelY < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) {
if (mCursorPos < mEntries.size() - 1) {
@@ -230,7 +225,6 @@ void Kaleido::Draw(PlayState* play) {
}
if (mCursorPos >= mTopIndex + mNumVisible && mTopIndex + mNumVisible < mEntries.size()) {
mTopIndex = mCursorPos - mNumVisible + 1;
shouldScroll = true;
}
}
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;
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];
entry->SetYOffset(yOffset);
yOffset += 9;
@@ -275,7 +269,7 @@ void Kaleido::Draw(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];
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,
int iconHeight, Color_RGBA8 iconColor, FlagType flagType, int flag,
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();
}
@@ -307,8 +301,8 @@ void KaleidoEntryIconFlag::Update(PlayState* play) {
KaleidoEntryIconCountRequired::KaleidoEntryIconCountRequired(const char* iconResourceName, int iconFormat, int iconSize,
int iconWidth, int iconHeight, Color_RGBA8 iconColor,
int* watch, int required, int total)
: mWatch(watch), mRequired(required), mTotal(total),
KaleidoEntryIcon(iconResourceName, iconFormat, iconSize, iconWidth, iconHeight, iconColor) {
: KaleidoEntryIcon(iconResourceName, iconFormat, iconSize, iconWidth, iconHeight, iconColor), mWatch(watch),
mRequired(required), mTotal(total) {
mCount = *mWatch;
BuildText();
BuildVertices();
@@ -375,8 +369,8 @@ void KaleidoEntryIcon::BuildVertices() {
KaleidoEntryIcon::KaleidoEntryIcon(const char* iconResourceName, int iconFormat, int iconSize, int iconWidth,
int iconHeight, Color_RGBA8 iconColor, std::string text)
: mIconResourceName(iconResourceName), mIconFormat(iconFormat), mIconSize(iconSize), mIconWidth(iconWidth),
mIconHeight(iconHeight), mIconColor(iconColor), KaleidoEntry(std::move(text)) {
: KaleidoEntry(std::move(text)), mIconResourceName(iconResourceName), mIconFormat(iconFormat), mIconSize(iconSize),
mIconWidth(iconWidth), mIconHeight(iconHeight), mIconColor(iconColor) {
}
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;
CalculateColors();
mAchieved = false;
for (int i = 0; i < mButtonCollected.size(); i++) {
for (size_t i = 0; i < mButtonCollected.size(); i++) {
if (!mButtonCollected[i]) {
mButtonColors[i] = Color_RGBA8{ 109, 109, 109, 255 };
} else {

View File

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

View File

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

View File

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

View File

@@ -364,7 +364,7 @@ SaveStateMgr::~SaveStateMgr() {
}
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>();
}