diff --git a/UnleashedRecomp/api/SWA.h b/UnleashedRecomp/api/SWA.h index f451f2b..d0c82c6 100644 --- a/UnleashedRecomp/api/SWA.h +++ b/UnleashedRecomp/api/SWA.h @@ -85,6 +85,7 @@ #include "SWA/Movie/MovieDisplayer.h" #include "SWA/Movie/MovieManager.h" #include "SWA/Object/Common/DashPanel/ObjDashPanel.h" +#include "SWA/Object/SonicStage/EU/RollingBarrel/ObjRollingBarrel.h" #include "SWA/Player/Character/EvilSonic/EvilSonic.h" #include "SWA/Player/Character/EvilSonic/EvilSonicContext.h" #include "SWA/Player/Character/EvilSonic/Hud/EvilHudGuide.h" diff --git a/UnleashedRecomp/api/SWA/Object/SonicStage/EU/RollingBarrel/ObjRollingBarrel.h b/UnleashedRecomp/api/SWA/Object/SonicStage/EU/RollingBarrel/ObjRollingBarrel.h new file mode 100644 index 0000000..644b453 --- /dev/null +++ b/UnleashedRecomp/api/SWA/Object/SonicStage/EU/RollingBarrel/ObjRollingBarrel.h @@ -0,0 +1,35 @@ +#pragma once + +#include + +namespace SWA +{ + class CObjRollingBarrel + { + public: + class CElement + { + public: + SWA_INSERT_PADDING(0xEC); + xpointer m_FieldEC; + SWA_INSERT_PADDING(0x20); + be m_Roll; + }; + + SWA_INSERT_PADDING(0xE8); + be m_GenerationTime; + SWA_INSERT_PADDING(0x09); + bool m_FieldF5; + SWA_INSERT_PADDING(0x0A); + be m_RandomRange; + be m_Field104; + }; + + SWA_ASSERT_OFFSETOF(CObjRollingBarrel::CElement, m_FieldEC, 0xEC); + SWA_ASSERT_OFFSETOF(CObjRollingBarrel::CElement, m_Roll, 0x110); + + SWA_ASSERT_OFFSETOF(CObjRollingBarrel, m_GenerationTime, 0xE8); + SWA_ASSERT_OFFSETOF(CObjRollingBarrel, m_FieldF5, 0xF5); + SWA_ASSERT_OFFSETOF(CObjRollingBarrel, m_RandomRange, 0x100); + SWA_ASSERT_OFFSETOF(CObjRollingBarrel, m_Field104, 0x104); +} diff --git a/UnleashedRecomp/patches/object_patches.cpp b/UnleashedRecomp/patches/object_patches.cpp index 39a038a..45e2822 100644 --- a/UnleashedRecomp/patches/object_patches.cpp +++ b/UnleashedRecomp/patches/object_patches.cpp @@ -1,8 +1,9 @@ +#include #include -#include #include +#include -// CObjFlame::CObjFlame +// SWA::CObjFlame::CObjFlame // A field is not zero initialized, // causing collisions to constantly get created // and slow down the game. @@ -28,7 +29,7 @@ void ObjBigBarrelAllocMidAsmHook(PPCRegister& r3) r3.u32 += sizeof(ObjBigBarrelEx); } -// CObjBigBarrel::CObjBigBarrel +// SWA::CObjBigBarrel::CObjBigBarrel PPC_FUNC_IMPL(__imp__sub_8271AC08); PPC_FUNC(sub_8271AC08) { diff --git a/UnleashedRecomp/ui/achievement_menu.cpp b/UnleashedRecomp/ui/achievement_menu.cpp index c0d65a2..2de46b9 100644 --- a/UnleashedRecomp/ui/achievement_menu.cpp +++ b/UnleashedRecomp/ui/achievement_menu.cpp @@ -76,6 +76,7 @@ static void DrawHeaderContainer(const char* text) { auto drawList = ImGui::GetBackgroundDrawList(); auto fontSize = Scale(24); + auto minTextSize = Scale(294.575989); auto textSize = g_fntNewRodinUB->CalcTextSizeA(fontSize, FLT_MAX, 0, text); auto cornerRadius = 23; auto textMarginX = Scale(16) + (Scale(cornerRadius) / 2); @@ -99,13 +100,12 @@ static void DrawHeaderContainer(const char* text) : Lerp(0, 1, colourMotion); ImVec2 min = { g_aspectRatioOffsetX + Scale(containerMarginX), g_aspectRatioOffsetY + Scale(136) }; - ImVec2 max = { min.x + textMarginX * 2 + textSize.x + Scale(5), g_aspectRatioOffsetY + Scale(196) }; + ImVec2 max = { std::max(min.x + minTextSize, min.x + textMarginX * 2 + textSize.x + Scale(5)), g_aspectRatioOffsetY + Scale(196) }; DrawPauseHeaderContainer(min, max, alpha); SetTextSkew((min.y + max.y) / 2.0f, Scale(3.0f)); - // TODO: Apply bevel. DrawTextWithOutline ( g_fntNewRodinUB, @@ -564,15 +564,12 @@ static void DrawContentContainer() // Draw separators. for (int i = 1; i <= 3; i++) { - auto lineMarginLeft = Scale(35); - auto lineMarginRight = Scale(55); - auto lineMarginY = Scale(2); + ImVec2 lineMin = { clipRectMin.x + Scale(35), clipRectMin.y + itemHeight * i + Scale(2) }; + ImVec2 lineMax = { clipRectMax.x - Scale(55), lineMin.y + Scale(1.3f) }; - ImVec2 lineMin = { clipRectMin.x + lineMarginLeft, clipRectMin.y + itemHeight * i + lineMarginY }; - ImVec2 lineMax = { clipRectMax.x - lineMarginRight, clipRectMin.y + itemHeight * i + lineMarginY }; - - drawList->AddLine(lineMin, lineMax, IM_COL32(163, 163, 163, 255)); - drawList->AddLine({ lineMin.x, lineMin.y + Scale(1) }, { lineMax.x, lineMax.y + Scale(1) }, IM_COL32(143, 148, 143, 255)); + SetAdditive(true); + drawList->AddRectFilled(lineMin, lineMax, IM_COL32(160, 160, 160, 60)); + SetAdditive(false); } for (auto& tpl : g_achievements)