diff --git a/libultraship b/libultraship index 1d98291404..2c63e7edef 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 1d9829140444268827a1369095bcc93518ff3b4d +Subproject commit 2c63e7edef577cd2a3726ce24dfedd7f088f12ae diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index e7a03b8f24..16da97afad 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -421,6 +421,7 @@ if(MSVC) /Gy; > /W3; + /WX; /bigobj; /sdl-; /permissive-; @@ -443,6 +444,7 @@ if(MSVC) /MP; /sdl-; /W3; + /WX; ${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT}; ${DEFAULT_CXX_EXCEPTION_HANDLING} ) diff --git a/soh/soh/CrashHandlerExt.cpp b/soh/soh/CrashHandlerExt.cpp index 68e5893596..f5277a9e8a 100644 --- a/soh/soh/CrashHandlerExt.cpp +++ b/soh/soh/CrashHandlerExt.cpp @@ -41,7 +41,6 @@ static void append_line(char* buf, size_t* len, const char* str) { } static void CrashHandler_WriteActorData(char* buffer, size_t* pos) { - char intCharBuffer[16]; for (unsigned int i = 0; i < ACTORCAT_MAX; i++) { ActorListEntry* entry = &gPlayState->actorCtx.actorLists[i]; diff --git a/soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp b/soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp index 1ec49e0afe..582e4d4240 100644 --- a/soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp +++ b/soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp @@ -44,71 +44,71 @@ typedef struct EnemyEntry { // clang-format off static EnemyEntry randomizedEnemySpawnTable[] = { - { CVAR_ENHANCEMENT("RandomizedEnemyList.Anubis"), "Anubis", ACTOR_EN_ANUBICE_TAG, 1 }, // Anubis - { CVAR_ENHANCEMENT("RandomizedEnemyList.Armos"), "Armos", ACTOR_EN_AM, -1 }, // Armos - { CVAR_ENHANCEMENT("RandomizedEnemyList.Arwing"), "Arwing", ACTOR_EN_CLEAR_TAG, 1 }, // Arwing - { CVAR_ENHANCEMENT("RandomizedEnemyList.BabyDodongo"), "Baby Dodongo", ACTOR_EN_DODOJR, 0 }, // Baby Dodongo - { CVAR_ENHANCEMENT("RandomizedEnemyList.Bari"), "Bari", ACTOR_EN_VALI, -1 }, // Bari (big jellyfish) - { CVAR_ENHANCEMENT("RandomizedEnemyList.Beamos"), "Beamos", ACTOR_EN_VM, 1280 }, // Beamos - { CVAR_ENHANCEMENT("RandomizedEnemyList.BigSkulltula"), "Big Skulltula", ACTOR_EN_ST, 1 }, // Skulltula (big) - { CVAR_ENHANCEMENT("RandomizedEnemyList.BigStalchild"), "Stalchild (Big)", ACTOR_EN_SKB, 20 }, // Stalchild (big) - { CVAR_ENHANCEMENT("RandomizedEnemyList.Biri"), "Biri", ACTOR_EN_BILI, 0 }, // Biri (jellyfish) - { CVAR_ENHANCEMENT("RandomizedEnemyList.BlackKnuckle"), "Iron Knuckle (Black)", ACTOR_EN_IK, 2 }, // Iron Knuckle (black, standing) - { CVAR_ENHANCEMENT("RandomizedEnemyList.BlueTektite"), "Blue Tektite", ACTOR_EN_TITE, -2 }, // Tektite (blue) - { CVAR_ENHANCEMENT("RandomizedEnemyList.Bubble"), "Bubble", ACTOR_EN_BB, -1 }, // Bubble (flying skull enemy) (blue) - { CVAR_ENHANCEMENT("RandomizedEnemyList.ClubMoblin"), "Club Moblin", ACTOR_EN_MB, 0 }, // Club Moblin - { CVAR_ENHANCEMENT("RandomizedEnemyList.DarkLink"), "Dark Link", ACTOR_EN_TORCH2, 0 }, // Dark Link - { CVAR_ENHANCEMENT("RandomizedEnemyList.Dinolfos"), "Dinolfos", ACTOR_EN_ZF, -2 }, // Dinolfos - { CVAR_ENHANCEMENT("RandomizedEnemyList.Dodongo"), "Dodongo", ACTOR_EN_DODONGO, -1 }, // Dodongo - { CVAR_ENHANCEMENT("RandomizedEnemyList.FireKeese"), "Fire Keese", ACTOR_EN_FIREFLY, 1 }, // Fire Keese - // { CVAR_ENHANCEMENT("RandomizedEnemyList.FlareDancer"), "Flare Dancer", ACTOR_EN_FD, 0 }, // Flare Dancer (possible cause of crashes because of spawning flame actors on sloped ground or overloading) - { CVAR_ENHANCEMENT("RandomizedEnemyList.FloorTile"), "Floor Tile", ACTOR_EN_YUKABYUN, 0 }, // Flying Floor Tile - { CVAR_ENHANCEMENT("RandomizedEnemyList.Floormaster"), "Floormaster", ACTOR_EN_FLOORMAS, 0 }, // Floormaster - { CVAR_ENHANCEMENT("RandomizedEnemyList.FlyingPeahat"), "Flying Peahat", ACTOR_EN_PEEHAT, -1 }, // Flying Peahat (big grounded, doesn't spawn larva) - { CVAR_ENHANCEMENT("RandomizedEnemyList.FlyingPot"), "Flying Pot", ACTOR_EN_TUBO_TRAP, 0 }, // Flying pot - { CVAR_ENHANCEMENT("RandomizedEnemyList.Freezard"), "Freezard", ACTOR_EN_FZ, 0 }, // Freezard - { CVAR_ENHANCEMENT("RandomizedEnemyList.GerudoFighter"), "Gerudo Fighter", ACTOR_EN_GELDB, 0 }, // Gerudo Fighter - { CVAR_ENHANCEMENT("RandomizedEnemyList.Gibdo"), "Gibdo", ACTOR_EN_RD, 32766 }, // Gibdo (standing) - { CVAR_ENHANCEMENT("RandomizedEnemyList.GohmaLarva"), "Gohma Larva", ACTOR_EN_GOMA, 7 }, // Gohma Larva (Non-Gohma rooms) - { CVAR_ENHANCEMENT("RandomizedEnemyList.Guay"), "Guay", ACTOR_EN_CROW, 0 }, // Guay - { CVAR_ENHANCEMENT("RandomizedEnemyList.IceKeese"), "Ice Keese", ACTOR_EN_FIREFLY, 4 }, // Ice Keese - { CVAR_ENHANCEMENT("RandomizedEnemyList.InvisFireKeese"), "Invisible Fire Keese", ACTOR_EN_FIREFLY, 0x8001 }, // Fire Keese (invisible) - { CVAR_ENHANCEMENT("RandomizedEnemyList.InvisFloormaster"), "Invisible Floormaster", ACTOR_EN_FLOORMAS, 0x8000 }, // Floormaster (invisible) - { CVAR_ENHANCEMENT("RandomizedEnemyList.InvisIceKeese"), "Invisible Ice Keese", ACTOR_EN_FIREFLY, 0x8004 }, // Ice Keese (invisible) - { CVAR_ENHANCEMENT("RandomizedEnemyList.InvisKeese"), "Invisible Keese", ACTOR_EN_FIREFLY, 0x8002 }, // Keese (invisible) - { CVAR_ENHANCEMENT("RandomizedEnemyList.InvisRedead"), "Invisible Redead", ACTOR_EN_RD, 3 }, // Redead (invisible) - { CVAR_ENHANCEMENT("RandomizedEnemyList.InvisSkulltula"), "Invisible Skulltula", ACTOR_EN_ST, 2 }, // Skulltula (invisible) - { CVAR_ENHANCEMENT("RandomizedEnemyList.InvisStalfos"), "Invisible Stalfos", ACTOR_EN_TEST, 0 }, // Stalfos (invisible) - { CVAR_ENHANCEMENT("RandomizedEnemyList.Keese"), "Keese", ACTOR_EN_FIREFLY, 2 }, // Regular Keese - { CVAR_ENHANCEMENT("RandomizedEnemyList.LargeBaba"), "Large Deku Baba", ACTOR_EN_DEKUBABA, 1 }, // Deku Baba (large) - // { CVAR_ENHANCEMENT("RandomizedEnemyList.Leever"), "Leever", ACTOR_EN_REEBA, 0 }, // Leever Doesn't work (reliant on surface, without a spawner it kills itself too quickly) - { CVAR_ENHANCEMENT("RandomizedEnemyList.LikeLike"), "Like-Like", ACTOR_EN_RR, 0 }, // Like-Like - { CVAR_ENHANCEMENT("RandomizedEnemyList.Lizalfos"), "Lizalfos", ACTOR_EN_ZF, -1 }, // Lizalfos - { CVAR_ENHANCEMENT("RandomizedEnemyList.MadScrub"), "Mad Scrub", ACTOR_EN_DEKUNUTS, 768 }, // Mad Scrub (triple attack) (projectiles don't work) - { CVAR_ENHANCEMENT("RandomizedEnemyList.NormalWolfos"), "Wolfos (Normal)", ACTOR_EN_WF, 0 }, // Wolfos (normal) - // { CVAR_ENHANCEMENT("RandomizedEnemyList.Octorok"), "Octorok", ACTOR_EN_OKUTA, 0 }, // Octorok Doesn't work (actor directly uses water box collision to handle hiding/popping up) - { CVAR_ENHANCEMENT("RandomizedEnemyList.PeahatLarva"), "Peahat Larva", ACTOR_EN_PEEHAT, 1 }, // Flying Peahat Larva - // { CVAR_ENHANCEMENT("RandomizedEnemyList.Poe"), "Poe", ACTOR_EN_POH, 0 }, // Poe Doesn't work (Seems to rely on other objects?) - // { CVAR_ENHANCEMENT("RandomizedEnemyList.Poe.Sharp"), "Poe (Sharp)", ACTOR_EN_POH, 2 }, // Poe (composer Sharp) Doesn't work (Seems to rely on other objects?) - // { CVAR_ENHANCEMENT("RandomizedEnemyList.Poe.Flat"), "Poe (Flat)", ACTOR_EN_POH, 3 }, // Poe (composer Flat) Doesn't work (Seems to rely on other objects?) - { CVAR_ENHANCEMENT("RandomizedEnemyList.Redead"), "Redead", ACTOR_EN_RD, 1 }, // Redead (standing) - { CVAR_ENHANCEMENT("RandomizedEnemyList.RedTektite"), "Red Tektite", ACTOR_EN_TITE, -1 }, // Tektite (red) - { CVAR_ENHANCEMENT("RandomizedEnemyList.Shabom"), "Shabom", ACTOR_EN_BUBBLE, 0 }, // Shabom (bubble) - { CVAR_ENHANCEMENT("RandomizedEnemyList.ShellBlade"), "Shell Blade", ACTOR_EN_SB, 0 }, // Shell Blade - { CVAR_ENHANCEMENT("RandomizedEnemyList.Skulltula"), "Skulltula", ACTOR_EN_ST, 0 }, // Skulltula (normal) - { CVAR_ENHANCEMENT("RandomizedEnemyList.SkullKid"), "Skull Kid", ACTOR_EN_SKJ, 4159 }, // Skull Kid - { CVAR_ENHANCEMENT("RandomizedEnemyList.SmallBaba"), "Small Deku Baba", ACTOR_EN_DEKUBABA, 0 }, // Deku Baba (small) - { CVAR_ENHANCEMENT("RandomizedEnemyList.SmallStalchild"), "Stalchild (Small)", ACTOR_EN_SKB, 1 }, // Stalchild (small) - { CVAR_ENHANCEMENT("RandomizedEnemyList.SpearMoblin"), "Spear Moblin", ACTOR_EN_MB, -1 }, // Spear Moblin - { CVAR_ENHANCEMENT("RandomizedEnemyList.Spike"), "Spike", ACTOR_EN_NY, 0 }, // Spike (rolling enemy) - { CVAR_ENHANCEMENT("RandomizedEnemyList.Stalfos"), "Stalfos", ACTOR_EN_TEST, 2 }, // Stalfos - { CVAR_ENHANCEMENT("RandomizedEnemyList.Stinger"), "Stinger", ACTOR_EN_EIYER, 10 }, // Stinger (land) (One in formation, sink under floor and do not activate) - { CVAR_ENHANCEMENT("RandomizedEnemyList.Tailparasan"), "Tailpasaran", ACTOR_EN_TP, -1 }, // Electric Tailpasaran - { CVAR_ENHANCEMENT("RandomizedEnemyList.TorchSlug"), "Torch Slug", ACTOR_EN_BW, 0 }, // Torch Slug - { CVAR_ENHANCEMENT("RandomizedEnemyList.Wallmaster"), "Wallmaster", ACTOR_EN_WALLMAS, 1 }, // Wallmaster - { CVAR_ENHANCEMENT("RandomizedEnemyList.WhiteKnuckle"), "Iron Knuckle (White)", ACTOR_EN_IK, 3 }, // Iron Knuckle (white, standing) - { CVAR_ENHANCEMENT("RandomizedEnemyList.WhiteWolfos"), "Wolfos (White)", ACTOR_EN_WF, 1 }, // Wolfos (white) - { CVAR_ENHANCEMENT("RandomizedEnemyList.WitheredBaba"), "Withered Deku Baba", ACTOR_EN_KAREBABA, 0 }, // Withered Deku Baba + { CVAR_ENHANCEMENT("RandomizedEnemyList.Anubis"), "Anubis", ACTOR_EN_ANUBICE_TAG, 1 }, // Anubis + { CVAR_ENHANCEMENT("RandomizedEnemyList.Armos"), "Armos", ACTOR_EN_AM, -1 }, // Armos + { CVAR_ENHANCEMENT("RandomizedEnemyList.Arwing"), "Arwing", ACTOR_EN_CLEAR_TAG, 1 }, // Arwing + { CVAR_ENHANCEMENT("RandomizedEnemyList.BabyDodongo"), "Baby Dodongo", ACTOR_EN_DODOJR, 0 }, // Baby Dodongo + { CVAR_ENHANCEMENT("RandomizedEnemyList.Bari"), "Bari", ACTOR_EN_VALI, -1 }, // Bari (big jellyfish) + { CVAR_ENHANCEMENT("RandomizedEnemyList.Beamos"), "Beamos", ACTOR_EN_VM, 1280 }, // Beamos + { CVAR_ENHANCEMENT("RandomizedEnemyList.BigSkulltula"), "Big Skulltula", ACTOR_EN_ST, 1 }, // Skulltula (big) + { CVAR_ENHANCEMENT("RandomizedEnemyList.BigStalchild"), "Stalchild (Big)", ACTOR_EN_SKB, 20 }, // Stalchild (big) + { CVAR_ENHANCEMENT("RandomizedEnemyList.Biri"), "Biri", ACTOR_EN_BILI, 0 }, // Biri (jellyfish) + { CVAR_ENHANCEMENT("RandomizedEnemyList.BlackKnuckle"), "Iron Knuckle (Black)", ACTOR_EN_IK, 2 }, // Iron Knuckle (black, standing) + { CVAR_ENHANCEMENT("RandomizedEnemyList.BlueTektite"), "Blue Tektite", ACTOR_EN_TITE, -2 }, // Tektite (blue) + { CVAR_ENHANCEMENT("RandomizedEnemyList.Bubble"), "Bubble", ACTOR_EN_BB, -1 }, // Bubble (flying skull enemy) (blue) + { CVAR_ENHANCEMENT("RandomizedEnemyList.ClubMoblin"), "Club Moblin", ACTOR_EN_MB, 0 }, // Club Moblin + { CVAR_ENHANCEMENT("RandomizedEnemyList.DarkLink"), "Dark Link", ACTOR_EN_TORCH2, 0 }, // Dark Link + { CVAR_ENHANCEMENT("RandomizedEnemyList.Dinolfos"), "Dinolfos", ACTOR_EN_ZF, -2 }, // Dinolfos + { CVAR_ENHANCEMENT("RandomizedEnemyList.Dodongo"), "Dodongo", ACTOR_EN_DODONGO, -1 }, // Dodongo + { CVAR_ENHANCEMENT("RandomizedEnemyList.FireKeese"), "Fire Keese", ACTOR_EN_FIREFLY, 1 }, // Fire Keese + // { CVAR_ENHANCEMENT("RandomizedEnemyList.FlareDancer"), "Flare Dancer", ACTOR_EN_FD, 0 }, // Flare Dancer (possible cause of crashes because of spawning flame actors on sloped ground or overloading) + { CVAR_ENHANCEMENT("RandomizedEnemyList.FloorTile"), "Floor Tile", ACTOR_EN_YUKABYUN, 0 }, // Flying Floor Tile + { CVAR_ENHANCEMENT("RandomizedEnemyList.Floormaster"), "Floormaster", ACTOR_EN_FLOORMAS, 0 }, // Floormaster + { CVAR_ENHANCEMENT("RandomizedEnemyList.FlyingPeahat"), "Flying Peahat", ACTOR_EN_PEEHAT, -1 }, // Flying Peahat (big grounded, doesn't spawn larva) + { CVAR_ENHANCEMENT("RandomizedEnemyList.FlyingPot"), "Flying Pot", ACTOR_EN_TUBO_TRAP, 0 }, // Flying pot + { CVAR_ENHANCEMENT("RandomizedEnemyList.Freezard"), "Freezard", ACTOR_EN_FZ, 0 }, // Freezard + { CVAR_ENHANCEMENT("RandomizedEnemyList.GerudoFighter"), "Gerudo Fighter", ACTOR_EN_GELDB, 0 }, // Gerudo Fighter + { CVAR_ENHANCEMENT("RandomizedEnemyList.Gibdo"), "Gibdo", ACTOR_EN_RD, 32766 }, // Gibdo (standing) + { CVAR_ENHANCEMENT("RandomizedEnemyList.GohmaLarva"), "Gohma Larva", ACTOR_EN_GOMA, 7 }, // Gohma Larva (Non-Gohma rooms) + { CVAR_ENHANCEMENT("RandomizedEnemyList.Guay"), "Guay", ACTOR_EN_CROW, 0 }, // Guay + { CVAR_ENHANCEMENT("RandomizedEnemyList.IceKeese"), "Ice Keese", ACTOR_EN_FIREFLY, 4 }, // Ice Keese + { CVAR_ENHANCEMENT("RandomizedEnemyList.InvisFireKeese"), "Invisible Fire Keese", ACTOR_EN_FIREFLY, static_cast(0x8001) }, // Fire Keese (invisible) + { CVAR_ENHANCEMENT("RandomizedEnemyList.InvisFloormaster"), "Invisible Floormaster", ACTOR_EN_FLOORMAS, static_cast(0x8000) }, // Floormaster (invisible) + { CVAR_ENHANCEMENT("RandomizedEnemyList.InvisIceKeese"), "Invisible Ice Keese", ACTOR_EN_FIREFLY, static_cast(0x8004) }, // Ice Keese (invisible) + { CVAR_ENHANCEMENT("RandomizedEnemyList.InvisKeese"), "Invisible Keese", ACTOR_EN_FIREFLY, static_cast(0x8002) }, // Keese (invisible) + { CVAR_ENHANCEMENT("RandomizedEnemyList.InvisRedead"), "Invisible Redead", ACTOR_EN_RD, 3 }, // Redead (invisible) + { CVAR_ENHANCEMENT("RandomizedEnemyList.InvisSkulltula"), "Invisible Skulltula", ACTOR_EN_ST, 2 }, // Skulltula (invisible) + { CVAR_ENHANCEMENT("RandomizedEnemyList.InvisStalfos"), "Invisible Stalfos", ACTOR_EN_TEST, 0 }, // Stalfos (invisible) + { CVAR_ENHANCEMENT("RandomizedEnemyList.Keese"), "Keese", ACTOR_EN_FIREFLY, 2 }, // Regular Keese + { CVAR_ENHANCEMENT("RandomizedEnemyList.LargeBaba"), "Large Deku Baba", ACTOR_EN_DEKUBABA, 1 }, // Deku Baba (large) + // { CVAR_ENHANCEMENT("RandomizedEnemyList.Leever"), "Leever", ACTOR_EN_REEBA, 0 }, // Leever Doesn't work (reliant on surface, without a spawner it kills itself too quickly) + { CVAR_ENHANCEMENT("RandomizedEnemyList.LikeLike"), "Like-Like", ACTOR_EN_RR, 0 }, // Like-Like + { CVAR_ENHANCEMENT("RandomizedEnemyList.Lizalfos"), "Lizalfos", ACTOR_EN_ZF, -1 }, // Lizalfos + { CVAR_ENHANCEMENT("RandomizedEnemyList.MadScrub"), "Mad Scrub", ACTOR_EN_DEKUNUTS, 768 }, // Mad Scrub (triple attack) (projectiles don't work) + { CVAR_ENHANCEMENT("RandomizedEnemyList.NormalWolfos"), "Wolfos (Normal)", ACTOR_EN_WF, 0 }, // Wolfos (normal) + // { CVAR_ENHANCEMENT("RandomizedEnemyList.Octorok"), "Octorok", ACTOR_EN_OKUTA, 0 }, // Octorok Doesn't work (actor directly uses water box collision to handle hiding/popping up) + { CVAR_ENHANCEMENT("RandomizedEnemyList.PeahatLarva"), "Peahat Larva", ACTOR_EN_PEEHAT, 1 }, // Flying Peahat Larva + // { CVAR_ENHANCEMENT("RandomizedEnemyList.Poe"), "Poe", ACTOR_EN_POH, 0 }, // Poe Doesn't work (Seems to rely on other objects?) + // { CVAR_ENHANCEMENT("RandomizedEnemyList.Poe.Sharp"), "Poe (Sharp)", ACTOR_EN_POH, 2 }, // Poe (composer Sharp) Doesn't work (Seems to rely on other objects?) + // { CVAR_ENHANCEMENT("RandomizedEnemyList.Poe.Flat"), "Poe (Flat)", ACTOR_EN_POH, 3 }, // Poe (composer Flat) Doesn't work (Seems to rely on other objects?) + { CVAR_ENHANCEMENT("RandomizedEnemyList.Redead"), "Redead", ACTOR_EN_RD, 1 }, // Redead (standing) + { CVAR_ENHANCEMENT("RandomizedEnemyList.RedTektite"), "Red Tektite", ACTOR_EN_TITE, -1 }, // Tektite (red) + { CVAR_ENHANCEMENT("RandomizedEnemyList.Shabom"), "Shabom", ACTOR_EN_BUBBLE, 0 }, // Shabom (bubble) + { CVAR_ENHANCEMENT("RandomizedEnemyList.ShellBlade"), "Shell Blade", ACTOR_EN_SB, 0 }, // Shell Blade + { CVAR_ENHANCEMENT("RandomizedEnemyList.Skulltula"), "Skulltula", ACTOR_EN_ST, 0 }, // Skulltula (normal) + { CVAR_ENHANCEMENT("RandomizedEnemyList.SkullKid"), "Skull Kid", ACTOR_EN_SKJ, 4159 }, // Skull Kid + { CVAR_ENHANCEMENT("RandomizedEnemyList.SmallBaba"), "Small Deku Baba", ACTOR_EN_DEKUBABA, 0 }, // Deku Baba (small) + { CVAR_ENHANCEMENT("RandomizedEnemyList.SmallStalchild"), "Stalchild (Small)", ACTOR_EN_SKB, 1 }, // Stalchild (small) + { CVAR_ENHANCEMENT("RandomizedEnemyList.SpearMoblin"), "Spear Moblin", ACTOR_EN_MB, -1 }, // Spear Moblin + { CVAR_ENHANCEMENT("RandomizedEnemyList.Spike"), "Spike", ACTOR_EN_NY, 0 }, // Spike (rolling enemy) + { CVAR_ENHANCEMENT("RandomizedEnemyList.Stalfos"), "Stalfos", ACTOR_EN_TEST, 2 }, // Stalfos + { CVAR_ENHANCEMENT("RandomizedEnemyList.Stinger"), "Stinger", ACTOR_EN_EIYER, 10 }, // Stinger (land) (One in formation, sink under floor and do not activate) + { CVAR_ENHANCEMENT("RandomizedEnemyList.Tailparasan"), "Tailpasaran", ACTOR_EN_TP, -1 }, // Electric Tailpasaran + { CVAR_ENHANCEMENT("RandomizedEnemyList.TorchSlug"), "Torch Slug", ACTOR_EN_BW, 0 }, // Torch Slug + { CVAR_ENHANCEMENT("RandomizedEnemyList.Wallmaster"), "Wallmaster", ACTOR_EN_WALLMAS, 1 }, // Wallmaster + { CVAR_ENHANCEMENT("RandomizedEnemyList.WhiteKnuckle"), "Iron Knuckle (White)", ACTOR_EN_IK, 3 }, // Iron Knuckle (white, standing) + { CVAR_ENHANCEMENT("RandomizedEnemyList.WhiteWolfos"), "Wolfos (White)", ACTOR_EN_WF, 1 }, // Wolfos (white) + { CVAR_ENHANCEMENT("RandomizedEnemyList.WitheredBaba"), "Withered Deku Baba", ACTOR_EN_KAREBABA, 0 }, // Withered Deku Baba }; // clang-format on @@ -534,7 +534,7 @@ static u8 GetRandomizedEnemy(PlayState* play, s16* actorId, s16* posX, s16* posY f32 raycastResult; pos.x = *posX; - pos.y = *posY + 50; + pos.y = static_cast(*posY + 50); pos.z = *posZ; // the forest temple second twisted hallway spawns after the enemies so we need to "find the floor" manually @@ -543,13 +543,13 @@ static u8 GetRandomizedEnemy(PlayState* play, s16* actorId, s16* posX, s16* posY // the other at 1239.094 but that changes based on the player position // when not twisted, the whole floor is at 1228 - *posY = 1228.0; + *posY = 1228; } else { raycastResult = BgCheck_AnyRaycastFloor1(&play->colCtx, &poly, &pos); // If ground is found below actor, move actor to that height. if (raycastResult > BGCHECK_Y_MIN) { - *posY = raycastResult; + *posY = static_cast(raycastResult); } } @@ -772,11 +772,13 @@ void RegisterEnemyRandomizer() { double posZ = va_arg(args, double); s16 actorId = ACTOR_EN_TEST; - s16 posX2 = posX; - s16 posY2 = posY; - s16 posZ2 = posZ; + s16 posX2 = static_cast(posX); + s16 posY2 = static_cast(posY); + s16 posZ2 = static_cast(posZ); s16 rotX = 0; - s16 rotY = Math_FAtan2F(playerPos->x - posX, playerPos->z - posZ) * (0x8000 / M_PI); + s16 rotY = static_cast( + Math_FAtan2F(playerPos->x - static_cast(posX), playerPos->z - static_cast(posZ)) * + static_cast(0x8000 / M_PI)); s16 rotZ = 0; s16 params = 5; @@ -798,9 +800,9 @@ void RegisterEnemyRandomizer() { PlayState* play = va_arg(args, PlayState*); s16 actorId = ACTOR_EN_TORCH2; - s16 posX = blkobj->dyna.actor.world.pos.x; - s16 posY = blkobj->dyna.actor.world.pos.y; - s16 posZ = blkobj->dyna.actor.world.pos.z; + s16 posX = static_cast(blkobj->dyna.actor.world.pos.x); + s16 posY = static_cast(blkobj->dyna.actor.world.pos.y); + s16 posZ = static_cast(blkobj->dyna.actor.world.pos.z); s16 rotX = 0; s16 rotY = blkobj->dyna.actor.yawTowardsPlayer; s16 rotZ = 0; @@ -810,7 +812,8 @@ void RegisterEnemyRandomizer() { assert(false); } - Actor_Spawn(&play->actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params); + Actor_Spawn(&play->actorCtx, play, actorId, static_cast(posX), static_cast(posY), + static_cast(posZ), rotX, rotY, rotZ, params); EnBlkobj_SetupAction(blkobj, EnBlkobj_DarkLinkFight); @@ -822,9 +825,9 @@ void RegisterEnemyRandomizer() { PlayState* play = va_arg(args, PlayState*); s16 actorId = ACTOR_EN_FIREFLY; - s16 posX = hakaTubo->dyna.actor.world.pos.x; - s16 posY = hakaTubo->dyna.actor.world.pos.y + 80.0f; - s16 posZ = hakaTubo->dyna.actor.world.pos.z; + s16 posX = static_cast(hakaTubo->dyna.actor.world.pos.x); + s16 posY = static_cast(hakaTubo->dyna.actor.world.pos.y) + 80; + s16 posZ = static_cast(hakaTubo->dyna.actor.world.pos.z); s16 rotX = 0; s16 rotY = hakaTubo->dyna.actor.shape.rot.y; s16 rotZ = 0; @@ -848,9 +851,9 @@ void RegisterEnemyRandomizer() { PlayState* play = va_arg(args, PlayState*); s16 actorId = ACTOR_EN_POH; - s16 posX = haka->dyna.actor.world.pos.x; - s16 posY = haka->dyna.actor.world.pos.y; - s16 posZ = haka->dyna.actor.world.pos.z; + s16 posX = static_cast(haka->dyna.actor.world.pos.x); + s16 posY = static_cast(haka->dyna.actor.world.pos.y); + s16 posZ = static_cast(haka->dyna.actor.world.pos.z); s16 rotX = 0; s16 rotY = haka->dyna.actor.shape.rot.y; s16 rotZ = 0; @@ -860,7 +863,8 @@ void RegisterEnemyRandomizer() { assert(false); } - Actor_Spawn(&play->actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params); + Actor_Spawn(&play->actorCtx, play, actorId, static_cast(posX), static_cast(posY), + static_cast(posZ), rotX, rotY, rotZ, params); *should = false; }); @@ -870,17 +874,17 @@ void RegisterEnemyRandomizer() { PlayState* play = va_arg(args, PlayState*); s16 actorId = ACTOR_EN_BILI; - s16 posX = vali->actor.world.pos.x; - s16 posY = vali->actor.world.pos.y; - s16 posZ = vali->actor.world.pos.z; + s16 posX = static_cast(vali->actor.world.pos.x); + s16 posY = static_cast(vali->actor.world.pos.y); + s16 posZ = static_cast(vali->actor.world.pos.z); s16 rotX = 0; s16 rotY = vali->actor.world.rot.y; s16 rotZ = 0; s16 params = 0; - s16 homePosX = vali->actor.home.pos.x; - s16 homePosY = vali->actor.home.pos.y; - s16 homePosZ = vali->actor.home.pos.z; + s16 homePosX = static_cast(vali->actor.home.pos.x); + s16 homePosY = static_cast(vali->actor.home.pos.y); + s16 homePosZ = static_cast(vali->actor.home.pos.z); s16 homeRotX = vali->actor.home.rot.x; s16 homeRotY = vali->actor.home.rot.y; @@ -893,7 +897,8 @@ void RegisterEnemyRandomizer() { assert(false); } - Actor_Spawn(&play->actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params); + Actor_Spawn(&play->actorCtx, play, actorId, static_cast(posX), static_cast(posY), + static_cast(posZ), rotX, rotY, rotZ, params); rotY += 0x10000 / 3; } @@ -908,9 +913,9 @@ void RegisterEnemyRandomizer() { // have to use int instead of s16 in the va_arg call due to integer promotion s16 actorId = va_arg(args, int); Vec3f spawnPos = va_arg(args, Vec3f); - s16 posX = spawnPos.x; - s16 posY = spawnPos.y; - s16 posZ = spawnPos.z; + s16 posX = static_cast(spawnPos.x); + s16 posY = static_cast(spawnPos.y); + s16 posZ = static_cast(spawnPos.z); s16 rotX = 0; s16 rotY = 0; s16 rotZ = 0; @@ -921,7 +926,8 @@ void RegisterEnemyRandomizer() { assert(false); } - if (Actor_Spawn(&play->actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params)) { + if (Actor_Spawn(&play->actorCtx, play, actorId, static_cast(posX), static_cast(posY), + static_cast(posZ), rotX, rotY, rotZ, params)) { encount1->curNumSpawn++; if (encount1->curNumSpawn >= encount1->maxCurSpawns) { encount1->fieldSpawnTimer = 100; @@ -939,9 +945,9 @@ void RegisterEnemyRandomizer() { PlayState* play = va_arg(args, PlayState*); s16 actorId = ACTOR_EN_TEST; - s16 posX = 70.0f; - s16 posY = 827.0f; - s16 posZ = -3383.0f; + s16 posX = 70; + s16 posY = 827; + s16 posZ = -3383; s16 rotX = 0; s16 rotY = 0; s16 rotZ = 0; @@ -951,12 +957,13 @@ void RegisterEnemyRandomizer() { assert(false); } - Actor* enemy1 = Actor_Spawn(&play->actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params); + Actor* enemy1 = Actor_Spawn(&play->actorCtx, play, actorId, static_cast(posX), static_cast(posY), + static_cast(posZ), rotX, rotY, rotZ, params); actorId = ACTOR_EN_TEST; - posX = 170.0f; - posY = 827.0f; - posZ = -3260.0f; + posX = 170; + posY = 827; + posZ = -3260; rotX = 0; rotY = 0; rotZ = 0; @@ -966,7 +973,8 @@ void RegisterEnemyRandomizer() { assert(false); } - Actor* enemy2 = Actor_Spawn(&play->actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params); + Actor* enemy2 = Actor_Spawn(&play->actorCtx, play, actorId, static_cast(posX), static_cast(posY), + static_cast(posZ), rotX, rotY, rotZ, params); moriBigst->dyna.actor.home.rot.z = 2; @@ -986,11 +994,13 @@ void RegisterEnemyRandomizer() { PlayState* play = va_arg(args, PlayState*); s16 actorId = ACTOR_EN_FIREFLY; - s16 posX = hakaHuta->dyna.actor.world.pos.x + (-25.0f) * Math_CosS(hakaHuta->dyna.actor.shape.rot.y) + - 40.0f * Math_SinS(hakaHuta->dyna.actor.shape.rot.y); - s16 posY = hakaHuta->dyna.actor.world.pos.y - 10.0f; - s16 posZ = hakaHuta->dyna.actor.world.pos.z - (-25.0f) * Math_SinS(hakaHuta->dyna.actor.shape.rot.y) + - 40.0f * Math_CosS(hakaHuta->dyna.actor.shape.rot.y); + s16 posX = + static_cast(hakaHuta->dyna.actor.world.pos.x + (-25.0f) * Math_CosS(hakaHuta->dyna.actor.shape.rot.y) + + 40.0f * Math_SinS(hakaHuta->dyna.actor.shape.rot.y)); + s16 posY = static_cast(hakaHuta->dyna.actor.world.pos.y) - 10; + s16 posZ = + static_cast(hakaHuta->dyna.actor.world.pos.z - (-25.0f) * Math_SinS(hakaHuta->dyna.actor.shape.rot.y) + + 40.0f * Math_CosS(hakaHuta->dyna.actor.shape.rot.y)); s16 rotX = 0; s16 rotY = hakaHuta->dyna.actor.shape.rot.y + 0x8000; s16 rotZ = 0; @@ -1000,14 +1010,17 @@ void RegisterEnemyRandomizer() { assert(false); } - Actor_Spawn(&play->actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params); + Actor_Spawn(&play->actorCtx, play, actorId, static_cast(posX), static_cast(posY), + static_cast(posZ), rotX, rotY, rotZ, params); actorId = ACTOR_EN_FIREFLY; - posX = hakaHuta->dyna.actor.world.pos.x + (-25.0f) * Math_CosS(hakaHuta->dyna.actor.shape.rot.y) + - 80.0f * Math_SinS(hakaHuta->dyna.actor.shape.rot.y); - posY = hakaHuta->dyna.actor.world.pos.y - 10.0f; - posZ = hakaHuta->dyna.actor.world.pos.z - (-25.0f) * Math_SinS(hakaHuta->dyna.actor.shape.rot.y) + - 80.0f * Math_CosS(hakaHuta->dyna.actor.shape.rot.y); + posX = + static_cast(hakaHuta->dyna.actor.world.pos.x + (-25.0f) * Math_CosS(hakaHuta->dyna.actor.shape.rot.y) + + 80.0f * Math_SinS(hakaHuta->dyna.actor.shape.rot.y)); + posY = static_cast(hakaHuta->dyna.actor.world.pos.y) - 10; + posZ = + static_cast(hakaHuta->dyna.actor.world.pos.z - (-25.0f) * Math_SinS(hakaHuta->dyna.actor.shape.rot.y) + + 80.0f * Math_CosS(hakaHuta->dyna.actor.shape.rot.y)); rotX = 0; rotY = hakaHuta->dyna.actor.shape.rot.y; rotZ = 0; @@ -1017,7 +1030,8 @@ void RegisterEnemyRandomizer() { assert(false); } - Actor_Spawn(&play->actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params); + Actor_Spawn(&play->actorCtx, play, actorId, static_cast(posX), static_cast(posY), + static_cast(posZ), rotX, rotY, rotZ, params); *should = false; }); @@ -1027,11 +1041,13 @@ void RegisterEnemyRandomizer() { PlayState* play = va_arg(args, PlayState*); s16 actorId = ACTOR_EN_RD; - s16 posX = hakaHuta->dyna.actor.home.pos.x + (-25.0f) * Math_CosS(hakaHuta->dyna.actor.shape.rot.y) + - 100.0f * Math_SinS(hakaHuta->dyna.actor.shape.rot.y); - s16 posY = hakaHuta->dyna.actor.home.pos.y - 40.0f; - s16 posZ = hakaHuta->dyna.actor.home.pos.z - (-25.0f) * Math_SinS(hakaHuta->dyna.actor.shape.rot.y) + - 100.0f * Math_CosS(hakaHuta->dyna.actor.shape.rot.y); + s16 posX = + static_cast(hakaHuta->dyna.actor.home.pos.x + (-25.0f) * Math_CosS(hakaHuta->dyna.actor.shape.rot.y) + + 100.0f * Math_SinS(hakaHuta->dyna.actor.shape.rot.y)); + s16 posY = static_cast(hakaHuta->dyna.actor.home.pos.y) - 40; + s16 posZ = + static_cast(hakaHuta->dyna.actor.home.pos.z - (-25.0f) * Math_SinS(hakaHuta->dyna.actor.shape.rot.y) + + 100.0f * Math_CosS(hakaHuta->dyna.actor.shape.rot.y)); s16 rotX = 0; s16 rotY = hakaHuta->dyna.actor.shape.rot.y; s16 rotZ = 0; @@ -1041,7 +1057,8 @@ void RegisterEnemyRandomizer() { assert(false); } - Actor_Spawn(&play->actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params); + Actor_Spawn(&play->actorCtx, play, actorId, static_cast(posX), static_cast(posY), + static_cast(posZ), rotX, rotY, rotZ, params); *should = false; }); @@ -1051,9 +1068,9 @@ void RegisterEnemyRandomizer() { PlayState* play = va_arg(args, PlayState*); s16 actorId = ACTOR_EN_PEEHAT; - s16 homePosX = peehat->actor.home.pos.x; - s16 homePosY = peehat->actor.home.pos.y + 50.0f; - s16 homePosZ = peehat->actor.home.pos.z; + s16 homePosX = static_cast(peehat->actor.home.pos.x); + s16 homePosY = static_cast(peehat->actor.home.pos.y) + 50; + s16 homePosZ = static_cast(peehat->actor.home.pos.z); s16 rotX = 0; s16 rotY = 0; s16 rotZ = 0; @@ -1067,7 +1084,8 @@ void RegisterEnemyRandomizer() { } Actor* enemy = - Actor_Spawn(&play->actorCtx, play, actorId, homePosX, homePosY, homePosZ, rotX, rotY, rotZ, params); + Actor_Spawn(&play->actorCtx, play, actorId, static_cast(homePosX), static_cast(homePosY), + static_cast(homePosZ), rotX, rotY, rotZ, params); if (enemy == NULL) { assert(false); diff --git a/soh/soh/Enhancements/ExtraModes/RandomizedEnemySizes.cpp b/soh/soh/Enhancements/ExtraModes/RandomizedEnemySizes.cpp index 671a7e6b93..7d5ab86e57 100644 --- a/soh/soh/Enhancements/ExtraModes/RandomizedEnemySizes.cpp +++ b/soh/soh/Enhancements/ExtraModes/RandomizedEnemySizes.cpp @@ -39,9 +39,9 @@ static void RandomizedEnemySizes(void* refActor) { float randomScale; if (bigActor) { - randomScale = 1.0f + ShipUtils::RandomDouble() * 2.0f; + randomScale = static_cast(1.0f + ShipUtils::RandomDouble() * 2.0f); } else { - randomScale = 0.1f + ShipUtils::RandomDouble() * 0.9f; + randomScale = static_cast(0.1f + ShipUtils::RandomDouble() * 0.9f); } Actor_SetScale(actor, actor->scale.z * randomScale); @@ -52,7 +52,7 @@ static void RandomizedEnemySizes(void* refActor) { float scaledHealth = actor->colChkInfo.health * (randomScale * healthScalingFactor); // Ensure the scaled health doesn't go below zero - actor->colChkInfo.health = fmax(scaledHealth, 1.0f); + actor->colChkInfo.health = static_cast(fmax(scaledHealth, 1.0f)); // Ensure maximum health gets set SetActorMaximumHealth(actor, actor->colChkInfo.health); diff --git a/soh/soh/Enhancements/Fishing.cpp b/soh/soh/Enhancements/Fishing.cpp index 109533f984..98235c8d41 100644 --- a/soh/soh/Enhancements/Fishing.cpp +++ b/soh/soh/Enhancements/Fishing.cpp @@ -9,7 +9,7 @@ f32 Fishing_GetMinimumRequiredScore(); void BuildFishingMessage(uint16_t* textId, bool* loadFromMessageTable) { if (gSaveContext.minigameScore == 0) { - gSaveContext.minigameScore = Fishing_GetMinimumRequiredScore(); + gSaveContext.minigameScore = static_cast(Fishing_GetMinimumRequiredScore()); } } diff --git a/soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp b/soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp index 0b7cf2f765..3160706a33 100644 --- a/soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp +++ b/soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp @@ -3,9 +3,9 @@ extern "C" SaveContext gSaveContext; -#define BOSS_DEFEAT_TIMESTAMP(actorID, timestamp) \ - COND_ID_HOOK(OnBossDefeat, actorID, true, [](void* refActor) { \ - gSaveContext.ship.stats.itemTimestamp[timestamp] = static_cast(GAMEPLAYSTAT_TOTAL_TIME); \ +#define BOSS_DEFEAT_TIMESTAMP(actorID, timestamp) \ + COND_ID_HOOK(OnBossDefeat, actorID, true, [](void* refActor) { \ + gSaveContext.ship.stats.itemTimestamp[timestamp] = static_cast(GAMEPLAYSTAT_TOTAL_TIME); \ }); static void RegisterBossDefeatTimestamps() { @@ -19,7 +19,7 @@ static void RegisterBossDefeatTimestamps() { BOSS_DEFEAT_TIMESTAMP(ACTOR_BOSS_TW, TIMESTAMP_DEFEAT_TWINROVA); BOSS_DEFEAT_TIMESTAMP(ACTOR_BOSS_GANON, TIMESTAMP_DEFEAT_GANONDORF); COND_ID_HOOK(OnBossDefeat, ACTOR_BOSS_GANON2, true, [](void* refActor) { - gSaveContext.ship.stats.itemTimestamp[TIMESTAMP_DEFEAT_GANON] = GAMEPLAYSTAT_TOTAL_TIME; + gSaveContext.ship.stats.itemTimestamp[TIMESTAMP_DEFEAT_GANON] = static_cast(GAMEPLAYSTAT_TOTAL_TIME); gSaveContext.ship.stats.gameComplete = true; }); } diff --git a/soh/soh/Enhancements/Graphics/VisualAgony.cpp b/soh/soh/Enhancements/Graphics/VisualAgony.cpp index de7fcee339..8fe0bb4075 100644 --- a/soh/soh/Enhancements/Graphics/VisualAgony.cpp +++ b/soh/soh/Enhancements/Graphics/VisualAgony.cpp @@ -58,14 +58,14 @@ void DrawVisualAgony(Player* player, double temp) { if (CVarGetInteger(CVAR_COSMETIC("HUD.VisualSoA.UseMargins"), 0) != 0) { X_Margins_VSOA = Left_Margins; }; - PosX_VSOA = - OTRGetDimensionFromLeftEdge(CVarGetInteger(CVAR_COSMETIC("HUD.VisualSoA.PosX"), 0) + X_Margins_VSOA); + PosX_VSOA = static_cast(OTRGetDimensionFromLeftEdge( + static_cast(CVarGetInteger(CVAR_COSMETIC("HUD.VisualSoA.PosX"), 0) + X_Margins_VSOA))); } else if (CVarGetInteger(CVAR_COSMETIC("HUD.VisualSoA.PosType"), 0) == ANCHOR_RIGHT) { if (CVarGetInteger(CVAR_COSMETIC("HUD.VisualSoA.UseMargins"), 0) != 0) { X_Margins_VSOA = Right_Margins; } - PosX_VSOA = - OTRGetDimensionFromRightEdge(CVarGetInteger(CVAR_COSMETIC("HUD.VisualSoA.PosX"), 0) + X_Margins_VSOA); + PosX_VSOA = static_cast(OTRGetDimensionFromRightEdge( + static_cast(CVarGetInteger(CVAR_COSMETIC("HUD.VisualSoA.PosX"), 0) + X_Margins_VSOA))); } else if (CVarGetInteger(CVAR_COSMETIC("HUD.VisualSoA.PosType"), 0) == ANCHOR_NONE) { PosX_VSOA = CVarGetInteger(CVAR_COSMETIC("HUD.VisualSoA.PosX"), 0); } else if (CVarGetInteger(CVAR_COSMETIC("HUD.VisualSoA.PosType"), 0) == HIDDEN) { diff --git a/soh/soh/Enhancements/Items/AdditionalReticles.cpp b/soh/soh/Enhancements/Items/AdditionalReticles.cpp index 9b8b5cfcaf..63f31f5ae7 100644 --- a/soh/soh/Enhancements/Items/AdditionalReticles.cpp +++ b/soh/soh/Enhancements/Items/AdditionalReticles.cpp @@ -43,7 +43,6 @@ void RegisterAdditionalReticles() { player->heldItemAction == PLAYER_IA_SLINGSHOT)) { if (heldActor != NULL) { MtxF sp44; - s32 pad; Matrix_RotateZYX(0, -15216, -17496, MTXMODE_APPLY); Matrix_Get(&sp44); diff --git a/soh/soh/Enhancements/Items/InjectItemCounts.cpp b/soh/soh/Enhancements/Items/InjectItemCounts.cpp index caa2cf9d0e..2b52a20e5c 100644 --- a/soh/soh/Enhancements/Items/InjectItemCounts.cpp +++ b/soh/soh/Enhancements/Items/InjectItemCounts.cpp @@ -26,7 +26,7 @@ void BuildSkulltulaMessage(uint16_t* textId, bool* loadFromMessageTable) { msg = msg + "\x0E\x3C"; } int16_t gsCount = gSaveContext.inventory.gsTokens; - msg.InsertNumber(gsCount); + msg.InsertNumber(static_cast(gsCount)); msg.AutoFormat(ITEM_SKULL_TOKEN); msg.LoadIntoFont(); *loadFromMessageTable = false; diff --git a/soh/soh/Enhancements/Items/RemoteBombchu.cpp b/soh/soh/Enhancements/Items/RemoteBombchu.cpp index 1813db23d5..18e405238f 100644 --- a/soh/soh/Enhancements/Items/RemoteBombchu.cpp +++ b/soh/soh/Enhancements/Items/RemoteBombchu.cpp @@ -120,7 +120,7 @@ static void HandleSteering(EnBomChu* chu, Input* input) { return; // Calculate turn angle based on stick input - f32 turnAngle = BINANG_TO_RAD((s16)(TURN_RATE * (stickX / 85.0f))); + f32 turnAngle = static_cast(BINANG_TO_RAD((s16)(TURN_RATE * (stickX / 85.0f)))); // Rotate forward and left vectors around the up axis RotateVectorAroundAxis(&chu->axisForwards, &chu->axisUp, -turnAngle); diff --git a/soh/soh/Enhancements/audio/AudioEditor.cpp b/soh/soh/Enhancements/audio/AudioEditor.cpp index dc304eb10a..44746e46db 100644 --- a/soh/soh/Enhancements/audio/AudioEditor.cpp +++ b/soh/soh/Enhancements/audio/AudioEditor.cpp @@ -410,7 +410,8 @@ void Draw_SfxTab(const std::string& tabId, SeqType type, const std::string& tabN if (validSequences.size()) { auto it = validSequences.begin(); - const auto& seqData = *std::next(it, ShipUtils::Random(0, validSequences.size())); + const auto& seqData = + *std::next(it, ShipUtils::Random(0, static_cast(validSequences.size()))); CVarSetInteger(cvarKey.c_str(), seqData->sequenceId); if (locked) { CVarClear(cvarLockKey.c_str()); diff --git a/soh/soh/Enhancements/custom-message/CustomMessageManager.cpp b/soh/soh/Enhancements/custom-message/CustomMessageManager.cpp index 3c524381c6..f052c21684 100644 --- a/soh/soh/Enhancements/custom-message/CustomMessageManager.cpp +++ b/soh/soh/Enhancements/custom-message/CustomMessageManager.cpp @@ -274,16 +274,16 @@ void CustomMessage::LoadIntoFont() { switch (gSaveContext.language) { case LANGUAGE_FRA: msgCtx->msgLength = font->msgLength = - SohUtils::CopyStringToCharBuffer(buffer, GetFrench(MF_RAW), maxBufferSize); + static_cast(SohUtils::CopyStringToCharBuffer(buffer, GetFrench(MF_RAW), maxBufferSize)); break; case LANGUAGE_GER: msgCtx->msgLength = font->msgLength = - SohUtils::CopyStringToCharBuffer(buffer, GetGerman(MF_RAW), maxBufferSize); + static_cast(SohUtils::CopyStringToCharBuffer(buffer, GetGerman(MF_RAW), maxBufferSize)); break; case LANGUAGE_ENG: default: msgCtx->msgLength = font->msgLength = - SohUtils::CopyStringToCharBuffer(buffer, GetEnglish(MF_RAW), maxBufferSize); + static_cast(SohUtils::CopyStringToCharBuffer(buffer, GetEnglish(MF_RAW), maxBufferSize)); break; } } diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index 707b234697..2468b7db73 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -736,7 +736,7 @@ static void DrawFlagTableSearchResults(const FlagTable& flagTable, ImGuiTextFilt uint16_t& flags = GetFlagTableEntry(flagTable, row); for (int32_t flagIndex = 15; flagIndex >= 0; flagIndex--) { - uint16_t index = row * 16 + flagIndex; + uint16_t index = static_cast(row * 16 + flagIndex); auto descIt = flagTable.flagDescriptions.find(index); const char* desc = descIt != flagTable.flagDescriptions.end() ? descIt->second : ""; std::string searchable = fmt::format("0x{:02X} {}", index, desc); @@ -1150,19 +1150,22 @@ void DrawFlagsTab() { switch (flagTable.flagTableType) { case EVENT_CHECK_INF: - DrawFlagTableArray16(flagTable, j, gSaveContext.eventChkInf[j]); + DrawFlagTableArray16(flagTable, static_cast(j), + gSaveContext.eventChkInf[j]); break; case ITEM_GET_INF: - DrawFlagTableArray16(flagTable, j, gSaveContext.itemGetInf[j]); + DrawFlagTableArray16(flagTable, static_cast(j), + gSaveContext.itemGetInf[j]); break; case INF_TABLE: - DrawFlagTableArray16(flagTable, j, gSaveContext.infTable[j]); + DrawFlagTableArray16(flagTable, static_cast(j), gSaveContext.infTable[j]); break; case EVENT_INF: - DrawFlagTableArray16(flagTable, j, gSaveContext.eventInf[j]); + DrawFlagTableArray16(flagTable, static_cast(j), gSaveContext.eventInf[j]); break; case RANDOMIZER_INF: - DrawFlagTableArray16(flagTable, j, gSaveContext.ship.randomizerInf[j]); + DrawFlagTableArray16(flagTable, static_cast(j), + gSaveContext.ship.randomizerInf[j]); break; } }, @@ -1219,7 +1222,7 @@ void DrawUpgrade(const std::string& categoryName, int32_t categoryId, const std: if (ImGui::BeginCombo("##upgrade", name)) { for (size_t i = 0; i < names.size(); i++) { if (ImGui::Selectable(names[i].c_str())) { - Inventory_ChangeUpgrade(categoryId, i); + Inventory_ChangeUpgrade(categoryId, static_cast(i)); } } @@ -1266,7 +1269,7 @@ void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const if (items[pickerIndex] == ITEM_NONE) { if (ImGui::Button("##upgradePopupPicker", ImVec2(IMAGE_SIZE, IMAGE_SIZE) + ImGui::GetStyle().FramePadding * 2)) { - Inventory_ChangeUpgrade(categoryId, pickerIndex); + Inventory_ChangeUpgrade(categoryId, static_cast(pickerIndex)); ImGui::CloseCurrentPopup(); } Tooltip("None"); @@ -1278,7 +1281,7 @@ void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const ->GetTextureByName(slotEntry.name), ImVec2(IMAGE_SIZE, IMAGE_SIZE), ImVec2(0, 0), ImVec2(1, 1)); if (ret) { - Inventory_ChangeUpgrade(categoryId, pickerIndex); + Inventory_ChangeUpgrade(categoryId, static_cast(pickerIndex)); ImGui::CloseCurrentPopup(); } Tooltip(SohUtils::GetItemName(slotEntry.id).c_str()); @@ -1306,7 +1309,7 @@ void DrawEquipmentTab() { ImGui::SameLine(); } - ImGui::PushID(i); + ImGui::PushID(static_cast(i)); uint32_t bitMask = 1 << i; bool hasEquip = (bitMask & gSaveContext.inventory.equipment) != 0; const ItemMapEntry& entry = itemMapping[equipmentValues[i]]; @@ -1425,7 +1428,7 @@ void DrawEquipmentTab() { if (ImGui::BeginCombo("##upgrade", name)) { for (size_t i = 0; i < bombchuNames.size(); i++) { if (ImGui::Selectable(bombchuNames[i].c_str())) { - gSaveContext.ship.quest.data.randomizer.bombchuUpgradeLevel = i; + gSaveContext.ship.quest.data.randomizer.bombchuUpgradeLevel = static_cast(i); if (i > 0) { INV_CONTENT(ITEM_BOMBCHU) = ITEM_BOMBCHU; } else { diff --git a/soh/soh/Enhancements/kaleido.cpp b/soh/soh/Enhancements/kaleido.cpp index f5d3e5c6d6..af3bf1207a 100644 --- a/soh/soh/Enhancements/kaleido.cpp +++ b/soh/soh/Enhancements/kaleido.cpp @@ -307,7 +307,7 @@ void Kaleido::Draw(PlayState* play) { if (mCursorPos < static_cast(mEntries.size() - 1)) { mCursorPos += mNumVisible; if (mCursorPos > static_cast(mEntries.size() - 1)) { - mCursorPos = mEntries.size() - 1; + mCursorPos = static_cast(mEntries.size() - 1); } Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); diff --git a/soh/soh/Enhancements/mod_menu.cpp b/soh/soh/Enhancements/mod_menu.cpp index 745c353e3f..08193ccfd0 100644 --- a/soh/soh/Enhancements/mod_menu.cpp +++ b/soh/soh/Enhancements/mod_menu.cpp @@ -361,8 +361,8 @@ void DrawMods(bool enabled) { if (UIWidgets::StateButton((file + "_up").c_str(), ICON_FA_ARROW_UP, ImVec2(25, 25), UIWidgets::ButtonOptions().Color(THEME_COLOR))) { madeAnyChange = true; - switchFromIndex = i; - switchToIndex = i + 1; + switchFromIndex = static_cast(i); + switchToIndex = static_cast(i + 1); } if (i == selectedModFiles.size() - 1) { ImGui::EndDisabled(); @@ -375,8 +375,8 @@ void DrawMods(bool enabled) { if (UIWidgets::StateButton((file + "_down").c_str(), ICON_FA_ARROW_DOWN, ImVec2(25, 25), UIWidgets::ButtonOptions().Color(THEME_COLOR))) { madeAnyChange = true; - switchFromIndex = i; - switchToIndex = i - 1; + switchFromIndex = static_cast(i); + switchToIndex = static_cast(i - 1); } if (i == 0) { ImGui::EndDisabled(); diff --git a/soh/soh/Enhancements/randomizer/3drando/hints.cpp b/soh/soh/Enhancements/randomizer/3drando/hints.cpp index b5f0935173..e8d9abaa2c 100644 --- a/soh/soh/Enhancements/randomizer/3drando/hints.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/hints.cpp @@ -503,7 +503,7 @@ static int32_t getRandomWeight(uint32_t totalWeight) { static void DistributeAndPlaceHints(std::vector& distTable, size_t totalStones) { auto ctx = Rando::Context::GetInstance(); - const uint8_t junkIdx = distTable.size(); + const uint8_t junkIdx = static_cast(distTable.size()); // Apply fixed hints upfront (they don't participate in weighted selection) for (size_t i = 0; i < distTable.size(); i++) { diff --git a/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp b/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp index 97f06fd129..b1a956fadf 100644 --- a/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp @@ -33,13 +33,13 @@ const std::map*> poolForItem = { void AddItemToPool(RandomizerGet item, int plentifulCount, size_t balancedCount, size_t scarceCount = 1, size_t minimalCount = 1, bool iceTrapModel = true) { - int count = balancedCount; + int count = static_cast(balancedCount); switch (ctx->GetOption(RSK_ITEM_POOL).Get()) { case RO_ITEM_POOL_SCARCE: - count = scarceCount; + count = static_cast(scarceCount); break; case RO_ITEM_POOL_MINIMAL: - count = minimalCount; + count = static_cast(minimalCount); break; default: break; @@ -924,7 +924,7 @@ void GenerateItemPool() { } iceTrapstoAdd += ctx->GetOption(RSK_ADDITIONAL_ICE_TRAPS).Get(); AddFixedItemToPool(RG_ICE_TRAP, - itemPool.size() + iceTrapstoAdd < locCount ? iceTrapstoAdd : locCount - itemPool.size(), false); + itemPool.size() + iceTrapstoAdd < locCount ? iceTrapstoAdd : static_cast(locCount - itemPool.size()), false); if (itemPool.size() + lesserPool.size() < locCount) { itemPool.insert(itemPool.end(), lesserPool.begin(), lesserPool.end()); } else { @@ -942,7 +942,7 @@ void GenerateItemPool() { iceTrapstoAdd = 0; if (junkToAdd > 0) { if (ctx->GetOption(RSK_ICE_TRAP_PERCENT).Is(100)) { - iceTrapstoAdd = junkToAdd; + iceTrapstoAdd = static_cast(junkToAdd); } 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()) { diff --git a/soh/soh/Enhancements/randomizer/RocsFeather.cpp b/soh/soh/Enhancements/randomizer/RocsFeather.cpp index 6e4fa71697..4a570370cb 100644 --- a/soh/soh/Enhancements/randomizer/RocsFeather.cpp +++ b/soh/soh/Enhancements/randomizer/RocsFeather.cpp @@ -71,8 +71,9 @@ void RegisterRocsFeather() { Vec3f effectsPos = player->actor.home.pos; effectsPos.y += 3; - EffectSsGRipple_Spawn(gPlayState, &effectsPos, 200 * effectsScale, 300 * effectsScale, 1); - EffectSsGSplash_Spawn(gPlayState, &effectsPos, NULL, NULL, 0, 150 * effectsScale); + EffectSsGRipple_Spawn(gPlayState, &effectsPos, static_cast(200 * effectsScale), + static_cast(300 * effectsScale), 1); + EffectSsGSplash_Spawn(gPlayState, &effectsPos, NULL, NULL, 0, static_cast(150 * effectsScale)); // Remove hopping state when using Roc's after sidehop/backflip to allow grabbing ledges again player->stateFlags2 &= ~(PLAYER_STATE2_HOPPING); diff --git a/soh/soh/Enhancements/randomizer/SeedContext.cpp b/soh/soh/Enhancements/randomizer/SeedContext.cpp index ea696e5a16..a80957498f 100644 --- a/soh/soh/Enhancements/randomizer/SeedContext.cpp +++ b/soh/soh/Enhancements/randomizer/SeedContext.cpp @@ -45,10 +45,10 @@ RandomizerArea Context::GetAreaFromString(std::string str) { int Context::CountEmptyLocations(const bool countShops) { auto ctx = Rando::Context::GetInstance(); - return count_if(allLocations.begin(), allLocations.end(), [ctx, countShops](const auto loc) { + return static_cast(count_if(allLocations.begin(), allLocations.end(), [ctx, countShops](const auto loc) { return ctx->GetItemLocation(loc)->GetPlacedRandomizerGet() == RG_NONE && (countShops || Rando::StaticData::GetLocation(loc)->GetRCType() != RCTYPE_SHOP); - }); + })); } void Context::InitStaticData() { diff --git a/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp b/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp index fc0adcebe0..45fc1b2ed1 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp @@ -49,7 +49,7 @@ extern "C" void DrawItemHalo(Actor* icicleActor) { // Rotate and draw halo with CMC colors Matrix_Translate(icicleActor->world.pos.x + xOffset, icicleActor->world.pos.y + yOffset, icicleActor->world.pos.z + zOffset, MTXMODE_NEW); - Matrix_RotateZ(-M_PI / 2, MTXMODE_APPLY); + Matrix_RotateZ(static_cast(-M_PI / 2), MTXMODE_APPLY); Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY); OPEN_DISPS(gPlayState->state.gfxCtx); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(gPlayState->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp b/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp index 6a799661b8..571566220f 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp @@ -53,7 +53,7 @@ static void Sparkles(PlayState* play, Actor* actor, bool boulder, CheckIdentity } else { Matrix_Translate(actor->world.pos.x + xOffset, actor->world.pos.y + yOffset, actor->world.pos.z + zOffset, MTXMODE_NEW); - Matrix_RotateZ(-M_PI / 2, MTXMODE_APPLY); + Matrix_RotateZ(static_cast(-M_PI / 2), MTXMODE_APPLY); if (boulder) { Matrix_Scale(0.04f, 0.04f, 0.04f, MTXMODE_APPLY); } else { @@ -153,10 +153,10 @@ void Rock_RandomizerSpawnCollectible(Actor* actor, CheckIdentity rockIdentity, P item00->actor.draw = (ActorFunc)EnItem00_DrawRandomizedItem; item00->actor.velocity.y = 9.0f; item00->actor.speedXZ = 2.0f; - item00->actor.world.rot.y = Rand_CenteredFloat(65536.0f); + item00->actor.world.rot.y = static_cast(Rand_CenteredFloat(65536.0f)); switch (rockIdentity.randomizerCheck) { case RC_SPIRIT_TEMPLE_MQ_ENTRANCE_EYE_BOULDER: - item00->actor.world.rot.y = 0x8000; + item00->actor.world.rot.y = static_cast(0x8000); break; case RC_SPIRIT_TEMPLE_MQ_GIBDO_BOULDER_LOW: item00->actor.velocity.y = 15.0f; diff --git a/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp b/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp index 59026cac1e..5926503b6e 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp @@ -274,7 +274,7 @@ void WonderHeishi_RandomizerSpawnCollectible(PlayState* play, Vec3f pos, f32 rot item00->actor.draw = (ActorFunc)EnItem00_DrawRandomizedItem; item00->actor.velocity.y = Rand_CenteredFloat(5.0f) + 10.0f; item00->actor.speedXZ = Rand_CenteredFloat(5.0f) + 10.0f; - item00->actor.world.rot.y = rotY; + item00->actor.world.rot.y = static_cast(rotY); } void RegisterShuffleWonderItems() { diff --git a/soh/soh/Enhancements/randomizer/randomizerEnumStrings.cpp b/soh/soh/Enhancements/randomizer/randomizerEnumStrings.cpp index 060cc8f1a5..2d9faf3d31 100644 --- a/soh/soh/Enhancements/randomizer/randomizerEnumStrings.cpp +++ b/soh/soh/Enhancements/randomizer/randomizerEnumStrings.cpp @@ -19,6 +19,10 @@ #include "randomizerEnums.h" +#undef RANDO_ENUM_BEGIN +#undef RANDO_ENUM_ITEM +#undef RANDO_ENUM_END + // Redefine enum macros to generate enum->string maps for every enum. #define RANDO_ENUM_BEGIN(EnumName) \ template <> const std::unordered_map& GetEnumToStringMap() { \ diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp index bf17e64bf3..b847a19dc0 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp @@ -700,9 +700,11 @@ void EntranceTrackerSettingsWindow::DrawElement() { Spacer(0); ImGui::TableNextColumn(); - SohGui::GetSohMenu()->MenuDrawItem(backgroundColorWidget, ImGui::GetContentRegionAvail().x, THEME_COLOR); + SohGui::GetSohMenu()->MenuDrawItem(backgroundColorWidget, static_cast(ImGui::GetContentRegionAvail().x), + THEME_COLOR); - SohGui::GetSohMenu()->MenuDrawItem(windowTypeWidget, ImGui::GetContentRegionAvail().x, THEME_COLOR); + SohGui::GetSohMenu()->MenuDrawItem(windowTypeWidget, static_cast(ImGui::GetContentRegionAvail().x), + THEME_COLOR); if (CVarGetInteger(CVAR_TRACKER_ENTRANCE("WindowType"), TRACKER_WINDOW_WINDOW) == TRACKER_WINDOW_FLOATING) { CVarCheckbox("Enable Dragging", CVAR_TRACKER_ENTRANCE("Draggable"), CheckboxOptions().Color(THEME_COLOR)); diff --git a/soh/soh/Enhancements/tts/tts.cpp b/soh/soh/Enhancements/tts/tts.cpp index f0420a4e5a..7300735b04 100644 --- a/soh/soh/Enhancements/tts/tts.cpp +++ b/soh/soh/Enhancements/tts/tts.cpp @@ -868,7 +868,7 @@ void RegisterOnUpdateMainMenuSelection() { } else if (charCode == 0xF0 + FS_KBD_BTN_END) { translation = GetParameritizedText("end", TEXT_BANK_FILECHOOSE, nullptr); } else { - charVal[0] = charCode; + charVal[0] = static_cast(charCode); } if (translation.empty()) { diff --git a/soh/soh/Extractor/FastCrc32C.c b/soh/soh/Extractor/FastCrc32C.c index 795cc42d74..58a91229f3 100644 --- a/soh/soh/Extractor/FastCrc32C.c +++ b/soh/soh/Extractor/FastCrc32C.c @@ -35,7 +35,7 @@ #endif #if defined(_MSC_VER) && defined(_M_ARM64) -#define INTRIN_CRC32_64(crc, data) crc = __crc32cd(crc, data) +#define INTRIN_CRC32_64(crc, data) crc = (uint32_t)__crc32cd(crc, data) #define INTRIN_CRC32_32(crc, data) crc = __crc32cw(crc, data) #define INTRIN_CRC32_16(crc, data) crc = __crc32ch(crc, data) #define INTRIN_CRC32_8(crc, data) crc = __crc32cb(crc, data) @@ -46,7 +46,7 @@ #define INTRIN_CRC32_8(crc, value) __asm__("crc32cb %w[c], %w[c], %w[v]" : [c] "+r"(crc) : [v] "r"(value)) #elif ((defined(__GNUC__) || defined(_MSC_VER)) && \ (defined(_M_X64) || defined(_M_IX86) || defined(__x86_64__) || defined(__i386__))) -#define INTRIN_CRC32_64(crc, data) crc = _mm_crc32_u64(crc, data) +#define INTRIN_CRC32_64(crc, data) crc = (uint32_t)_mm_crc32_u64(crc, data) #define INTRIN_CRC32_32(crc, data) crc = _mm_crc32_u32(crc, data) #define INTRIN_CRC32_16(crc, data) crc = _mm_crc32_u16(crc, data) #define INTRIN_CRC32_8(crc, data) crc = _mm_crc32_u8(crc, data) diff --git a/soh/soh/Network/Anchor/Packets/UpdateTeamState.cpp b/soh/soh/Network/Anchor/Packets/UpdateTeamState.cpp index 095514f483..e26fed954c 100644 --- a/soh/soh/Network/Anchor/Packets/UpdateTeamState.cpp +++ b/soh/soh/Network/Anchor/Packets/UpdateTeamState.cpp @@ -162,7 +162,7 @@ void Anchor::HandlePacket_UpdateTeamState(nlohmann::json payload) { if (i == SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR) { // Keep collapse timer flag - u32 mask = (1 << 0x36); + u32 mask = (1 << 0x17); loadedData.sceneFlags[i].swch = (loadedData.sceneFlags[i].swch & ~mask) | (gSaveContext.sceneFlags[i].swch & mask); } diff --git a/soh/soh/Network/Network.cpp b/soh/soh/Network/Network.cpp index cbfa0b6af7..15d692c577 100644 --- a/soh/soh/Network/Network.cpp +++ b/soh/soh/Network/Network.cpp @@ -49,7 +49,7 @@ void Network::ProcessOutgoingPackets() { void Network::SendDataToRemote(const char* payload) { SPDLOG_DEBUG("[Network] Sending data: {}", payload); - SDLNet_TCP_Send(networkSocket, payload, strlen(payload) + 1); + SDLNet_TCP_Send(networkSocket, payload, static_cast(strlen(payload) + 1)); } void Network::SendJsonToRemote(nlohmann::json payload) { diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 1b391ed83f..e7c8df8ca2 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -129,6 +129,10 @@ #include "soh/config/ConfigUpdaters.h" #include "soh/ShipInit.hpp" +#ifdef _MSC_VER +#define strdup _strdup +#endif + #ifdef __WIIU__ const uint32_t defaultImGuiScale = 3; #else @@ -378,7 +382,7 @@ bool PathTestCleanup(FILE* tfile) { std::filesystem::remove("./text.txt"); if (std::filesystem::exists("./test/")) std::filesystem::remove("./test/"); - } catch (std::filesystem::filesystem_error const& ex) { return false; } + } catch ([[maybe_unused]] std::filesystem::filesystem_error const& ex) { return false; } return true; } @@ -393,7 +397,7 @@ void CheckAndCreateModFolder() { std::ofstream(filePath).close(); } } - } catch (std::filesystem::filesystem_error const& ex) { + } catch ([[maybe_unused]] std::filesystem::filesystem_error const& ex) { // Couldn't make the folder, continue silently return; } @@ -508,7 +512,7 @@ void OTRGlobals::RunExtract(int argc, char* argv[]) { std::filesystem::path tempPath; try { tempPath = std::filesystem::canonical(tempVar); - } catch (std::filesystem::filesystem_error const& ex) { + } catch ([[maybe_unused]] std::filesystem::filesystem_error const& ex) { std::string userPath = getenv("USERPROFILE"); userPath.append("\\AppData\\Local\\Temp"); tempPath = std::filesystem::canonical(userPath); @@ -532,7 +536,7 @@ void OTRGlobals::RunExtract(int argc, char* argv[]) { bool error = false; try { create_directories(tfolder); - } catch (std::filesystem::filesystem_error const& ex) { error = true; } + } catch ([[maybe_unused]] std::filesystem::filesystem_error const& ex) { error = true; } if (tfile == NULL || error) { SohGui::RegisterPopup("SoH Permissions Error", "SoH does not have proper file permissions.\nPlease move it to a " @@ -2526,5 +2530,5 @@ bool SoH_HandleConfigDrop(char* filePath) { // Number of interpolated frames extern "C" uint32_t Ship_GetInterpolationFrameCount() { - return ceil((float)OTRGlobals::Instance->GetInterpolationFPS() / 20.0f); + return static_cast(ceil((float)OTRGlobals::Instance->GetInterpolationFPS() / 20.0f)); } diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index 67e250a58c..3f551567eb 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -837,21 +837,21 @@ void SaveManager::InitFileDebug() { gSaveContext.deaths = 0; if (ResourceMgr_GetGameRegion(0) == GAME_REGION_PAL && gSaveContext.language != LANGUAGE_JPN) { - const static std::array sPlayerName = { '\x15', '\x12', '\x17', '\x14', '\x3E', '\x3E', '\x3E', '\x3E' }; + const static std::array sPlayerName = { 0x15, 0x12, 0x17, 0x14, 0x3E, 0x3E, 0x3E, 0x3E }; for (int i = 0; i < ARRAY_COUNT(gSaveContext.playerName); i++) { gSaveContext.playerName[i] = sPlayerName[i]; } gSaveContext.ship.filenameLanguage = NAME_LANGUAGE_PAL; } else if (gSaveContext.language == LANGUAGE_JPN) { // Japanese - const static std::array sPlayerName = { '\x81', '\x87', '\x61', '\xDF', '\xDF', '\xDF', '\xDF', '\xDF' }; + const static std::array sPlayerName = { 0x81, 0x87, 0x61, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF }; for (int i = 0; i < ARRAY_COUNT(gSaveContext.playerName); i++) { gSaveContext.playerName[i] = sPlayerName[i]; } gSaveContext.ship.filenameLanguage = NAME_LANGUAGE_NTSC_JPN; } else { // GAME_REGION_NTSC - const static std::array sPlayerName = { '\xB6', '\xB3', '\xB8', '\xB5', '\xDF', '\xDF', '\xDF', '\xDF' }; + const static std::array sPlayerName = { 0xB6, 0xB3, 0xB8, 0xB5, 0xDF, 0xDF, 0xDF, 0xDF }; for (int i = 0; i < ARRAY_COUNT(gSaveContext.playerName); i++) { gSaveContext.playerName[i] = sPlayerName[i]; @@ -960,21 +960,21 @@ void SaveManager::InitFileMaxed() { gSaveContext.deaths = 0; if (ResourceMgr_GetGameRegion(0) == GAME_REGION_PAL && gSaveContext.language != LANGUAGE_JPN) { - const static std::array sPlayerName = { '\x15', '\x12', '\x17', '\x14', '\x3E', '\x3E', '\x3E', '\x3E' }; + const static std::array sPlayerName = { 0x15, 0x12, 0x17, 0x14, 0x3E, 0x3E, 0x3E, 0x3E }; for (int i = 0; i < ARRAY_COUNT(gSaveContext.playerName); i++) { gSaveContext.playerName[i] = sPlayerName[i]; } gSaveContext.ship.filenameLanguage = NAME_LANGUAGE_PAL; } else if (gSaveContext.language == LANGUAGE_JPN) { // Japanese - const static std::array sPlayerName = { '\x81', '\x87', '\x61', '\xDF', '\xDF', '\xDF', '\xDF', '\xDF' }; + const static std::array sPlayerName = { 0x81, 0x87, 0x61, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF }; for (int i = 0; i < ARRAY_COUNT(gSaveContext.playerName); i++) { gSaveContext.playerName[i] = sPlayerName[i]; } gSaveContext.ship.filenameLanguage = NAME_LANGUAGE_NTSC_JPN; } else { // GAME_REGION_NTSC - const static std::array sPlayerName = { '\xB6', '\xB3', '\xB8', '\xB5', '\xDF', '\xDF', '\xDF', '\xDF' }; + const static std::array sPlayerName = { 0xB6, 0xB3, 0xB8, 0xB5, 0xDF, 0xDF, 0xDF, 0xDF }; for (int i = 0; i < ARRAY_COUNT(gSaveContext.playerName); i++) { gSaveContext.playerName[i] = sPlayerName[i]; diff --git a/soh/soh/SohGui/Menu.cpp b/soh/soh/SohGui/Menu.cpp index c41bfe74a4..455fd6b024 100644 --- a/soh/soh/SohGui/Menu.cpp +++ b/soh/soh/SohGui/Menu.cpp @@ -820,7 +820,7 @@ void Menu::DrawElement() { pos.y += headerHeight + style.ItemSpacing.y; pos.x = centerX - menuSize.x / 2 + (style.ItemSpacing.x * (menuEntries.size() + 1)); window->DrawList->AddRectFilled(pos, pos + ImVec2{ menuSize.x, 4 }, ImGui::GetColorU32({ 255, 255, 255, 255 }), - true, style.WindowRounding); + style.WindowRounding); pos.y += style.ItemSpacing.y; float sectionHeight = menuSize.y - headerHeight - 4 - style.ItemSpacing.y * 2; float columnHeight = sectionHeight - style.ItemSpacing.y * 4; @@ -870,7 +870,7 @@ void Menu::DrawElement() { pos = ImVec2{ sectionCenterX + (sidebarWidth / 2), topY } + style.ItemSpacing * 2; window->DrawList->AddRectFilled(pos, pos + ImVec2{ 4, sectionHeight - style.FramePadding.y * 2 }, - ImGui::GetColorU32({ 255, 255, 255, 255 }), true, style.WindowRounding); + ImGui::GetColorU32({ 255, 255, 255, 255 }), style.WindowRounding); pos.x += 4 + style.ItemSpacing.x; ImGui::SetNextWindowPos(pos + style.ItemSpacing); float sectionWidth = menuSize.x - sidebarWidth - 4 - style.ItemSpacing.x * 4; diff --git a/soh/soh/gu_pc.c b/soh/soh/gu_pc.c index be1954a5d7..48daaad16f 100644 --- a/soh/soh/gu_pc.c +++ b/soh/soh/gu_pc.c @@ -9,8 +9,8 @@ void guMtxF2L(float mf[4][4], Mtx* m) { s32* m2 = &m->m[2][0]; for (r = 0; r < 4; r++) { for (c = 0; c < 2; c++) { - tmp1 = mf[r][2 * c] * 65536.0f; - tmp2 = mf[r][2 * c + 1] * 65536.0f; + tmp1 = (s32)(mf[r][2 * c] * 65536.0f); + tmp2 = (s32)(mf[r][2 * c + 1] * 65536.0f); *m1++ = (tmp1 & 0xffff0000) | ((tmp2 >> 0x10) & 0xffff); *m2++ = ((tmp1 << 0x10) & 0xffff0000) | (tmp2 & 0xffff); } @@ -52,7 +52,13 @@ void guMtxIdentF(f32 mf[4][4]) { } void guMtxIdent(Mtx* m) { +#ifdef GBI_FLOATS guMtxIdentF(m->m); +#else + float mf[4][4]; + guMtxIdentF(mf); + guMtxF2L(mf, m); +#endif } void guTranslateF(float m[4][4], float x, float y, float z) { diff --git a/soh/soh/resource/importer/AudioSampleFactory.cpp b/soh/soh/resource/importer/AudioSampleFactory.cpp index cdfe4311cc..065e6bb325 100644 --- a/soh/soh/resource/importer/AudioSampleFactory.cpp +++ b/soh/soh/resource/importer/AudioSampleFactory.cpp @@ -77,7 +77,7 @@ static int VorbisCloseCallback([[maybe_unused]] void* src) { static long VorbisTellCallback(void* src) { OggFileData* data = static_cast(src); - return data->pos; + return static_cast(data->pos); } static const ov_callbacks vorbisCallbacks = { @@ -286,12 +286,12 @@ ResourceFactoryXMLAudioSampleV0::ReadResource(std::shared_ptr file, audioSample->sample.loop = &audioSample->loop; size_t size = child->Int64Attribute("Size"); - audioSample->sample.size = size; + audioSample->sample.size = static_cast(size); const char* path = child->Attribute("Path"); auto sampleFile = Ship::Context::GetRawInstance()->GetResourceManager()->GetArchiveManager()->LoadFile(path); - audioSample->sample.fileSize = sampleFile->Buffer.get()->size(); + audioSample->sample.fileSize = static_cast(sampleFile->Buffer.get()->size()); if (customFormatStr != nullptr) { // Compressed files can take a really long time to decode (~250ms per). // This worked when we tested it (09/04/2024) (Works on my machine) diff --git a/soh/soh/resource/importer/AudioSequenceFactory.cpp b/soh/soh/resource/importer/AudioSequenceFactory.cpp index 5052acce2e..3cfc77515f 100644 --- a/soh/soh/resource/importer/AudioSequenceFactory.cpp +++ b/soh/soh/resource/importer/AudioSequenceFactory.cpp @@ -23,7 +23,7 @@ ResourceFactoryBinaryAudioSequenceV2::ReadResource(std::shared_ptr f audioSequence->sequence.seqDataSize = reader->ReadUInt32(); audioSequence->sequence.seqData = new char[audioSequence->sequence.seqDataSize]; - for (int32_t i = 0; i < audioSequence->sequence.seqDataSize; i++) { + for (int32_t i = 0; i < static_cast(audioSequence->sequence.seqDataSize); i++) { audioSequence->sequence.seqData[i] = reader->ReadChar(); } @@ -35,7 +35,7 @@ ResourceFactoryBinaryAudioSequenceV2::ReadResource(std::shared_ptr f for (int32_t i = 0; i < 16; i++) { audioSequence->sequence.fonts[i] = 0; } - for (int32_t i = 0; i < audioSequence->sequence.numFonts; i++) { + for (int32_t i = 0; i < static_cast(audioSequence->sequence.numFonts); i++) { audioSequence->sequence.fonts[i] = reader->ReadUByte(); } @@ -179,9 +179,9 @@ static void WriteMonoSingleSeq(Ship::BinaryWriter* writer, uint16_t delay, uint8 // We only have one channel WriteInitchan(writer, 0b11); // Store the current position so we can write the address of the channel when we are ready. - channelPlaceholderOff = writer->GetBaseAddress(); + channelPlaceholderOff = static_cast(writer->GetBaseAddress()); // Store the current position so we can loop here after the song ends. - loopPoint = writer->GetBaseAddress(); + loopPoint = static_cast(writer->GetBaseAddress()); WriteLdchan(writer, 0, 0); // Fill in the actual address later WriteVolSHeader(writer, 127); // Max volume @@ -195,13 +195,13 @@ static void WriteMonoSingleSeq(Ship::BinaryWriter* writer, uint16_t delay, uint8 writer->Write(static_cast(0xFF)); // Fill in the ldchan from before - channelStart = writer->GetBaseAddress(); + channelStart = static_cast(writer->GetBaseAddress()); writer->Seek(channelPlaceholderOff, Ship::SeekOffsetType::Start); WriteLdchan(writer, 0, channelStart); writer->Seek(channelStart, Ship::SeekOffsetType::Start); // Channel header - layerPlaceholderOff = writer->GetBaseAddress(); + layerPlaceholderOff = static_cast(writer->GetBaseAddress()); WriteNoshort(writer); WriteLdlayer(writer, 0, 0); WritePan(writer, 64); @@ -211,7 +211,7 @@ static void WriteMonoSingleSeq(Ship::BinaryWriter* writer, uint16_t delay, uint8 WriteDelay(writer, delay); writer->Write(static_cast(0xFF)); - layerStart = writer->GetBaseAddress(); + layerStart = static_cast(writer->GetBaseAddress()); writer->Seek(layerPlaceholderOff, Ship::SeekOffsetType::Start); WriteLdlayer(writer, 0, layerStart); writer->Seek(layerStart, Ship::SeekOffsetType::Start); @@ -232,7 +232,6 @@ static void WriteStereoSingleSeq(Ship::BinaryWriter* writer, uint16_t delay, uin uint16_t lLayerOffset; uint16_t rLayerOffset; - uint16_t layerStart; // Write seq header if (looped) { delay = 0x7FFF; @@ -244,9 +243,9 @@ static void WriteStereoSingleSeq(Ship::BinaryWriter* writer, uint16_t delay, uin // We only have one channel WriteInitchan(writer, 0b11); // Store the current position so we can write the address of the channel when we are ready. - channelPlaceholderOff = writer->GetBaseAddress(); + channelPlaceholderOff = static_cast(writer->GetBaseAddress()); // Store the current position so we can loop here after the song ends. - loopPoint = writer->GetBaseAddress(); + loopPoint = static_cast(writer->GetBaseAddress()); // Left note channel WriteLdchan(writer, 0, 0); // Fill in the actual address later // Right note channel @@ -262,10 +261,10 @@ static void WriteStereoSingleSeq(Ship::BinaryWriter* writer, uint16_t delay, uin WriteDisablecan(writer, 0b11); writer->Write(static_cast(0xFF)); - lChannelStart = writer->GetBaseAddress(); + lChannelStart = static_cast(writer->GetBaseAddress()); // Left Channel header WriteNoshort(writer); - lLayerPlaceholderOff = writer->GetBaseAddress(); + lLayerPlaceholderOff = static_cast(writer->GetBaseAddress()); WriteLdlayer(writer, 0, 0); WritePan(writer, 0); WriteVolCHeader(writer, 127); // Max volume @@ -274,10 +273,10 @@ static void WriteStereoSingleSeq(Ship::BinaryWriter* writer, uint16_t delay, uin WriteDelay(writer, delay); writer->Write(static_cast(0xFF)); - rChannelStart = writer->GetBaseAddress(); + rChannelStart = static_cast(writer->GetBaseAddress()); // Right Channel header WriteNoshort(writer); - rLayerPlaceholderOff = writer->GetBaseAddress(); + rLayerPlaceholderOff = static_cast(writer->GetBaseAddress()); WriteLdlayer(writer, 1, 0); WritePan(writer, 127); WriteVolCHeader(writer, 127); // Max volume @@ -285,20 +284,20 @@ static void WriteStereoSingleSeq(Ship::BinaryWriter* writer, uint16_t delay, uin WriteInstrument(writer, 1); WriteDelay(writer, delay); writer->Write(static_cast(0xFF)); - uint16_t placeHolder = writer->GetBaseAddress(); + uint16_t placeHolder = static_cast(writer->GetBaseAddress()); writer->Seek(channelPlaceholderOff, Ship::SeekOffsetType::Start); WriteLdchan(writer, 0, lChannelStart); WriteLdchan(writer, 1, rChannelStart); writer->Seek(placeHolder, Ship::SeekOffsetType::Start); // Left Note layer - lLayerOffset = writer->GetBaseAddress(); + lLayerOffset = static_cast(writer->GetBaseAddress()); WriteLegato(writer); WriteNotedvg(writer, 39, 0x7FFF - 1, static_cast(0x7F), static_cast(1)); writer->Write(static_cast(0xFF)); // Right Note layer - rLayerOffset = writer->GetBaseAddress(); + rLayerOffset = static_cast(writer->GetBaseAddress()); WriteLegato(writer); WriteNotedvg(writer, 39, 0x7FFF - 1, static_cast(0x7F), static_cast(1)); writer->Write(static_cast(0xFF)); @@ -346,7 +345,7 @@ ResourceFactoryXMLAudioSequenceV0::ReadResource(std::shared_ptr file } if (!streamed) { - sequence->sequence.seqDataSize = seqFile->Buffer.get()->size(); + sequence->sequence.seqDataSize = static_cast(seqFile->Buffer.get()->size()); sequence->sequence.seqData = new char[seqFile->Buffer.get()->size()]; memcpy(sequence->sequence.seqData, seqFile->Buffer.get()->data(), seqFile->Buffer.get()->size()); } else { @@ -354,7 +353,7 @@ ResourceFactoryXMLAudioSequenceV0::ReadResource(std::shared_ptr file // indicies. sequence->sequence.numFonts = -1; if (path != nullptr) { - sequence->sequence.seqDataSize = seqFile->Buffer.get()->size(); + sequence->sequence.seqDataSize = static_cast(seqFile->Buffer.get()->size()); sequence->sequence.seqData = new char[seqFile->Buffer.get()->size()]; memcpy(sequence->sequence.seqData, seqFile->Buffer.get()->data(), seqFile->Buffer.get()->size()); } else { @@ -377,14 +376,14 @@ ResourceFactoryXMLAudioSequenceV0::ReadResource(std::shared_ptr file if (delayF >= 65535.0f) { delay = 0x7FFF; } else { - delay = delayF; + delay = static_cast(delayF); } if (stereo) { WriteStereoSingleSeq(&writer, delay, TEMPO, looped); } else { WriteMonoSingleSeq(&writer, delay, TEMPO, looped); } - sequence->sequence.seqDataSize = writer.ToVector().size(); + sequence->sequence.seqDataSize = static_cast(writer.ToVector().size()); sequence->sequence.seqData = new char[sequence->sequence.seqDataSize]; memcpy(sequence->sequence.seqData, writer.ToVector().data(), sequence->sequence.seqDataSize); } diff --git a/soh/soh/resource/importer/AudioSoundFontFactory.cpp b/soh/soh/resource/importer/AudioSoundFontFactory.cpp index bb67ef29d9..4ef73e06a3 100644 --- a/soh/soh/resource/importer/AudioSoundFontFactory.cpp +++ b/soh/soh/resource/importer/AudioSoundFontFactory.cpp @@ -269,7 +269,7 @@ void ResourceFactoryXMLSoundFontV0::ParseDrums(AudioSoundFont* soundFont, tinyxm element = element->NextSiblingElement(); } while (element != nullptr); - soundFont->soundFont.numDrums = soundFont->drumAddresses.size(); + soundFont->soundFont.numDrums = static_cast(soundFont->drumAddresses.size()); soundFont->soundFont.drums = soundFont->drumAddresses.data(); } @@ -359,7 +359,7 @@ void ResourceFactoryXMLSoundFontV0::ParseInstruments(AudioSoundFont* soundFont, } while (element != nullptr); soundFont->soundFont.instruments = soundFont->instrumentAddresses.data(); - soundFont->soundFont.numInstruments = soundFont->instrumentAddresses.size(); + soundFont->soundFont.numInstruments = static_cast(soundFont->instrumentAddresses.size()); } void ResourceFactoryXMLSoundFontV0::ParseSfxTable(AudioSoundFont* soundFont, tinyxml2::XMLElement* element) { @@ -396,7 +396,7 @@ void ResourceFactoryXMLSoundFontV0::ParseSfxTable(AudioSoundFont* soundFont, tin } } soundFont->soundFont.soundEffects = soundFont->soundEffects.data(); - soundFont->soundFont.numSfx = soundFont->soundEffects.size(); + soundFont->soundFont.numSfx = static_cast(soundFont->soundEffects.size()); } std::vector SOH::ResourceFactoryXMLSoundFontV0::ParseEnvelopes(AudioSoundFont* soundFont, diff --git a/soh/soh/resource/importer/CollisionHeaderFactory.cpp b/soh/soh/resource/importer/CollisionHeaderFactory.cpp index 39bf885a03..8a024ec7f7 100644 --- a/soh/soh/resource/importer/CollisionHeaderFactory.cpp +++ b/soh/soh/resource/importer/CollisionHeaderFactory.cpp @@ -232,12 +232,12 @@ ResourceFactoryXMLCollisionHeaderV0::ReadResource(std::shared_ptr fi } } - collisionHeader->collisionHeaderData.numVertices = collisionHeader->vertices.size(); - collisionHeader->collisionHeaderData.numPolygons = collisionHeader->polygons.size(); - collisionHeader->surfaceTypesCount = collisionHeader->surfaceTypes.size(); - collisionHeader->camDataCount = collisionHeader->camData.size(); - collisionHeader->camPosCount = collisionHeader->camPosData.size(); - collisionHeader->collisionHeaderData.numWaterBoxes = collisionHeader->waterBoxes.size(); + collisionHeader->collisionHeaderData.numVertices = static_cast(collisionHeader->vertices.size()); + collisionHeader->collisionHeaderData.numPolygons = static_cast(collisionHeader->polygons.size()); + collisionHeader->surfaceTypesCount = static_cast(collisionHeader->surfaceTypes.size()); + collisionHeader->camDataCount = static_cast(collisionHeader->camData.size()); + collisionHeader->camPosCount = static_cast(collisionHeader->camPosData.size()); + collisionHeader->collisionHeaderData.numWaterBoxes = static_cast(collisionHeader->waterBoxes.size()); collisionHeader->collisionHeaderData.vtxList = collisionHeader->vertices.data(); collisionHeader->collisionHeaderData.polyList = collisionHeader->polygons.data(); diff --git a/soh/soh/resource/importer/SceneFactory.cpp b/soh/soh/resource/importer/SceneFactory.cpp index 730842b7e3..9383f7e2cc 100644 --- a/soh/soh/resource/importer/SceneFactory.cpp +++ b/soh/soh/resource/importer/SceneFactory.cpp @@ -74,7 +74,7 @@ ResourceFactoryBinarySceneV0::ParseSceneCommand(std::shared_ptr scene, std::shared_ptr reader, uint32_t index) { SceneCommandID cmdID = (SceneCommandID)reader->ReadInt32(); - reader->Seek(-sizeof(int32_t), Ship::SeekOffsetType::Current); + reader->Seek(-4, Ship::SeekOffsetType::Current); std::shared_ptr result = nullptr; auto commandFactory = ResourceFactoryBinarySceneV0::sceneCommandFactories[cmdID]; diff --git a/soh/soh/resource/importer/scenecommand/SetMeshFactory.cpp b/soh/soh/resource/importer/scenecommand/SetMeshFactory.cpp index 2f6bf55684..1edd994c1b 100644 --- a/soh/soh/resource/importer/scenecommand/SetMeshFactory.cpp +++ b/soh/soh/resource/importer/scenecommand/SetMeshFactory.cpp @@ -93,8 +93,8 @@ std::shared_ptr SetMeshFactory::ReadResource(std::shared_ptrmeshHeader.polygon1.format == 1) { setMesh->meshHeader.polygon1.single.source = image.source; setMesh->meshHeader.polygon1.single.unk_0C = image.unk_0C; - setMesh->meshHeader.polygon1.single.tlut = - (void*)image.tlut; // OTRTODO: type of bgimage.tlut should be uintptr_t + setMesh->meshHeader.polygon1.single.tlut = reinterpret_cast( + static_cast(image.tlut)); // OTRTODO: type of bgimage.tlut should be uintptr_t setMesh->meshHeader.polygon1.single.width = image.width; setMesh->meshHeader.polygon1.single.height = image.height; setMesh->meshHeader.polygon1.single.fmt = image.fmt; @@ -277,8 +277,8 @@ std::shared_ptr SetMeshFactoryXML::ReadResource(std::shared_ptr if (setMesh->meshHeader.polygon1.format == 1) { setMesh->meshHeader.polygon1.single.source = image.source; setMesh->meshHeader.polygon1.single.unk_0C = image.unk_0C; - setMesh->meshHeader.polygon1.single.tlut = - (void*)image.tlut; // OTRTODO: type of bgimage.tlut should be uintptr_t + setMesh->meshHeader.polygon1.single.tlut = reinterpret_cast( + static_cast(image.tlut)); // OTRTODO: type of bgimage.tlut should be uintptr_t setMesh->meshHeader.polygon1.single.width = image.width; setMesh->meshHeader.polygon1.single.height = image.height; setMesh->meshHeader.polygon1.single.fmt = image.fmt; diff --git a/soh/soh/stubs.c b/soh/soh/stubs.c index 118b36e724..f62034d4e4 100644 --- a/soh/soh/stubs.c +++ b/soh/soh/stubs.c @@ -31,6 +31,12 @@ u8 osAppNmiBuffer[2048]; f32 qNaN0x10000 = 0x7F810000; +// disable "must return a value" warnings +// TODO: Actually fix all of this +#if _MSC_VER +#pragma warning(disable : 4716) +#endif + // void gSPTextureRectangle(Gfx* pkt, s32 xl, s32 yl, s32 xh, s32 yh, u32 tile, u32 s, s32 t, u32 dsdx, u32 dtdy) //{ // __gSPTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy); @@ -231,7 +237,7 @@ s32 _Printf(PrintCallback a, void* arg, const char* fmt, va_list ap) { unsigned char buffer[4096]; vsnprintf(buffer, sizeof(buffer), fmt, ap); - a(arg, buffer, strlen(buffer)); + a(arg, buffer, (u32)strlen(buffer)); } void osSpTaskLoad(OSTask* task) {