Remove indirect Graphics() access in BrushSelecting()

This commit is contained in:
ChillerDragon 2024-02-13 16:01:18 +08:00
parent c85be52409
commit 2f2b8f32fa

View file

@ -251,12 +251,12 @@ bool CLayerTiles::IsEmpty(const std::shared_ptr<CLayerTiles> &pLayer)
void CLayerTiles::BrushSelecting(CUIRect Rect) void CLayerTiles::BrushSelecting(CUIRect Rect)
{ {
Graphics()->TextureClear(); Graphics()->TextureClear();
m_pEditor->Graphics()->QuadsBegin(); Graphics()->QuadsBegin();
m_pEditor->Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.4f); Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.4f);
Snap(&Rect); Snap(&Rect);
IGraphics::CQuadItem QuadItem(Rect.x, Rect.y, Rect.w, Rect.h); IGraphics::CQuadItem QuadItem(Rect.x, Rect.y, Rect.w, Rect.h);
m_pEditor->Graphics()->QuadsDrawTL(&QuadItem, 1); Graphics()->QuadsDrawTL(&QuadItem, 1);
m_pEditor->Graphics()->QuadsEnd(); Graphics()->QuadsEnd();
char aBuf[16]; char aBuf[16];
str_format(aBuf, sizeof(aBuf), "%d%d", ConvertX(Rect.w), ConvertY(Rect.h)); 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); 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);