From 771c2626b8323f31992ac3749ae6b95a214b5397 Mon Sep 17 00:00:00 2001 From: "Skyth (Asilkan)" <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Wed, 12 Feb 2025 21:19:40 +0300 Subject: [PATCH] Fix the gauges in Dark Gaia boss. (#381) * Apply offset scaling to Dark Gaia boss gauges. * Hide boss gauge in Inspire cutscenes. --- .../patches/aspect_ratio_patches.cpp | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/UnleashedRecomp/patches/aspect_ratio_patches.cpp b/UnleashedRecomp/patches/aspect_ratio_patches.cpp index 9292c43..9875d69 100644 --- a/UnleashedRecomp/patches/aspect_ratio_patches.cpp +++ b/UnleashedRecomp/patches/aspect_ratio_patches.cpp @@ -8,6 +8,7 @@ #include "aspect_ratio_patches.h" #include "camera_patches.h" +#include "inspire_patches.h" // These are here for now to not recompile basically all of the project. namespace Chao::CSD @@ -347,7 +348,9 @@ enum UNSTRETCH_HORIZONTAL = 1 << 19, - CORNER_EXTRACT = 1 << 20 + CORNER_EXTRACT = 1 << 20, + + SKIP_INSPIRE = 1 << 21, }; struct CsdModifier @@ -364,10 +367,10 @@ static const xxHashMap g_modifiers = { HashStr("ui_balloon/window/footer"), { ALIGN_BOTTOM } }, // ui_boss_gauge - { HashStr("ui_boss_gauge/gauge_bg"), { ALIGN_TOP_RIGHT | SCALE } }, - { HashStr("ui_boss_gauge/gauge_2"), { ALIGN_TOP_RIGHT | SCALE } }, - { HashStr("ui_boss_gauge/gauge_1"), { ALIGN_TOP_RIGHT | SCALE } }, - { HashStr("ui_boss_gauge/gauge_breakpoint"), { ALIGN_TOP_RIGHT | SCALE } }, + { HashStr("ui_boss_gauge/gauge_bg"), { ALIGN_TOP_RIGHT | SCALE | SKIP_INSPIRE} }, + { HashStr("ui_boss_gauge/gauge_2"), { ALIGN_TOP_RIGHT | SCALE | SKIP_INSPIRE} }, + { HashStr("ui_boss_gauge/gauge_1"), { ALIGN_TOP_RIGHT | SCALE | SKIP_INSPIRE} }, + { HashStr("ui_boss_gauge/gauge_breakpoint"), { ALIGN_TOP_RIGHT | SCALE | SKIP_INSPIRE} }, // ui_boss_name { HashStr("ui_boss_name/name_so/bg"), { UNSTRETCH_HORIZONTAL } }, @@ -585,8 +588,10 @@ static const xxHashMap g_modifiers = { HashStr("ui_playscreen_ev_hit/chance_attack"), { ALIGN_RIGHT | SCALE } }, // ui_playscreen_su - { HashStr("ui_playscreen_su/su_sonic_gauge"), { ALIGN_BOTTOM_LEFT | SCALE } }, - { HashStr("ui_playscreen_su/gaia_gauge"), { ALIGN_BOTTOM_LEFT | SCALE } }, + { HashStr("ui_playscreen_su/su_sonic_gauge"), { ALIGN_BOTTOM_LEFT | SCALE | OFFSET_SCALE_LEFT, 632.0f } }, + { HashStr("ui_playscreen_su/su_sonic_gauge/position/C/R"), { ALIGN_BOTTOM_LEFT | SCALE | STORE_RIGHT_CORNER } }, + { HashStr("ui_playscreen_su/gaia_gauge"), { ALIGN_BOTTOM_LEFT | SCALE | OFFSET_SCALE_LEFT, 632.0f } }, + { HashStr("ui_playscreen_su/gaia_gauge/position/C/R"), { ALIGN_BOTTOM_LEFT | SCALE | STORE_RIGHT_CORNER } }, { HashStr("ui_playscreen_su/footer"), { ALIGN_BOTTOM_RIGHT | SCALE } }, // ui_prov_playscreen @@ -922,6 +927,12 @@ static void Draw(PPCContext& ctx, uint8_t* base, PPCFunc* original, uint32_t str return; } + // That goddamn boss gauge doesn't disappear in the cutscene where Dark Gaia and Chip hug each other + if ((modifier.flags & SKIP_INSPIRE) != 0 && !InspirePatches::s_sceneName.empty() && *reinterpret_cast*>(base + ctx.r4.u32) >= 1280.0f) + { + return; + } + if (g_cornerExtract) { if ((modifier.flags & (STORE_LEFT_CORNER | STORE_RIGHT_CORNER)) != 0)