mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-08-21 06:48:39 -04:00
fix warnings (#7051)
This commit is contained in:
@@ -496,6 +496,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
||||
-Wno-parentheses
|
||||
-Wno-narrowing
|
||||
-Wno-missing-braces
|
||||
-Wno-unknown-pragmas # #pragma region is an editor folding marker, GCC doesn't know it
|
||||
$<$<COMPILE_LANGUAGE:C>:
|
||||
-Werror-implicit-function-declaration
|
||||
-Wno-incompatible-pointer-types
|
||||
@@ -524,6 +525,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
||||
-Wno-parentheses
|
||||
-Wno-narrowing
|
||||
-Wno-missing-braces
|
||||
-Wno-unknown-pragmas # #pragma region is an editor folding marker, GCC doesn't know it
|
||||
$<$<COMPILE_LANGUAGE:C>:
|
||||
-Werror-implicit-function-declaration
|
||||
-Wno-incompatible-pointer-types
|
||||
@@ -548,6 +550,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
||||
-Wno-return-type
|
||||
-Wno-narrowing
|
||||
-Wno-switch-outside-range
|
||||
-Wno-unknown-pragmas # #pragma region is an editor folding marker, GCC doesn't know it
|
||||
$<$<COMPILE_LANGUAGE:C>:
|
||||
-Werror-implicit-function-declaration
|
||||
-Wno-incompatible-pointer-types
|
||||
@@ -574,6 +577,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
||||
-Wno-parentheses
|
||||
-Wno-narrowing
|
||||
-Wno-missing-braces
|
||||
-Wno-unknown-pragmas # #pragma region is an editor folding marker, GCC doesn't know it
|
||||
$<$<COMPILE_LANGUAGE:C>:
|
||||
-Werror-implicit-function-declaration
|
||||
-Wno-implicit-int
|
||||
|
||||
+1
-1
@@ -535,7 +535,7 @@ ActorDB::Entry& ActorDB::AddEntry(const ActorDBInit& init) {
|
||||
// Get the ActorDB::Entry for the given actor id.
|
||||
ActorDB::Entry& ActorDB::RetrieveEntry(const int id) {
|
||||
static Entry invalid;
|
||||
if ((id < 0) || (id >= db.size())) {
|
||||
if ((id < 0) || (static_cast<size_t>(id) >= db.size())) {
|
||||
return invalid;
|
||||
}
|
||||
return db[id];
|
||||
|
||||
@@ -301,7 +301,7 @@ void FileChoose_UpdateBossRushMenu(GameState* gameState) {
|
||||
void FileChoose_DrawBossRushMenuWindowContents(FileChooseContext* fileChooseContext) {
|
||||
OPEN_DISPS(fileChooseContext->state.gfxCtx);
|
||||
|
||||
uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language;
|
||||
uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? (uint8_t)LANGUAGE_ENG : gSaveContext.language;
|
||||
uint8_t listOffset = fileChooseContext->bossRushOffset;
|
||||
int16_t textAlpha = fileChooseContext->bossRushUIAlpha;
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ extern "C" void CustomLogoTitle_Draw(TitleContext* titleContext, uint8_t logoToD
|
||||
|
||||
extern "C" void CustomLogoTitle_Main(TitleContext* titleContext) {
|
||||
static uint8_t logosSeen = 0;
|
||||
uint8_t logoToDraw;
|
||||
uint8_t logoToDraw = LOGO_TO_DRAW_N64;
|
||||
|
||||
if (CVAR_BOOTSEQUENCE_VALUE == BOOTSEQUENCE_DEFAULT) {
|
||||
if (logosSeen == 0) {
|
||||
|
||||
@@ -633,7 +633,7 @@ static void RegisterCustomEquipment() {
|
||||
gSPDisplayList(play->state.gfxCtx->polyXlu.p++, resolvedBottle);
|
||||
|
||||
if (player->itemAction >= PLAYER_IA_BOTTLE &&
|
||||
player->itemAction < PLAYER_IA_BOTTLE + std::size(bottleContentDLs)) {
|
||||
player->itemAction < static_cast<int>(PLAYER_IA_BOTTLE + std::size(bottleContentDLs))) {
|
||||
contentDL = bottleContentDLs[player->itemAction - PLAYER_IA_BOTTLE];
|
||||
}
|
||||
|
||||
|
||||
@@ -572,7 +572,7 @@ static bool StateSlotSelectHandler(std::shared_ptr<Ship::Console> Console, const
|
||||
ERROR_MESSAGE("[SOH] Unexpected arguments passed");
|
||||
return 1;
|
||||
}
|
||||
uint8_t slot;
|
||||
int32_t slot;
|
||||
|
||||
try {
|
||||
slot = std::stoi(args[1], nullptr, 10);
|
||||
@@ -581,7 +581,7 @@ static bool StateSlotSelectHandler(std::shared_ptr<Ship::Console> Console, const
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (slot < 0) {
|
||||
if (slot < 0 || slot > 2) {
|
||||
ERROR_MESSAGE("[SOH] Invalid slot passed. Slot must be between 0 and 2");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -923,9 +923,9 @@ void ActorViewerWindow::DrawElement() {
|
||||
|
||||
PushStyleCombobox(THEME_COLOR);
|
||||
if (ImGui::BeginCombo("Actor Type", acMapping[category])) {
|
||||
for (int i = 0; i < acMapping.size(); i++) {
|
||||
for (size_t i = 0; i < acMapping.size(); i++) {
|
||||
if (ImGui::Selectable(acMapping[i])) {
|
||||
category = i;
|
||||
category = static_cast<int>(i);
|
||||
PopulateActorDropdown(category, list);
|
||||
break;
|
||||
}
|
||||
@@ -938,7 +938,7 @@ void ActorViewerWindow::DrawElement() {
|
||||
}
|
||||
|
||||
if (ImGui::BeginCombo("Actor", filler.c_str())) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
for (size_t i = 0; i < list.size(); i++) {
|
||||
std::string label = std::to_string(i) + ": " + ActorDB::Instance->RetrieveEntry(list[i]->id).name;
|
||||
std::string description = GetActorDescription(list[i]->id);
|
||||
if (description != "")
|
||||
|
||||
@@ -320,7 +320,8 @@ static void DrawButtonItemSelector(const char* label, int buttonIndex, UIWidgets
|
||||
Player* player = GET_PLAYER(gPlayState);
|
||||
if (player != nullptr) {
|
||||
// Check item type and update corresponding equipment
|
||||
if (slotEntry.id >= ITEM_SWORD_KOKIRI && slotEntry.id <= ITEM_SWORD_BROKEN) {
|
||||
if ((slotEntry.id >= ITEM_SWORD_KOKIRI && slotEntry.id <= ITEM_SWORD_BGS) ||
|
||||
slotEntry.id == ITEM_SWORD_BROKEN) {
|
||||
player->currentSwordItemId = slotEntry.id;
|
||||
} else if (slotEntry.id >= ITEM_SHIELD_DEKU && slotEntry.id <= ITEM_SHIELD_MIRROR) {
|
||||
if (slotEntry.id == ITEM_SHIELD_DEKU)
|
||||
@@ -1901,7 +1902,7 @@ void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const
|
||||
|
||||
PushStyleButton(Colors::DarkGray);
|
||||
auto value = (size_t)CUR_UPG_VALUE(categoryId);
|
||||
uint8_t item = value < items.size() ? items[value] : ITEM_NONE;
|
||||
uint8_t item = value < items.size() ? items[value] : (uint8_t)ITEM_NONE;
|
||||
const ItemMapEntry& slotEntry = itemMapping[item];
|
||||
if (ImGui::ImageButton(
|
||||
slotEntry.name.c_str(),
|
||||
@@ -1996,11 +1997,11 @@ void DrawEquipmentTab() {
|
||||
if (i < 4) {
|
||||
isEquipped = (currentSword == equipmentValues[i]);
|
||||
} else if (i < 8) {
|
||||
isEquipped = (currentShield == (PLAYER_SHIELD_DEKU + (i - 4)));
|
||||
isEquipped = (currentShield == static_cast<int8_t>(PLAYER_SHIELD_DEKU + (i - 4)));
|
||||
} else if (i < 12) {
|
||||
isEquipped = (currentTunic == (PLAYER_TUNIC_KOKIRI + (i - 8)));
|
||||
isEquipped = (currentTunic == static_cast<int8_t>(PLAYER_TUNIC_KOKIRI + (i - 8)));
|
||||
} else {
|
||||
isEquipped = (currentBoots == (PLAYER_BOOTS_KOKIRI + (i - 12)));
|
||||
isEquipped = (currentBoots == static_cast<int8_t>(PLAYER_BOOTS_KOKIRI + (i - 12)));
|
||||
}
|
||||
|
||||
PushStyleButton(Colors::DarkGray);
|
||||
@@ -2439,7 +2440,7 @@ void DrawDungeonItemsTab() {
|
||||
}
|
||||
|
||||
UIWidgets::BeginCard(SohUtils::GetSceneName(dungeonIndex).c_str());
|
||||
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), SohUtils::GetSceneName(dungeonIndex).c_str());
|
||||
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s", SohUtils::GetSceneName(dungeonIndex).c_str());
|
||||
|
||||
// Map, Compass, Small Key, Boss Key (new order)
|
||||
DrawDungeonItemButton(ITEM_DUNGEON_MAP, dungeonIndex);
|
||||
|
||||
@@ -22,7 +22,7 @@ void DrawHookRegisteringInfos(const char* hookName) {
|
||||
return;
|
||||
}
|
||||
|
||||
ImGui::Text("Total Registered: %d", numHooks);
|
||||
ImGui::Text("Total Registered: %zu", numHooks);
|
||||
|
||||
if (ImGui::BeginTable(("Table##" + std::string(hookName)).c_str(), 4,
|
||||
ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable |
|
||||
|
||||
@@ -179,10 +179,11 @@ void ValueViewerWindow::DrawElement() {
|
||||
UIWidgets::CVarCheckbox("Enable Printing", CVAR_NAME, UIWidgets::CheckboxOptions().Color(THEME_COLOR));
|
||||
|
||||
ImGui::BeginGroup();
|
||||
static size_t selectedElement = -1;
|
||||
std::string selectedElementText = (selectedElement == -1) ? "Select a value"
|
||||
: (std::string(valueTable[selectedElement].name) + " (" +
|
||||
std::string(valueTable[selectedElement].path) + ")");
|
||||
static size_t selectedElement = SIZE_MAX;
|
||||
std::string selectedElementText = (selectedElement == SIZE_MAX)
|
||||
? "Select a value"
|
||||
: (std::string(valueTable[selectedElement].name) + " (" +
|
||||
std::string(valueTable[selectedElement].path) + ")");
|
||||
UIWidgets::PushStyleCombobox(THEME_COLOR);
|
||||
if (ImGui::BeginCombo("##valueViewerElement", selectedElementText.c_str())) {
|
||||
for (size_t i = 0; i < valueTable.size(); i++) {
|
||||
@@ -202,11 +203,11 @@ void ValueViewerWindow::DrawElement() {
|
||||
UIWidgets::PopStyleCombobox();
|
||||
ImGui::SameLine();
|
||||
UIWidgets::PushStyleButton(THEME_COLOR);
|
||||
if (selectedElement != -1 && ImGui::Button("+")) {
|
||||
if (selectedElement != SIZE_MAX && ImGui::Button("+")) {
|
||||
valueViewerSettings.insert(
|
||||
{ (ValueViewerEntry)selectedElement,
|
||||
{ valueTable[selectedElement].prefix, ImVec4(1.0f, 1.0f, 1.0f, 1.0f), false, false, 0, 0 } });
|
||||
selectedElement = -1;
|
||||
selectedElement = SIZE_MAX;
|
||||
SaveValueConfig();
|
||||
}
|
||||
UIWidgets::PopStyleButton();
|
||||
|
||||
@@ -388,7 +388,7 @@ void GameplayStatsRow(const char* label, const std::string& value, ImVec4 color
|
||||
ImGui::SameLine(ImGui::GetContentRegionAvail().x - (ImGui::CalcTextSize(value.c_str()).x));
|
||||
ImGui::Text("%s", value.c_str());
|
||||
ImGui::PopStyleColor();
|
||||
if (tooltip != "" && ImGui::IsItemHovered()) {
|
||||
if (tooltip[0] != '\0' && ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip("%s", tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,9 @@ void HandleModSelection(size_t index, const std::string& file) {
|
||||
const ImGuiIO& io = ImGui::GetIO();
|
||||
|
||||
if (io.KeyShift && lastSelectedModIndex >= 0 && lastSelectedModIndex < static_cast<int>(enabledModFiles.size())) {
|
||||
auto [startIndex, endIndex] = std::minmax(static_cast<size_t>(lastSelectedModIndex), index);
|
||||
const size_t lastIndex = static_cast<size_t>(lastSelectedModIndex);
|
||||
const size_t startIndex = std::min(lastIndex, index);
|
||||
const size_t endIndex = std::max(lastIndex, index);
|
||||
selectedEnabledModFiles.clear();
|
||||
for (size_t i = startIndex; i <= endIndex; i++)
|
||||
selectedEnabledModFiles.insert(enabledModFiles[i]);
|
||||
|
||||
@@ -1117,7 +1117,7 @@ void GenerateItemPool() {
|
||||
if (junkToAdd > 0) {
|
||||
if (ctx->GetOption(RSK_ICE_TRAP_PERCENT).Is(100)) {
|
||||
iceTrapstoAdd = static_cast<int>(junkToAdd);
|
||||
} else if (ctx->GetOption(RSK_ICE_TRAP_PERCENT).Get() >= 0) {
|
||||
} else if (ctx->GetOption(RSK_ICE_TRAP_PERCENT).Get() > 0) {
|
||||
for (size_t count = 0; count < junkToAdd; count++) {
|
||||
if (Random(0, 101) < ctx->GetOption(RSK_ICE_TRAP_PERCENT).Get()) {
|
||||
iceTrapstoAdd++;
|
||||
|
||||
@@ -244,7 +244,7 @@ void BuildMapMessage(uint16_t* textId, bool* loadFromMessageTable) {
|
||||
CustomMessage msg =
|
||||
CustomMessage("You found the %g[[name]]%w! [[typeHint]]", "Du erhältst das %g[[name]]%w! [[typeHint]]",
|
||||
"Vous ebtenez %g[[name]]%w! [[typeHint]]", TEXTBOX_TYPE_BLUE);
|
||||
int sceneNum;
|
||||
int sceneNum = -1;
|
||||
switch (itemEntry.getItemId) {
|
||||
case RG_DEKU_TREE_MAP:
|
||||
sceneNum = SCENE_DEKU_TREE;
|
||||
|
||||
@@ -995,7 +995,7 @@ void PlandomizerDrawOptions() {
|
||||
ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1));
|
||||
ImGui::PopStyleVar();
|
||||
if (upRet) {
|
||||
if (hash + 1 >= gSeedTextures.size()) {
|
||||
if (hash + 1 >= static_cast<int32_t>(gSeedTextures.size())) {
|
||||
hash = 0;
|
||||
} else {
|
||||
hash++;
|
||||
@@ -1017,7 +1017,7 @@ void PlandomizerDrawOptions() {
|
||||
hash--;
|
||||
}
|
||||
}
|
||||
if (index != spoilerHash.size() - 1) {
|
||||
if (static_cast<size_t>(index) != spoilerHash.size() - 1) {
|
||||
ImGui::TableNextColumn();
|
||||
}
|
||||
ImGui::PopID();
|
||||
|
||||
@@ -25,7 +25,9 @@ void ObjComb_RandomizerChooseItemDrop(ObjComb* objComb, PlayState* play) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((params > 0) || (params < 0x1A)) {
|
||||
// Vanilla is `(params > 0) || (params < 0x1A)`, which is always true; kept as-is to match
|
||||
// ObjComb_ChooseItemDrop in soh/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c.
|
||||
if (true) {
|
||||
if (params == 6) {
|
||||
if (Flags_GetCollectible(play, (objComb->actor.params >> 8) & 0x3F)) {
|
||||
params = -1;
|
||||
|
||||
@@ -307,7 +307,6 @@ class Location {
|
||||
ActorID actorId;
|
||||
SceneID scene;
|
||||
int32_t actorParams;
|
||||
bool checked = false;
|
||||
std::string shortName;
|
||||
std::string spoilerName;
|
||||
RandomizerHintTextKey hintKey;
|
||||
@@ -315,7 +314,6 @@ class Location {
|
||||
bool isVanillaCompletion;
|
||||
SpoilerCollectionCheck collectionCheck;
|
||||
int16_t vanillaPrice;
|
||||
bool isHintable = false;
|
||||
Option excludedOption;
|
||||
};
|
||||
} // namespace Rando
|
||||
@@ -2296,7 +2296,7 @@ void Logic::ApplyItemEffect(Item& item, bool state) {
|
||||
mSaveContext->magicLevel += (!state ? -1 : 1);
|
||||
} break;
|
||||
case RG_PROGRESSIVE_OCARINA: {
|
||||
uint8_t i;
|
||||
int32_t i;
|
||||
for (i = 0; i < 3; i++) {
|
||||
if (CurrentInventory(ITEM_OCARINA_FAIRY) == OcarinaLookup[i]) {
|
||||
break;
|
||||
@@ -2325,7 +2325,7 @@ void Logic::ApplyItemEffect(Item& item, bool state) {
|
||||
case RG_FIRE_ARROWS:
|
||||
case RG_ICE_ARROWS:
|
||||
case RG_LIGHT_ARROWS:
|
||||
SetInventory(item.GetGIEntry()->itemId, (!state ? ITEM_NONE : item.GetGIEntry()->itemId));
|
||||
SetInventory(item.GetGIEntry()->itemId, (!state ? (uint16_t)ITEM_NONE : item.GetGIEntry()->itemId));
|
||||
break;
|
||||
case RG_MAGIC_BEAN:
|
||||
case RG_MAGIC_BEAN_PACK: {
|
||||
|
||||
@@ -172,11 +172,11 @@ Option::Option(size_t key_, std::string name_, std::vector<std::string> options_
|
||||
bool defaultHidden_, WidgetFunc callback_, int imFlags_)
|
||||
: key(key_), name(std::move(name_)), options(std::move(options_)), category(category_),
|
||||
cvarName(std::move(cvarName_)), description(std::move(description_)), widgetType(widgetType_),
|
||||
defaultOption(defaultOption_), defaultHidden(defaultHidden_), callback(callback_), imFlags(imFlags_) {
|
||||
defaultOption(defaultOption_), defaultHidden(defaultHidden_), imFlags(imFlags_), callback(callback_) {
|
||||
contextSelection = defaultOption;
|
||||
hidden = defaultHidden;
|
||||
for (int i = 0; i < options.size(); i++) {
|
||||
optionsMap.emplace(i, options[i].c_str());
|
||||
for (size_t i = 0; i < options.size(); i++) {
|
||||
optionsMap.emplace(static_cast<int32_t>(i), options[i].c_str());
|
||||
}
|
||||
UIWidgets::LabelPositions labelPosition;
|
||||
switch (widgetType) {
|
||||
@@ -305,8 +305,8 @@ static std::string MakeTrickDescription(RandomizerTrick key) {
|
||||
|
||||
TrickSetting::TrickSetting(RandomizerTrick key_, const RandomizerCheckQuest quest_, const RandomizerArea area_,
|
||||
std::set<Tricks::Tag> tags_, const std::string nameTag_)
|
||||
: Option(key_, std::move(MakeTrickName(key_)), { "Disabled", "Enabled" }, OptionCategory::Setting, "",
|
||||
std::move(MakeTrickDescription(key_)), WIDGET_CVAR_CHECKBOX, 0, false, nullptr, IMFLAG_NONE),
|
||||
: Option(key_, MakeTrickName(key_), { "Disabled", "Enabled" }, OptionCategory::Setting, "",
|
||||
MakeTrickDescription(key_), WIDGET_CVAR_CHECKBOX, 0, false, nullptr, IMFLAG_NONE),
|
||||
mQuest(quest_), mArea(area_), mNameTag(nameTag_), mTags(std::move(tags_)) {
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ std::unordered_map<std::string, SceneID> spoilerFileDungeonToScene = {
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma optimize("", off)
|
||||
#else
|
||||
#elif defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC push_options
|
||||
#pragma GCC optimize("O0")
|
||||
#endif
|
||||
@@ -183,7 +183,7 @@ bool Randomizer::SpoilerFileExists(const char* spoilerFileName) {
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
#pragma optimize("", on)
|
||||
#else
|
||||
#elif defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC pop_options
|
||||
#endif
|
||||
|
||||
@@ -1033,14 +1033,16 @@ void JoinRandoGenerationThread() {
|
||||
|
||||
class ExtendedVanillaTableInvalidItemIdException : public std::exception {
|
||||
private:
|
||||
s16 itemID;
|
||||
std::string message;
|
||||
|
||||
public:
|
||||
ExtendedVanillaTableInvalidItemIdException(s16 itemID) : itemID(itemID) {
|
||||
ExtendedVanillaTableInvalidItemIdException(s16 itemID)
|
||||
: message(std::to_string(itemID) +
|
||||
" is not a valid ItemID for the extendedVanillaGetItemTable. If you are adding a new "
|
||||
"item, try adding it to randoGetItemTable instead.") {
|
||||
}
|
||||
std::string what() {
|
||||
return itemID + " is not a valid ItemID for the extendedVanillaGetItemTable. If you are adding a new"
|
||||
"item, try adding it to randoGetItemTable instead.";
|
||||
const char* what() const noexcept override {
|
||||
return message.c_str();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1888,9 +1888,6 @@ void LoadSettings() {
|
||||
|
||||
bool IsCheckShuffled(RandomizerCheck rc) {
|
||||
Rando::Location* loc = Rando::StaticData::GetLocation(rc);
|
||||
if (loc->GetRCType() == RCTYPE_SHOP) {
|
||||
auto identity = OTRGlobals::Instance->gRandomizer->IdentifyShopItem(loc->GetScene(), loc->GetActorParams() + 1);
|
||||
}
|
||||
if (IS_RANDO) {
|
||||
return (loc->GetArea() != RCAREA_INVALID) && // don't show Invalid locations
|
||||
(loc->GetRCType() != RCTYPE_GOSSIP_STONE) && // TODO: Don't show hints until tracker supports them
|
||||
@@ -2017,7 +2014,7 @@ void UpdateAllAreas() {
|
||||
|
||||
void UpdateAreas(RandomizerCheckArea area) {
|
||||
if (checksByArea.contains(area)) {
|
||||
areasFullyChecked[area] = areaChecksGotten[area] == checksByArea.find(area)->second.size();
|
||||
areasFullyChecked[area] = static_cast<size_t>(areaChecksGotten[area]) == checksByArea.find(area)->second.size();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2125,8 +2122,8 @@ bool IsMysteryShopItem(RandomizerCheck rc) {
|
||||
}
|
||||
|
||||
void DrawLocation(RandomizerCheck rc) {
|
||||
Color_RGBA8 mainColor;
|
||||
Color_RGBA8 extraColor;
|
||||
Color_RGBA8 mainColor = Color_Unchecked_Main;
|
||||
Color_RGBA8 extraColor = Color_Unchecked_Extra;
|
||||
std::string txt;
|
||||
Rando::Location* loc = Rando::StaticData::GetLocation(rc);
|
||||
Rando::ItemLocation* itemLoc = OTRGlobals::Instance->gRandoContext->GetItemLocation(rc);
|
||||
@@ -2262,6 +2259,8 @@ void DrawLocation(RandomizerCheck rc) {
|
||||
|
||||
if (status != RCSHOW_UNCHECKED) {
|
||||
switch (status) {
|
||||
case RCSHOW_UNCHECKED:
|
||||
break;
|
||||
case RCSHOW_SAVED:
|
||||
case RCSHOW_COLLECTED:
|
||||
case RCSHOW_SCUMMED:
|
||||
|
||||
@@ -498,32 +498,6 @@ void Entrance_OverrideBlueWarp(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void Entrance_EnableFW(void) {
|
||||
Player* player = GET_PLAYER(gPlayState);
|
||||
// Leave restriction in Tower Collapse Interior, Castle Collapse, Treasure Box Shop, Tower Collapse Exterior,
|
||||
// Grottos area, Fishing Pond, Ganon Battle and for states that disable buttons.
|
||||
if (!false /* farores wind anywhere */ || gPlayState->sceneNum == SCENE_GANONS_TOWER_COLLAPSE_INTERIOR ||
|
||||
gPlayState->sceneNum == SCENE_INSIDE_GANONS_CASTLE_COLLAPSE ||
|
||||
(gPlayState->sceneNum == SCENE_TREASURE_BOX_SHOP && !false /* shuffled chest mini game */) ||
|
||||
gPlayState->sceneNum == SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR || gPlayState->sceneNum == SCENE_GROTTOS ||
|
||||
gPlayState->sceneNum == SCENE_FISHING_POND || gPlayState->sceneNum == SCENE_GANON_BOSS ||
|
||||
gSaveContext.eventInf[0] & 0x1 || // Ingo's Minigame state
|
||||
player->stateFlags1 &
|
||||
(PLAYER_STATE1_HANGING_OFF_LEDGE | PLAYER_STATE1_CLIMBING_LADDER | PLAYER_STATE1_ON_HORSE |
|
||||
PLAYER_STATE1_IN_WATER) || // Swimming, riding horse, Down A, hanging from a ledge
|
||||
player->stateFlags2 & PLAYER_STATE2_CRAWLING // Blank A
|
||||
// Shielding, spinning and getting skull tokens still disable buttons automatically
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (size_t i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
|
||||
if (gSaveContext.equips.buttonItems[i] == ITEM_FARORES_WIND) {
|
||||
gSaveContext.buttonStatus[i] = BTN_ENABLED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if Link should still be riding epona after changing entrances
|
||||
void Entrance_HandleEponaState(void) {
|
||||
s32 entrance = gPlayState->nextEntranceIndex;
|
||||
|
||||
@@ -50,7 +50,6 @@ void Entrance_OverrideWeatherState(void);
|
||||
void Entrance_OverrideGerudoGuardCapture(void);
|
||||
void Entrance_OverrideSpawnScene(int32_t sceneNum, int32_t spawn);
|
||||
int32_t Entrance_OverrideSpawnSceneRoom(int32_t sceneNum, int32_t spawn, int32_t room);
|
||||
void Entrance_EnableFW(void);
|
||||
uint8_t Entrance_GetIsEntranceDiscovered(uint16_t entranceIndex);
|
||||
void Entrance_SetEntranceDiscovered(uint16_t entranceIndex, uint8_t isReversedEntrance);
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -898,6 +898,9 @@ void EntranceTrackerWindow::DrawElement() {
|
||||
case ENTRANCE_DESTINATION_TYPE:
|
||||
entranceList = destListSortedByType;
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Begin tracker list
|
||||
|
||||
@@ -801,7 +801,7 @@ void RegisterHintTrackerWidgets() {
|
||||
.Options(ColorPickerOptions().Color(THEME_COLOR).DefaultValue(Color_ReadText_Default).UseAlpha().ShowReset());
|
||||
SohGui::GetSohMenu()->AddSearchWidget({ readTextColorWidget, "Randomizer", "Hint Tracker", "General Settings" });
|
||||
|
||||
unreadColorWidget = { .name = "Unread (???)##HintTracker", .type = WidgetType::WIDGET_CVAR_COLOR_PICKER };
|
||||
unreadColorWidget = { .name = "Unread (?\?\?)##HintTracker", .type = WidgetType::WIDGET_CVAR_COLOR_PICKER };
|
||||
unreadColorWidget.CVar(CVAR_TRACKER_HINT("UnreadColor"))
|
||||
.Options(ColorPickerOptions().Color(THEME_COLOR).DefaultValue(Color_Unread_Default).UseAlpha().ShowReset());
|
||||
SohGui::GetSohMenu()->AddSearchWidget({ unreadColorWidget, "Randomizer", "Hint Tracker", "General Settings" });
|
||||
|
||||
@@ -51,8 +51,6 @@ std::vector<ItemTrackerItem> mainWindowItems = {};
|
||||
|
||||
static WidgetInfo backgroundColor;
|
||||
static WidgetInfo windowTypeWidget;
|
||||
static WidgetInfo enableDraggingWidget;
|
||||
static WidgetInfo onlyPausedWidget;
|
||||
static WidgetInfo ammoTracking;
|
||||
static WidgetInfo keyTracking;
|
||||
static WidgetInfo triforcePieceCount;
|
||||
@@ -876,7 +874,7 @@ void DrawItemCount(ItemTrackerItem item, bool hideMax) {
|
||||
ImGui::PopStyleColor();
|
||||
} else {
|
||||
ImGui::SetCursorScreenPos(ImVec2(p.x, p.y - 14));
|
||||
ImGui::Text("");
|
||||
ImGui::TextUnformatted("");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -926,7 +924,7 @@ bool HasBossSoul(RandomizerInf bossSoul) {
|
||||
|
||||
void DrawItem(ItemTrackerItem item) {
|
||||
uint32_t actualItemId =
|
||||
GameInteractor::IsSaveLoaded() && item.kind == ITEM_KIND_ITEM ? INV_CONTENT(item.id) : ITEM_NONE;
|
||||
GameInteractor::IsSaveLoaded() && item.kind == ITEM_KIND_ITEM ? INV_CONTENT(item.id) : (uint8_t)ITEM_NONE;
|
||||
float iconSize = static_cast<float>(CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36));
|
||||
bool hasItem = actualItemId != ITEM_NONE;
|
||||
bool hideMax = false;
|
||||
@@ -2235,8 +2233,6 @@ void RegisterItemTrackerWidgets() {
|
||||
.ComboMap(windowType))
|
||||
.Callback([](WidgetInfo& info) { RefreshItemTrackerMainWindow(); });
|
||||
SohGui::mSohMenu->AddSearchWidget({ windowTypeWidget, "Randomizer", "Item Tracker", "General Settings" });
|
||||
enableDraggingWidget;
|
||||
onlyPausedWidget;
|
||||
|
||||
ammoTracking = { .name = "Ammo/Capacity Tracking", .type = WidgetType::WIDGET_CVAR_COMBOBOX };
|
||||
ammoTracking.CVar(CVAR_TRACKER_ITEM("ItemCountType"))
|
||||
|
||||
@@ -145,7 +145,7 @@ void Settings::HandleKeyringUI() {
|
||||
const bool chestGameKeyring =
|
||||
CVarGetInteger(CVAR_RANDOMIZER_SETTING("ShuffleChestMinigame"), RO_GENERIC_OFF) != RO_GENERIC_OFF;
|
||||
const uint8_t maxKeyringCount = 8 + fortressKeyring + chestGameKeyring;
|
||||
if (mOptions[RSK_KEYRINGS_RANDOM_COUNT].GetOptionCount() != maxKeyringCount + 1) {
|
||||
if (mOptions[RSK_KEYRINGS_RANDOM_COUNT].GetOptionCount() != static_cast<size_t>(maxKeyringCount) + 1) {
|
||||
mOptions[RSK_KEYRINGS_RANDOM_COUNT].ChangeOptions(NumOpts(0, maxKeyringCount));
|
||||
}
|
||||
if (fortressKeyring) {
|
||||
@@ -435,16 +435,16 @@ void Settings::CreateOptions() {
|
||||
} else {
|
||||
mOptions[RSK_TRIFORCE_HUNT_PIECES_LOCATION].Unhide();
|
||||
}
|
||||
if (mOptions[RSK_RAINBOW_BRIDGE_TRIFORCE_COUNT].GetOptionCount() != triforceTotal + 1) {
|
||||
if (mOptions[RSK_RAINBOW_BRIDGE_TRIFORCE_COUNT].GetOptionCount() != static_cast<size_t>(triforceTotal) + 1) {
|
||||
mOptions[RSK_RAINBOW_BRIDGE_TRIFORCE_COUNT].ChangeOptions(NumOpts(0, triforceTotal));
|
||||
}
|
||||
if (mOptions[RSK_GBK_TRIFORCE_COUNT].GetOptionCount() != triforceTotal + 1) {
|
||||
if (mOptions[RSK_GBK_TRIFORCE_COUNT].GetOptionCount() != static_cast<size_t>(triforceTotal) + 1) {
|
||||
mOptions[RSK_GBK_TRIFORCE_COUNT].ChangeOptions(NumOpts(0, triforceTotal));
|
||||
}
|
||||
if (mOptions[RSK_GANONS_SOUL_TRIFORCE_COUNT].GetOptionCount() != triforceTotal + 1) {
|
||||
if (mOptions[RSK_GANONS_SOUL_TRIFORCE_COUNT].GetOptionCount() != static_cast<size_t>(triforceTotal) + 1) {
|
||||
mOptions[RSK_GANONS_SOUL_TRIFORCE_COUNT].ChangeOptions(NumOpts(0, triforceTotal));
|
||||
}
|
||||
if (mOptions[RSK_WINCON_TRIFORCE_COUNT].GetOptionCount() != triforceTotal + 1) {
|
||||
if (mOptions[RSK_WINCON_TRIFORCE_COUNT].GetOptionCount() != static_cast<size_t>(triforceTotal) + 1) {
|
||||
mOptions[RSK_WINCON_TRIFORCE_COUNT].ChangeOptions(NumOpts(0, triforceTotal));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -510,9 +510,7 @@ void TimeSplitsPopUpContext() {
|
||||
|
||||
if (popupObject.splitType == SPLIT_TYPE_UPGRADE) {
|
||||
if (popupID <= ITEM_SLINGSHOT && popupID != -1) {
|
||||
ImVec2 imageMin = ImGui::GetItemRectMin();
|
||||
ImVec2 imageMax = ImGui::GetItemRectMax();
|
||||
// ImVec2 imageSize = ImVec2(imageMax.x - imageMin.x, imageMax.y - imageMin.y); UNUSED
|
||||
ImVec2 textPos = ImVec2(imageMax.x - ImGui::CalcTextSize("00").x - 5,
|
||||
imageMax.y - ImGui::CalcTextSize("00").y - 5);
|
||||
|
||||
@@ -563,7 +561,7 @@ void TimeSplitsItemSplitEvent(uint32_t type, u8 item) {
|
||||
}
|
||||
if (item == ITEM_SKULL_TOKEN) {
|
||||
auto it = std::find_if(splitList.begin(), splitList.end(), [item](const SplitObject& split) {
|
||||
if (split.splitSkullTokenCount == gSaveContext.inventory.gsTokens) {
|
||||
if (split.splitSkullTokenCount == static_cast<uint32_t>(gSaveContext.inventory.gsTokens)) {
|
||||
return split.splitID == item;
|
||||
} else {
|
||||
return split.splitID == ITEM_NONE;
|
||||
@@ -1005,7 +1003,6 @@ void TimeSplitWindow::InitElement() {
|
||||
});
|
||||
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnItemReceive>([](GetItemEntry itemEntry) {
|
||||
GetItemEntry testItem = itemEntry;
|
||||
if (itemEntry.itemId == ITEM_SKULL_TOKEN || itemEntry.itemId == ITEM_BOTTLE || itemEntry.itemId == ITEM_POE ||
|
||||
itemEntry.itemId == ITEM_BIG_POE) {
|
||||
uint32_t tempType = SPLIT_TYPE_ITEM;
|
||||
|
||||
@@ -139,7 +139,7 @@ void RegisterOnInterfaceUpdateHook() {
|
||||
uint32_t minutes = timer / 60;
|
||||
uint32_t seconds = timer % 60;
|
||||
char* announceBuf = ttsAnnounceBuf;
|
||||
char arg[8]; // at least big enough where no s8 string will overflow
|
||||
char arg[16]; // big enough for any number formatted below
|
||||
if (minutes > 0) {
|
||||
snprintf(arg, sizeof(arg), "%d", minutes);
|
||||
auto translation =
|
||||
@@ -340,7 +340,7 @@ void RegisterOnKaleidoscopeUpdateHook() {
|
||||
}
|
||||
|
||||
if ((pauseCtx->debugState != 1) && (pauseCtx->debugState != 2)) {
|
||||
char arg[8];
|
||||
char arg[16];
|
||||
if (CHECK_BTN_ALL(input->press.button, BTN_DUP)) {
|
||||
// Normalize hearts to fractional count similar to z_lifemeter
|
||||
int curHeartFraction = gSaveContext.health % 16;
|
||||
@@ -373,7 +373,7 @@ void RegisterOnKaleidoscopeUpdateHook() {
|
||||
}
|
||||
|
||||
uint16_t cursorIndex =
|
||||
(pauseCtx->pageIndex == PAUSE_MAP && !inDungeonScene) ? PAUSE_WORLD_MAP : pauseCtx->pageIndex;
|
||||
(pauseCtx->pageIndex == PAUSE_MAP && !inDungeonScene) ? (uint16_t)PAUSE_WORLD_MAP : pauseCtx->pageIndex;
|
||||
if (prevCursorIndex == cursorIndex && prevCursorSpecialPos == pauseCtx->cursorSpecialPos &&
|
||||
prevCursorPoint[cursorIndex] == pauseCtx->cursorPoint[cursorIndex]) {
|
||||
return;
|
||||
@@ -393,7 +393,7 @@ void RegisterOnKaleidoscopeUpdateHook() {
|
||||
|
||||
switch (pauseCtx->pageIndex) {
|
||||
case PAUSE_ITEM: {
|
||||
char arg[8]; // at least big enough where no s8 string will overflow
|
||||
char arg[16]; // big enough for any number formatted below
|
||||
switch (pauseCtx->cursorItem[PAUSE_ITEM]) {
|
||||
case ITEM_STICK:
|
||||
case ITEM_NUT:
|
||||
@@ -444,7 +444,7 @@ void RegisterOnKaleidoscopeUpdateHook() {
|
||||
SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode());
|
||||
} else {
|
||||
// Dungeon map floor numbers
|
||||
char arg[8];
|
||||
char arg[16];
|
||||
int cursorPoint = pauseCtx->cursorPoint[PAUSE_MAP];
|
||||
|
||||
// Cursor is on a dungeon floor position
|
||||
@@ -471,7 +471,7 @@ void RegisterOnKaleidoscopeUpdateHook() {
|
||||
}
|
||||
break;
|
||||
case PAUSE_QUEST: {
|
||||
char arg[8]; // at least big enough where no s8 string will overflow
|
||||
char arg[16]; // big enough for any number formatted below
|
||||
switch (pauseCtx->cursorItem[PAUSE_QUEST]) {
|
||||
case ITEM_SKULL_TOKEN:
|
||||
snprintf(arg, sizeof(arg), "%d", gSaveContext.inventory.gsTokens);
|
||||
@@ -826,7 +826,7 @@ void RegisterOnUpdateMainMenuSelection() {
|
||||
[](uint8_t optionIndex, uint8_t optionValue) {
|
||||
if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0))
|
||||
return;
|
||||
uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language;
|
||||
uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? (uint8_t)LANGUAGE_ENG : gSaveContext.language;
|
||||
|
||||
auto optionName = BossRush_GetSettingName(optionIndex, language);
|
||||
auto optionValueName = BossRush_GetSettingChoiceName(optionIndex, optionValue, language);
|
||||
@@ -838,7 +838,7 @@ void RegisterOnUpdateMainMenuSelection() {
|
||||
[](uint8_t optionIndex) {
|
||||
if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0))
|
||||
return;
|
||||
uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language;
|
||||
uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? (uint8_t)LANGUAGE_ENG : gSaveContext.language;
|
||||
|
||||
auto optionName = SohFileSelect_GetSettingText(optionIndex, language);
|
||||
SpeechSynthesizer::Instance->Speak(optionName, GetLanguageCode());
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef BSWAP32
|
||||
#ifdef _MSC_VER
|
||||
#define BSWAP32 _byteswap_ulong
|
||||
#define BSWAP16 _byteswap_ushort
|
||||
@@ -32,6 +33,7 @@
|
||||
#define BSWAP32(value) \
|
||||
(((uint32_t)BSWAP16((uint16_t)((value)&0xffff)) << 16) | (uint32_t)BSWAP16((uint16_t)((value) >> 16)))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define UNREACHABLE __assume(0)
|
||||
|
||||
@@ -140,7 +140,7 @@ uint32_t CRC32C(unsigned char* data, size_t dataSize) {
|
||||
return CRC32IntrinImpl(data, dataSize);
|
||||
}
|
||||
#else
|
||||
unsigned int cpuidData[4];
|
||||
unsigned int cpuidData[4] = {};
|
||||
#ifdef _WIN32
|
||||
__cpuid(cpuidData, 1);
|
||||
#elif __APPLE__ || (defined(__aarch64__) && defined(__ARM_FEATURE_CRC32))
|
||||
|
||||
+6
-4
@@ -1,5 +1,7 @@
|
||||
#include "z64.h"
|
||||
|
||||
#include <bit>
|
||||
|
||||
// OTRTODO - this is awful
|
||||
|
||||
extern "C" {
|
||||
@@ -82,12 +84,12 @@ extern "C" void gDPSetTileSizeInterp(Gfx* pkt, int t, float uls, float ult, floa
|
||||
pkt->words.w0 = _SHIFTL(G_SETTILESIZE_INTERP, 24, 8);
|
||||
pkt++;
|
||||
|
||||
pkt->words.w0 = *(u32*)&uls;
|
||||
pkt->words.w1 = *(u32*)&ult;
|
||||
pkt->words.w0 = std::bit_cast<u32>(uls);
|
||||
pkt->words.w1 = std::bit_cast<u32>(ult);
|
||||
pkt++;
|
||||
|
||||
pkt->words.w0 = *(u32*)&lrs;
|
||||
pkt->words.w1 = *(u32*)&lrt;
|
||||
pkt->words.w0 = std::bit_cast<u32>(lrs);
|
||||
pkt->words.w1 = std::bit_cast<u32>(lrt);
|
||||
pkt++;
|
||||
}
|
||||
|
||||
|
||||
@@ -469,8 +469,8 @@ void Anchor::RegisterHooks() {
|
||||
s16 rightMinimapMargin = CVarGetInteger(CVAR_COSMETIC("HUD.Margin.R"), 0);
|
||||
s16 bottomMinimapMargin = CVarGetInteger(CVAR_COSMETIC("HUD.Margin.B"), 0);
|
||||
|
||||
s16 xMarginsMinimap;
|
||||
s16 yMarginsMinimap;
|
||||
s16 xMarginsMinimap = 0;
|
||||
s16 yMarginsMinimap = 0;
|
||||
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) {
|
||||
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ORIGINAL_LOCATION) {
|
||||
xMarginsMinimap = rightMinimapMargin;
|
||||
|
||||
@@ -48,9 +48,9 @@ void Window::Draw() {
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 4.0f);
|
||||
|
||||
for (int index = 0; index < notifications.size(); ++index) {
|
||||
for (size_t index = 0; index < notifications.size(); ++index) {
|
||||
auto& notification = notifications[index];
|
||||
int inverseIndex = ABS(index - (static_cast<int>(notifications.size()) - 1));
|
||||
int inverseIndex = ABS(static_cast<int>(index) - (static_cast<int>(notifications.size()) - 1));
|
||||
|
||||
ImGui::SetNextWindowViewport(vp->ID);
|
||||
if (notification.remainingTime < 4.0f) {
|
||||
@@ -115,7 +115,7 @@ void Window::Draw() {
|
||||
}
|
||||
|
||||
void Window::UpdateElement() {
|
||||
for (int index = 0; index < notifications.size(); ++index) {
|
||||
for (size_t index = 0; index < notifications.size(); ++index) {
|
||||
auto& notification = notifications[index];
|
||||
|
||||
// decrement remainingTime
|
||||
|
||||
@@ -1963,7 +1963,7 @@ std::wstring StringToU16(const std::string& s) {
|
||||
size_t i = 0;
|
||||
|
||||
while (i < s.size()) {
|
||||
unsigned long uni;
|
||||
unsigned long uni = '\1'; // skipped unless a valid encoding is matched below
|
||||
size_t nbytes = 0;
|
||||
bool error = false;
|
||||
unsigned char c = s[i++];
|
||||
|
||||
@@ -226,8 +226,8 @@ uint32_t Menu::DrawSearchResults(std::string& menuSearchText) {
|
||||
std::transform(widgetStr.begin(), widgetStr.end(), widgetStr.begin(), ::tolower);
|
||||
widgetStr.erase(std::remove(widgetStr.begin(), widgetStr.end(), ' '), widgetStr.end());
|
||||
if (widgetStr.find(menuSearchText) != std::string::npos) {
|
||||
UIWidgets::ComponentAlignments backupAlignment;
|
||||
UIWidgets::LabelPositions backupLabelPos;
|
||||
UIWidgets::ComponentAlignments backupAlignment = UIWidgets::ComponentAlignments::Left;
|
||||
UIWidgets::LabelPositions backupLabelPos = UIWidgets::LabelPositions::Above;
|
||||
if (info.type == WIDGET_COMBOBOX || info.type == WIDGET_CVAR_COMBOBOX) {
|
||||
backupAlignment =
|
||||
std::static_pointer_cast<UIWidgets::ComboboxOptions>(info.options)->alignment;
|
||||
@@ -697,7 +697,7 @@ void Menu::DrawElement() {
|
||||
ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AutoResizeY | ImGuiChildFlags_AlwaysAutoResize,
|
||||
ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar);
|
||||
|
||||
std::unordered_map<std::string, SidebarEntry>* sidebar;
|
||||
std::unordered_map<std::string, SidebarEntry>* sidebar = nullptr;
|
||||
float headerHeight = headerSizes.at(0).y + style.FramePadding.y * 2;
|
||||
ImVec2 buttonSize = ImGui::CalcTextSize(ICON_FA_TIMES_CIRCLE) + style.FramePadding * 2;
|
||||
bool scrollbar = false;
|
||||
@@ -745,6 +745,9 @@ void Menu::DrawElement() {
|
||||
}
|
||||
curIndex++;
|
||||
}
|
||||
if (sidebar == nullptr) { // headerIndex wasn't in menuOrder
|
||||
sidebar = &menuEntries.at(headerIndex).sidebars;
|
||||
}
|
||||
std::string menuSearchText = "";
|
||||
if (headerSearch) {
|
||||
ImGui::SameLine();
|
||||
|
||||
@@ -48,8 +48,8 @@ const int pixelCountPresets[] = { 480, 240, 480, 720, 960, 1200, 1440, 1080, 216
|
||||
const int default_pixelCount = 0; // Default combo list option
|
||||
|
||||
// Resolution clamp values as hardcoded in LUS::Gui::ApplyResolutionChanges()
|
||||
const uint32_t minVerticalPixelCount = SCREEN_HEIGHT;
|
||||
const uint32_t maxVerticalPixelCount = 4320; // 18x native, or 8K TV resolution
|
||||
const int32_t minVerticalPixelCount = SCREEN_HEIGHT;
|
||||
const int32_t maxVerticalPixelCount = 4320; // 18x native, or 8K TV resolution
|
||||
|
||||
const unsigned short default_maxIntegerScaleFactor = 6; // Default size of Integer scale factor slider.
|
||||
|
||||
@@ -550,11 +550,10 @@ void UpdateResolutionVars() {
|
||||
update[i] = false;
|
||||
}
|
||||
|
||||
// Initialise integer scale bounds.
|
||||
short max_integerScaleFactor = default_maxIntegerScaleFactor; // default value, which may or may not get
|
||||
// overridden depending on viewport res
|
||||
|
||||
short integerScale_maximumBounds = 1; // can change when window is resized
|
||||
// Initialise integer scale bounds. These are the file-scope ones the widgets read, so don't declare
|
||||
// locals here or the values computed below get thrown away.
|
||||
max_integerScaleFactor = default_maxIntegerScaleFactor;
|
||||
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;
|
||||
|
||||
@@ -28,7 +28,7 @@ WidgetInfo& SohMenu::AddWidget(WidgetPath& pathInfo, std::string widgetName, Wid
|
||||
std::unordered_map<std::string, SidebarEntry>& sidebar = menuEntries.at(pathInfo.sectionName).sidebars;
|
||||
uint8_t column = pathInfo.column;
|
||||
if (sidebar.contains(pathInfo.sidebarName)) {
|
||||
while (sidebar.at(pathInfo.sidebarName).columnWidgets.size() < column + 1) {
|
||||
while (sidebar.at(pathInfo.sidebarName).columnWidgets.size() < static_cast<size_t>(column) + 1) {
|
||||
sidebar.at(pathInfo.sidebarName).columnWidgets.push_back({});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1319,7 +1319,7 @@ void BeginCardLayout(const CardLayoutOptions& options) {
|
||||
|
||||
// First pass: calculate fixed widths and count auto-sized columns
|
||||
for (int i = 0; i < columnsPerRow; i++) {
|
||||
if (i < options.fixedColumnWidths.size() && options.fixedColumnWidths[i] > 0.0f) {
|
||||
if (static_cast<size_t>(i) < options.fixedColumnWidths.size() && options.fixedColumnWidths[i] > 0.0f) {
|
||||
columnWidths[i] = options.fixedColumnWidths[i];
|
||||
totalFixedWidth += columnWidths[i];
|
||||
} else {
|
||||
@@ -1336,7 +1336,7 @@ void BeginCardLayout(const CardLayoutOptions& options) {
|
||||
|
||||
// Second pass: assign auto-width to columns that need it
|
||||
for (int i = 0; i < columnsPerRow; i++) {
|
||||
if (i >= options.fixedColumnWidths.size() || options.fixedColumnWidths[i] <= 0.0f) {
|
||||
if (static_cast<size_t>(i) >= options.fixedColumnWidths.size() || options.fixedColumnWidths[i] <= 0.0f) {
|
||||
columnWidths[i] = autoWidth;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ bool Combobox(std::string label, T* value, const std::map<T, const char*>& combo
|
||||
ImGui::BeginDisabled(options.disabled);
|
||||
PushStyleCombobox(options.color);
|
||||
|
||||
const char* longest;
|
||||
const char* longest = "";
|
||||
size_t length = 0;
|
||||
for (auto& [index, string] : comboMap) {
|
||||
size_t len = strlen(string);
|
||||
@@ -199,7 +199,7 @@ bool Combobox(std::string label, T* value, const std::vector<const char*>& combo
|
||||
ImGui::BeginDisabled(options.disabled);
|
||||
PushStyleCombobox(options.color);
|
||||
|
||||
const char* longest;
|
||||
const char* longest = "";
|
||||
size_t length = 0;
|
||||
for (auto& string : comboVector) {
|
||||
size_t len = strlen(string);
|
||||
@@ -372,7 +372,7 @@ bool Combobox(std::string label, T* value, const char* (&comboArray)[N], const C
|
||||
ImGui::BeginDisabled(options.disabled);
|
||||
PushStyleCombobox(options.color);
|
||||
|
||||
const char* longest;
|
||||
const char* longest = "";
|
||||
size_t length = 0;
|
||||
for (size_t i = 0; i < N; i++) {
|
||||
size_t len = strlen(comboArray[i]);
|
||||
|
||||
@@ -171,7 +171,7 @@ std::vector<std::string> commandNames = {
|
||||
};
|
||||
|
||||
SceneCommandID GetCommandID(std::string commandName) {
|
||||
for (int i = 0; i < commandNames.size(); i++) {
|
||||
for (size_t i = 0; i < commandNames.size(); i++) {
|
||||
if (commandNames[i] == commandName) {
|
||||
return (SceneCommandID)i;
|
||||
}
|
||||
|
||||
+27
-2
@@ -41,9 +41,11 @@ f32 qNaN0x10000 = 0x7F810000;
|
||||
// }
|
||||
|
||||
OSId osGetThreadId(OSThread* thread) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
OSPri osGetThreadPri(OSThread* thread) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void osSetThreadPri(OSThread* thread, OSPri pri) {
|
||||
@@ -53,33 +55,43 @@ void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgC
|
||||
}
|
||||
|
||||
s32 osPfsFreeBlocks(OSPfs* pfs, s32* leftoverBytes) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 osEPiWriteIo(OSPiHandle* handle, u32 devAddr, u32 data) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 osPfsReadWriteFile(OSPfs* pfs, s32 fileNo, u8 flag, s32 offset, ptrdiff_t size, u8* data) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 osPfsDeleteFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 osPfsFileState(OSPfs* pfs, s32 fileNo, OSPfsState* state) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 osPfsInitPak(OSMesgQueue* mq, OSPfs* pfs, s32 channel) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 __osPfsCheckRamArea(OSPfs* pfs) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 osPfsChecker(OSPfs* pfs) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 osPfsFindFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32* fileNo) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 osPfsAllocateFile(OSPfs* pfs, u16 companyCode, u32 gameCode, u8* gameName, u8* extName, s32 length, s32* fileNo) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
OSIntMask osSetIntMask(OSIntMask a) {
|
||||
@@ -91,6 +103,7 @@ s32 osAfterPreNMI(void) {
|
||||
}
|
||||
|
||||
s32 osProbeRumblePak(OSMesgQueue* ctrlrqueue, OSPfs* pfs, u32 channel) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 osSetRumble(OSPfs* pfs, u32 vibrate) {
|
||||
@@ -116,6 +129,7 @@ void osInvalICache(void* vaddr, s32 nbytes) {
|
||||
}
|
||||
|
||||
s32 osContStartQuery(OSMesgQueue* mq) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void osContGetQuery(OSContStatus* data) {
|
||||
@@ -129,15 +143,18 @@ void __osSetFpcCsr(u32 a0) {
|
||||
}
|
||||
|
||||
s32 __osDisableInt(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void __osRestoreInt(s32 a0) {
|
||||
}
|
||||
|
||||
OSThread* __osGetActiveQueue(void) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OSThread* __osGetCurrFaultedThread(void) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
u32 osMemSize = 1024 * 1024 * 1024;
|
||||
@@ -202,21 +219,25 @@ void Audio_SetBGM(u32 bgmId) {
|
||||
}
|
||||
|
||||
s32 osContSetCh(u8 ch) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 osDpGetStatus(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void osDpSetStatus(u32 status) {
|
||||
}
|
||||
|
||||
u32 __osSpGetStatus() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void __osSpSetStatus(u32 status) {
|
||||
}
|
||||
|
||||
OSPiHandle* osDriveRomInit() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void __osInitialize_common(void) {
|
||||
@@ -232,10 +253,12 @@ void __osCleanupThread(void) {
|
||||
}
|
||||
|
||||
s32 _Printf(PrintCallback a, void* arg, const char* fmt, va_list ap) {
|
||||
unsigned char buffer[4096];
|
||||
char buffer[4096];
|
||||
|
||||
vsnprintf(buffer, sizeof(buffer), fmt, ap);
|
||||
a(arg, buffer, (u32)strlen(buffer));
|
||||
u32 len = (u32)strlen(buffer);
|
||||
a(arg, buffer, len);
|
||||
return len;
|
||||
}
|
||||
|
||||
void osSpTaskLoad(OSTask* task) {
|
||||
@@ -259,9 +282,11 @@ void osSpTaskYield(void) {
|
||||
}
|
||||
|
||||
s32 osStopTimer(OSTimer* timer) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
OSYieldResult osSpTaskYielded(OSTask* task) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void osViExtendVStart(u32 arg0) {
|
||||
|
||||
+4
-4
@@ -688,7 +688,7 @@ std::array<std::string, RA_MAX> rcareaPrefixes = {
|
||||
};
|
||||
|
||||
const std::string& SohUtils::GetSceneName(int32_t scene) {
|
||||
if (scene > sceneNames.size()) {
|
||||
if (scene < 0 || static_cast<size_t>(scene) >= sceneNames.size()) {
|
||||
SPDLOG_WARN("Passed invalid scene id to SohUtils::GetSceneName: ({})", scene);
|
||||
assert(false);
|
||||
return invalidString;
|
||||
@@ -713,7 +713,7 @@ const std::string& SohUtils::GetItemName(int32_t item) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (item >= currentItemNames->size()) {
|
||||
if (item < 0 || static_cast<size_t>(item) >= currentItemNames->size()) {
|
||||
SPDLOG_WARN("Passed invalid item id to SohUtils::GetItemName: ({})", item);
|
||||
assert(false);
|
||||
return invalidString;
|
||||
@@ -737,7 +737,7 @@ const std::string& SohUtils::GetQuestItemName(int32_t item) {
|
||||
currentQuestItemNames = &questItemNamesEng;
|
||||
break;
|
||||
}
|
||||
if (item > questItemNamesEng.size()) {
|
||||
if (item < 0 || static_cast<size_t>(item) >= questItemNamesEng.size()) {
|
||||
SPDLOG_WARN("Passed invalid quest item id to SohUtils::GetQuestItemName: ({})", item);
|
||||
assert(false);
|
||||
return invalidString;
|
||||
@@ -747,7 +747,7 @@ const std::string& SohUtils::GetQuestItemName(int32_t item) {
|
||||
}
|
||||
|
||||
const std::string& SohUtils::GetRandomizerCheckAreaPrefix(int32_t rcarea) {
|
||||
if (rcarea > rcareaPrefixes.size()) {
|
||||
if (rcarea < 0 || static_cast<size_t>(rcarea) >= rcareaPrefixes.size()) {
|
||||
SPDLOG_WARN("Passed invalid rcarea to SohUtils::GetRandomizerCheckAreaPrefix: ({})", rcarea);
|
||||
assert(false);
|
||||
return invalidString;
|
||||
|
||||
@@ -155,7 +155,7 @@ bool Scene_CommandObjectList(PlayState* play, SOH::ISceneCommand* cmd) {
|
||||
// Loop until a mismatch in the object lists
|
||||
// Then clear all object ids past that in the context object list and kill actors for those objects
|
||||
for (i = play->objectCtx.unk_09, k = 0; i < play->objectCtx.num; i++, k++) {
|
||||
if (k >= cmdObj->objects.size() || play->objectCtx.status[i].id != cmdObj->objects[k]) {
|
||||
if (static_cast<size_t>(k) >= cmdObj->objects.size() || play->objectCtx.status[i].id != cmdObj->objects[k]) {
|
||||
for (j = i; j < play->objectCtx.num; j++) {
|
||||
play->objectCtx.status[j].id = OBJECT_INVALID;
|
||||
}
|
||||
@@ -165,7 +165,7 @@ bool Scene_CommandObjectList(PlayState* play, SOH::ISceneCommand* cmd) {
|
||||
}
|
||||
|
||||
// Continuing from the last index, add the remaining object ids from the command object list
|
||||
for (; k < cmdObj->objects.size(); k++, i++) {
|
||||
for (; static_cast<size_t>(k) < cmdObj->objects.size(); k++, i++) {
|
||||
if (i < OBJECT_EXCHANGE_BANK_MAX - 1) {
|
||||
OTRfunc_800982FC(&play->objectCtx, i, cmdObj->objects[k]);
|
||||
}
|
||||
@@ -435,7 +435,7 @@ bool (*sceneCommands[])(PlayState*, SOH::ISceneCommand*) = {
|
||||
s32 OTRScene_ExecuteCommands(PlayState* play, SOH::Scene* scene) {
|
||||
SOH::SceneCommandID cmdCode;
|
||||
|
||||
for (int i = 0; i < scene->commands.size(); i++) {
|
||||
for (size_t i = 0; i < scene->commands.size(); i++) {
|
||||
auto sceneCmd = scene->commands[i];
|
||||
|
||||
if (sceneCmd == nullptr) // UH OH
|
||||
|
||||
Reference in New Issue
Block a user