From 0aff4dc21ed47c6e68e988cd02ecf183f62b1315 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 29 Mar 2020 04:36:52 -0400 Subject: [PATCH] CTextRenderBuffer: Remove use of const_cast within Render() Same behavior but way less casting. --- Runtime/GuiSys/CGuiTextSupport.cpp | 4 ++-- Runtime/GuiSys/CGuiTextSupport.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Runtime/GuiSys/CGuiTextSupport.cpp b/Runtime/GuiSys/CGuiTextSupport.cpp index e343d35a6..3f8834f48 100644 --- a/Runtime/GuiSys/CGuiTextSupport.cpp +++ b/Runtime/GuiSys/CGuiTextSupport.cpp @@ -186,8 +186,8 @@ void CGuiTextSupport::AutoSetExtent() { x38_extentY = bounds.second.y; } -void CGuiTextSupport::Render() const { - const_cast(this)->CheckAndRebuildRenderBuffer(); +void CGuiTextSupport::Render() { + CheckAndRebuildRenderBuffer(); if (CTextRenderBuffer* buf = GetCurrentPageRenderBuffer()) { SCOPED_GRAPHICS_DEBUG_GROUP("CGuiTextSupport::Draw", zeus::skBlue); zeus::CTransform oldModel = CGraphics::g_GXModelMatrix; diff --git a/Runtime/GuiSys/CGuiTextSupport.hpp b/Runtime/GuiSys/CGuiTextSupport.hpp index fa7ecd1b6..3ca0dc5ab 100644 --- a/Runtime/GuiSys/CGuiTextSupport.hpp +++ b/Runtime/GuiSys/CGuiTextSupport.hpp @@ -104,7 +104,7 @@ public: const std::pair& GetBounds(); void AutoSetExtent(); - void Render() const; + void Render(); void SetGeometryColor(const zeus::CColor& col); void SetOutlineColor(const zeus::CColor& col); void SetFontColor(const zeus::CColor& col);