From 2f2b8f32fa0bc62258901069d0074fab26b7741a Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Tue, 13 Feb 2024 16:01:18 +0800 Subject: [PATCH] Remove indirect Graphics() access in BrushSelecting() --- src/game/editor/mapitems/layer_tiles.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/editor/mapitems/layer_tiles.cpp b/src/game/editor/mapitems/layer_tiles.cpp index d040bb4c0..ba51d29ae 100644 --- a/src/game/editor/mapitems/layer_tiles.cpp +++ b/src/game/editor/mapitems/layer_tiles.cpp @@ -251,12 +251,12 @@ bool CLayerTiles::IsEmpty(const std::shared_ptr &pLayer) void CLayerTiles::BrushSelecting(CUIRect Rect) { Graphics()->TextureClear(); - m_pEditor->Graphics()->QuadsBegin(); - m_pEditor->Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.4f); + Graphics()->QuadsBegin(); + Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.4f); Snap(&Rect); IGraphics::CQuadItem QuadItem(Rect.x, Rect.y, Rect.w, Rect.h); - m_pEditor->Graphics()->QuadsDrawTL(&QuadItem, 1); - m_pEditor->Graphics()->QuadsEnd(); + Graphics()->QuadsDrawTL(&QuadItem, 1); + Graphics()->QuadsEnd(); char aBuf[16]; str_format(aBuf, sizeof(aBuf), "%d⨯%d", ConvertX(Rect.w), ConvertY(Rect.h)); TextRender()->Text(Rect.x + 3.0f, Rect.y + 3.0f, m_pEditor->m_ShowPicker ? 15.0f : m_pEditor->MapView()->ScaleLength(15.0f), aBuf, -1.0f);