diff --git a/Runtime/GuiSys/CGuiWidgetDrawParms.cpp b/Runtime/GuiSys/CGuiWidgetDrawParms.cpp deleted file mode 100644 index 7c8af0db6..000000000 --- a/Runtime/GuiSys/CGuiWidgetDrawParms.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "Runtime/GuiSys/CGuiWidgetDrawParms.hpp" - -namespace urde { -const CGuiWidgetDrawParms CGuiWidgetDrawParms::Default = {}; -} diff --git a/Runtime/GuiSys/CGuiWidgetDrawParms.hpp b/Runtime/GuiSys/CGuiWidgetDrawParms.hpp index a5938c83c..ef1347e30 100644 --- a/Runtime/GuiSys/CGuiWidgetDrawParms.hpp +++ b/Runtime/GuiSys/CGuiWidgetDrawParms.hpp @@ -8,10 +8,11 @@ struct CGuiWidgetDrawParms { float x0_alphaMod = 1.f; zeus::CVector3f x4_cameraOffset; - CGuiWidgetDrawParms() = default; - CGuiWidgetDrawParms(float alphaMod, const zeus::CVector3f& cameraOff) + constexpr CGuiWidgetDrawParms() = default; + constexpr CGuiWidgetDrawParms(float alphaMod, const zeus::CVector3f& cameraOff) : x0_alphaMod(alphaMod), x4_cameraOffset(cameraOff) {} - static const CGuiWidgetDrawParms Default; + + static constexpr CGuiWidgetDrawParms Default() { return {}; } }; } // namespace urde diff --git a/Runtime/GuiSys/CHudDecoInterface.cpp b/Runtime/GuiSys/CHudDecoInterface.cpp index d24ccdc6d..0a1e77a81 100644 --- a/Runtime/GuiSys/CHudDecoInterface.cpp +++ b/Runtime/GuiSys/CHudDecoInterface.cpp @@ -324,7 +324,7 @@ void CHudDecoInterfaceScan::Update(float dt, const CStateManager& stateMgr) { void CHudDecoInterfaceScan::Draw() { x18_scanDisplay.Draw(); if (x10_loadedScanHudFlat) { - x10_loadedScanHudFlat->Draw(CGuiWidgetDrawParms::Default); + x10_loadedScanHudFlat->Draw(CGuiWidgetDrawParms::Default()); } } diff --git a/Runtime/GuiSys/CMakeLists.txt b/Runtime/GuiSys/CMakeLists.txt index 1af160716..5bc65002a 100644 --- a/Runtime/GuiSys/CMakeLists.txt +++ b/Runtime/GuiSys/CMakeLists.txt @@ -17,7 +17,7 @@ set(GUISYS_SOURCES CGuiTextPane.hpp CGuiTextPane.cpp CGuiTextSupport.hpp CGuiTextSupport.cpp CGuiWidget.hpp CGuiWidget.cpp - CGuiWidgetDrawParms.hpp CGuiWidgetDrawParms.cpp + CGuiWidgetDrawParms.hpp CSplashScreen.hpp CSplashScreen.cpp CGuiCompoundWidget.hpp CGuiCompoundWidget.cpp CSaveableState.hpp CSaveableState.cpp diff --git a/Runtime/MP1/CFrontEndUI.cpp b/Runtime/MP1/CFrontEndUI.cpp index ea3d64baa..4e73a5c31 100644 --- a/Runtime/MP1/CFrontEndUI.cpp +++ b/Runtime/MP1/CFrontEndUI.cpp @@ -296,7 +296,7 @@ CFrontEndUI::SNewFileSelectFrame::ProcessUserInput(const CFinalInput& input, CFr void CFrontEndUI::SNewFileSelectFrame::Draw() const { if (x1c_loadedFrame && x10c_saveReady) - x1c_loadedFrame->Draw(CGuiWidgetDrawParms::Default); + x1c_loadedFrame->Draw(CGuiWidgetDrawParms::Default()); } void CFrontEndUI::SNewFileSelectFrame::HandleActiveChange(CGuiTableGroup* active) { @@ -909,7 +909,7 @@ void CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::FinishedLoading() { SetUIText(EUIType::InsertPak); } -void CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::Draw() { x8_frme->Draw(CGuiWidgetDrawParms::Default); } +void CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::Draw() { x8_frme->Draw(CGuiWidgetDrawParms::Default()); } CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::SGBALinkFrame(CGuiFrame* linkFrame, CGBASupport* support, bool linkInProgress) @@ -1103,7 +1103,7 @@ void CFrontEndUI::SFusionBonusFrame::Draw() const { if (x0_gbaLinkFrame) x0_gbaLinkFrame->Draw(); else if (x24_loadedFrame) - x24_loadedFrame->Draw(CGuiWidgetDrawParms::Default); + x24_loadedFrame->Draw(CGuiWidgetDrawParms::Default()); } void CFrontEndUI::SFusionBonusFrame::DoCancel(CGuiTableGroup* caller) { @@ -1289,7 +1289,7 @@ CFrontEndUI::SFrontEndFrame::ProcessUserInput(const CFinalInput& input, CFrontEn return x4_action; } -void CFrontEndUI::SFrontEndFrame::Draw() const { x14_loadedFrme->Draw(CGuiWidgetDrawParms::Default); } +void CFrontEndUI::SFrontEndFrame::Draw() const { x14_loadedFrme->Draw(CGuiWidgetDrawParms::Default()); } void CFrontEndUI::SFrontEndFrame::HandleActiveChange(CGuiTableGroup* active) { active->SetColors(zeus::skWhite, zeus::CColor{0.627450f, 0.627450f, 0.627450f, 0.784313f}); diff --git a/Runtime/MP1/CSamusHud.cpp b/Runtime/MP1/CSamusHud.cpp index f7b632354..fdef4b36b 100644 --- a/Runtime/MP1/CSamusHud.cpp +++ b/Runtime/MP1/CSamusHud.cpp @@ -1429,7 +1429,7 @@ void CSamusHud::Draw(const CStateManager& mgr, float alpha, CInGameGuiManager::E } if (x274_loadedFrmeBaseHud) { - x274_loadedFrmeBaseHud->Draw(CGuiWidgetDrawParms::Default); + x274_loadedFrmeBaseHud->Draw(CGuiWidgetDrawParms::Default()); } } diff --git a/Runtime/MP1/CSaveGameScreen.cpp b/Runtime/MP1/CSaveGameScreen.cpp index 390fd2705..03f0cca84 100644 --- a/Runtime/MP1/CSaveGameScreen.cpp +++ b/Runtime/MP1/CSaveGameScreen.cpp @@ -329,7 +329,7 @@ void CSaveGameScreen::SetUIColors() { void CSaveGameScreen::Draw() const { SCOPED_GRAPHICS_DEBUG_GROUP("CSaveGameScreen::Draw", zeus::skPurple); if (x50_loadedFrame) - x50_loadedFrame->Draw(CGuiWidgetDrawParms::Default); + x50_loadedFrame->Draw(CGuiWidgetDrawParms::Default()); } void CSaveGameScreen::ContinueWithoutSaving() {