From b99122dae86396d8216508a02d62bda96b248cf1 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 5 Apr 2020 07:12:05 -0400 Subject: [PATCH] CFrontEndUI: Remove use of const_cast in Draw() These casts are no longer necessary. --- Runtime/MP1/CFrontEndUI.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Runtime/MP1/CFrontEndUI.cpp b/Runtime/MP1/CFrontEndUI.cpp index d63175e44..6fedaf6f3 100644 --- a/Runtime/MP1/CFrontEndUI.cpp +++ b/Runtime/MP1/CFrontEndUI.cpp @@ -1949,12 +1949,13 @@ void CFrontEndUI::Draw() { if (x64_pressStartAlpha > 0.f && x38_pressStart.IsLoaded() && m_pressStartQuad) { /* Render "Press Start" */ - zeus::CRectangle rect(0.5f - x38_pressStart->GetWidth() / 2.f / 640.f * hPad, - 0.5f + (x38_pressStart->GetHeight() / 2.f - 240.f + 72.f) / 480.f * vPad, - x38_pressStart->GetWidth() / 640.f * hPad, x38_pressStart->GetHeight() / 480.f * vPad); + const zeus::CRectangle rect(0.5f - x38_pressStart->GetWidth() / 2.f / 640.f * hPad, + 0.5f + (x38_pressStart->GetHeight() / 2.f - 240.f + 72.f) / 480.f * vPad, + x38_pressStart->GetWidth() / 640.f * hPad, + x38_pressStart->GetHeight() / 480.f * vPad); zeus::CColor color = zeus::skWhite; color.a() = x64_pressStartAlpha; - const_cast(*m_pressStartQuad).draw(color, 1.f, rect); + m_pressStartQuad->draw(color, 1.f, rect); } if (xc0_attractCount > 0) { @@ -1965,7 +1966,7 @@ void CFrontEndUI::Draw() { /* To black */ zeus::CColor color = zeus::skBlack; color.a() = 1.f - x58_fadeBlackTimer; - const_cast(m_fadeToBlack).draw(color); + m_fadeToBlack.draw(color); } } @@ -1975,12 +1976,12 @@ void CFrontEndUI::Draw() { /* To black */ zeus::CColor color = zeus::skBlack; color.a() = zeus::clamp(0.f, 1.f - x58_fadeBlackTimer, 1.f); - const_cast(m_fadeToBlack).draw(color); + m_fadeToBlack.draw(color); } else if (x50_curScreen == EScreen::Title && x54_nextScreen == EScreen::Title) { /* From black with 30-sec skip to title */ zeus::CColor color = zeus::skBlack; color.a() = 1.f - zeus::clamp(0.f, 30.f - x58_fadeBlackTimer, 1.f); - const_cast(m_fadeToBlack).draw(color); + m_fadeToBlack.draw(color); } }