diff --git a/soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp b/soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp index f4a3dd5a34..07341235f0 100644 --- a/soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp +++ b/soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp @@ -1,3 +1,5 @@ +#include + #include "functions.h" #include "macros.h" #include "soh/ShipUtils.h" @@ -1018,8 +1020,9 @@ void RegisterEnemyRandomizer() { ? (player->actor.world.pos.y - 1500.0f) : (player->actor.world.pos.y - 1000.0f); if (enemy->world.pos.y < killHeight) { - LUSLOG_INFO( - "AfterActorUpdateBgCheckInfo: Killing enemy, out of bounds (id 0x%x, pos x %.1f y %.1f z %.1f)", + SPDLOG_INFO( + "AfterActorUpdateBgCheckInfo: Killing enemy, out of bounds (id {:#x}, pos x {:.1f} y {:.1f} z " + "{:.1f})", enemy->id, enemy->world.pos.x, enemy->world.pos.y, enemy->world.pos.z); Actor_Kill(enemy); } diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp index 544a66ea4a..c19a69297a 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_RawAction.cpp @@ -1,3 +1,5 @@ +#include + #include "GameInteractor.h" #include "soh/ShipUtils.h" #include @@ -268,7 +270,7 @@ void GameInteractor::RawAction::UnsetFlag(int16_t flagType, int16_t flag) { break; case FlagType::FLAG_RANDOMIZER_INF: if (!IS_RANDO) { - LUSLOG_ERROR("Tried to unset randomizerInf flag outside of rando (%d)", flag); + SPDLOG_ERROR("Tried to unset randomizerInf flag outside of rando ({})", flag); assert(false); break; } diff --git a/soh/soh/Enhancements/randomizer/SeedContext.cpp b/soh/soh/Enhancements/randomizer/SeedContext.cpp index e1db1c4967..e74d96b40e 100644 --- a/soh/soh/Enhancements/randomizer/SeedContext.cpp +++ b/soh/soh/Enhancements/randomizer/SeedContext.cpp @@ -419,7 +419,7 @@ void Context::ParseSpoiler(const char* spoilerFileName) { mTrials->ParseJson(spoilerFileJson); mSpoilerLoaded = true; mSeedGenerated = false; - } catch (...) { LUSLOG_ERROR("Failed to load Spoiler File: %s", spoilerFileName); } + } catch (...) { SPDLOG_ERROR("Failed to load Spoiler File: {}", spoilerFileName); } } void Context::ParseHashIconIndexesJson(const nlohmann::json& spoilerFileJson) { diff --git a/soh/soh/Enhancements/randomizer/ShuffleFairies.cpp b/soh/soh/Enhancements/randomizer/ShuffleFairies.cpp index 487b02602a..143c902379 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleFairies.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleFairies.cpp @@ -1,3 +1,5 @@ +#include + #include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "randomizer_grotto.h" @@ -6,6 +8,7 @@ #include "soh/Enhancements/item-tables/ItemTableTypes.h" #include "soh/ObjectExtension/ObjectExtension.h" #include "soh/Enhancements/randomizer/randomizer.h" +#include "soh/Enhancements/randomizer/randomizerEnumStrings.h" extern "C" { #include "src/overlays/actors/ovl_En_Elf/z_en_elf.h" @@ -67,7 +70,7 @@ CheckIdentity ShuffleFairies_GetFairyIdentity(int32_t params, ActorID id) { Rando::Location* location = OTRGlobals::Instance->gRandomizer->GetCheckObjectFromActor(id, sceneNum, params); if (location->GetRandomizerCheck() == RC_UNKNOWN_CHECK) { - LUSLOG_WARN("FairyGetIdentity did not receive a valid RC value (%d).", location->GetRandomizerCheck()); + SPDLOG_WARN("FairyGetIdentity did not receive a valid RC value ({}).", location->GetRandomizerCheck()); assert(false); } else { fairyIdentity.randomizerInf = static_cast(location->GetCollectionCheck().flag); diff --git a/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp b/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp index c0e0ce5e4f..d5317ff196 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp @@ -147,8 +147,6 @@ uint8_t Rock_RandomizerHoldsItem(CheckIdentity rockIdentity, PlayState* play, bo } void Rock_RandomizerSpawnCollectible(Actor* actor, CheckIdentity rockIdentity, PlayState* play) { - LUSLOG_INFO("ROCKdrop %d\t:\t%d, %d", rockIdentity.randomizerCheck, (s16)actor->world.pos.x, - (s16)actor->world.pos.z); EnItem00* item00 = (EnItem00*)Item_DropCollectible2(play, &actor->world.pos, ITEM00_SOH_DUMMY); item00->randoInf = rockIdentity.randomizerInf; item00->itemEntry = Rando::Context::GetInstance()->GetFinalGIEntry(rockIdentity.randomizerCheck, true, GI_NONE); @@ -217,9 +215,7 @@ static CheckIdentity IdentifyRock(s32 sceneNum, s32 posX, s32 posZ) { Rando::Location* location = OTRGlobals::Instance->gRandomizer->GetCheckObjectFromActor( ACTOR_EN_ISHI, sceneNum, TWO_ACTOR_PARAMS(posX, posZ)); - if (!IdentifyCheck(&rockIdentity, location)) { - SPDLOG_WARN("IdentifyRock did not receive a valid RC value %d,%d.", posX, posZ); - } + IdentifyCheck(&rockIdentity, location); return rockIdentity; } @@ -228,13 +224,6 @@ void EnIshi_RandomizerInit(void* actorRef) { Actor* actor = static_cast(actorRef); EnIshi* rockActor = static_cast(actorRef); auto rockIdentity = IdentifyRock(gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); - if (rockIdentity.randomizerCheck == RC_MAX) { - LUSLOG_WARN("ROCK ishi %d\t:\t%d, %d", rockIdentity.randomizerCheck, actor->params & 1, - (s16)actor->world.pos.x, (s16)actor->world.pos.z); - } else { - LUSLOG_INFO("ROCK ishi%d %d\t:\t%d, %d", rockIdentity.randomizerCheck, actor->params & 1, - (s16)actor->world.pos.x, (s16)actor->world.pos.z); - } if (Rock_RandomizerHoldsItem(rockIdentity, gPlayState, actor->params & 1) && rockActor->actor.draw != nullptr) { ObjectExtension::GetInstance().Set(actor, std::move(rockIdentity)); @@ -246,13 +235,7 @@ void ObjBombiwa_RandomizerInit(void* actorRef) { Actor* actor = static_cast(actorRef); ObjBombiwa* rockActor = static_cast(actorRef); auto rockIdentity = IdentifyRock(gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); - if (rockIdentity.randomizerCheck == RC_MAX) { - LUSLOG_INFO("ROCK bombiwa\t:\t%d, %d", rockIdentity.randomizerCheck, (s16)actor->world.pos.x, - (s16)actor->world.pos.z); - } else { - LUSLOG_INFO("ROCK bombiwa%d\t:\t%d, %d", rockIdentity.randomizerCheck, (s16)actor->world.pos.x, - (s16)actor->world.pos.z); - } + if (Rock_RandomizerHoldsItem(rockIdentity, gPlayState, true) && rockActor->actor.draw != nullptr) { ObjectExtension::GetInstance().Set(actor, std::move(rockIdentity)); rockActor->actor.draw = ObjBombiwa_RandomizerDraw; @@ -263,13 +246,7 @@ void ObjHamishi_RandomizerInit(void* actorRef) { Actor* actor = static_cast(actorRef); ObjHamishi* rockActor = static_cast(actorRef); auto rockIdentity = IdentifyRock(gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); - if (rockIdentity.randomizerCheck == RC_MAX) { - LUSLOG_WARN("ROCK hamishi\t:\t%d, %d", rockIdentity.randomizerCheck, (s16)actor->world.pos.x, - (s16)actor->world.pos.z); - } else { - LUSLOG_INFO("ROCK hamishi%d\t:\t%d, %d", rockIdentity.randomizerCheck, (s16)actor->world.pos.x, - (s16)actor->world.pos.z); - } + if (Rock_RandomizerHoldsItem(rockIdentity, gPlayState, true) && rockActor->actor.draw != nullptr) { ObjectExtension::GetInstance().Set(actor, std::move(rockIdentity)); rockActor->actor.draw = ObjHamishi_RandomizerDraw; diff --git a/soh/soh/Enhancements/randomizer/location_access.cpp b/soh/soh/Enhancements/randomizer/location_access.cpp index 6d2f177a5b..45e3061076 100644 --- a/soh/soh/Enhancements/randomizer/location_access.cpp +++ b/soh/soh/Enhancements/randomizer/location_access.cpp @@ -6,7 +6,7 @@ #include "soh/Enhancements/debugger/performanceTimer.h" #include -#include +#include #include #include "3drando/shops.hpp" @@ -498,8 +498,8 @@ Rando::Entrance* Region::GetExit(RandomizerRegion exitToReturn) { } } - LUSLOG_ERROR("ERROR: EXIT \"%s\" DOES NOT EXIST IN \"%s\"", RegionTable(exitToReturn)->regionName.c_str(), - this->regionName.c_str()); + SPDLOG_ERROR("ERROR: EXIT \"{}\" DOES NOT EXIST IN \"{}\"", RegionTable(exitToReturn)->regionName, + this->regionName); assert(false); return nullptr; } diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index d882f415e4..d5b538819d 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -5,6 +5,7 @@ #include #include +#include #include "randomizer.h" #include "3drando/menu.hpp" @@ -17,6 +18,7 @@ #include "settings.h" #include "soh/util.h" #include "randomizerTypes.h" +#include "randomizerEnumStrings.h" #include "soh/ObjectExtension/ObjectExtension.h" #include "soh/Enhancements/randomizer/RCToRandInf.h" #include "dungeon.h" @@ -1139,8 +1141,8 @@ static bool ChildTradeSlotOccupied() { extern "C" u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) { if (giEntry.modIndex != MOD_RANDOMIZER) { - LUSLOG_WARN( - "Randomizer_Item_Give was called with a GetItemEntry with a mod index different from MOD_RANDOMIZER (%d)", + SPDLOG_WARN( + "Randomizer_Item_Give was called with a GetItemEntry with a mod index different from MOD_RANDOMIZER ({})", giEntry.modIndex); assert(false); return -1; @@ -1456,7 +1458,7 @@ extern "C" u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) { break; } default: - LUSLOG_WARN("Randomizer_Item_Give didn't have behaviour specified for getItemId=%d", item); + SPDLOG_WARN("Randomizer_Item_Give didn't have behaviour specified for getItemId={}", item); assert(false); return -1; } diff --git a/soh/soh/Enhancements/speechsynthesizer/ESpeakSpeechSynthesizer.cpp b/soh/soh/Enhancements/speechsynthesizer/ESpeakSpeechSynthesizer.cpp index 83b048aade..c5af34eb60 100644 --- a/soh/soh/Enhancements/speechsynthesizer/ESpeakSpeechSynthesizer.cpp +++ b/soh/soh/Enhancements/speechsynthesizer/ESpeakSpeechSynthesizer.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include "ESpeakSpeechSynthesizer.h" @@ -16,7 +16,7 @@ bool ESpeakSpeechSynthesizer::DoInit() { this->Terminate = (speak_Terminate)dlsym(espeak, "espeak_Terminate"); if (this->Initialize == NULL || this->SetVoiceByProperties == NULL || this->Synth == NULL || this->Terminate == NULL) { - lusprintf(__FILE__, __LINE__, 2, "Failed to load espeak-ng"); + SPDLOG_INFO("Failed to load espeak-ng"); dlclose(espeak); return false; } else { @@ -37,7 +37,7 @@ void ESpeakSpeechSynthesizer::DoUninitialize() { void ESpeakSpeechSynthesizer::Speak(const char* text, const char* language) { if (this->espeak == NULL) { - lusprintf(__FILE__, __LINE__, 2, "Spoken Text (%s): %s", language, text); + SPDLOG_INFO("Spoken Text ({}): {}", language, text); } else { if (language != this->mLanguage) { espeak_VOICE voice = { .languages = language }; diff --git a/soh/soh/Enhancements/speechsynthesizer/SpeechLogger.cpp b/soh/soh/Enhancements/speechsynthesizer/SpeechLogger.cpp index e525dba019..03c73188a3 100644 --- a/soh/soh/Enhancements/speechsynthesizer/SpeechLogger.cpp +++ b/soh/soh/Enhancements/speechsynthesizer/SpeechLogger.cpp @@ -1,4 +1,4 @@ -#include +#include #include "SpeechLogger.h" @@ -6,7 +6,7 @@ SpeechLogger::SpeechLogger() { } void SpeechLogger::Speak(const char* text, const char* language) { - lusprintf(__FILE__, __LINE__, 2, "Spoken Text (%s): %s", language, text); + SPDLOG_INFO("Spoken Text ({}): {}", language, text); } bool SpeechLogger::DoInit() { diff --git a/soh/soh/z_play_otr.cpp b/soh/soh/z_play_otr.cpp index a9537cea22..78c637b7d3 100644 --- a/soh/soh/z_play_otr.cpp +++ b/soh/soh/z_play_otr.cpp @@ -48,8 +48,7 @@ extern "C" void OTRPlay_SpawnScene(PlayState* play, s32 sceneId, s32 spawn) { // Failed to load scene... default to doodongs cavern if (play->sceneSegment == nullptr) { - lusprintf(__FILE__, __LINE__, 2, "Unable to load scene %s... Defaulting to Doodong's Cavern!\n", - scenePath.c_str()); + SPDLOG_INFO("Unable to load scene {}... Defaulting to Doodong's Cavern!", scenePath); OTRPlay_SpawnScene(play, 0x01, 0); return; }