Changeset View
Changeset View
Standalone View
Standalone View
source/gui/CGUIText.cpp
Show First 20 Lines • Show All 446 Lines • ▼ Show 20 Lines | void CGUIText::Draw(CGUI* pGUI, const CGUIColor& DefaultColor, const CPos& pos, const float z, const CRect& clipping) const | ||||
textRenderer.Translate(0.0f, 0.0f, z); | textRenderer.Translate(0.0f, 0.0f, z); | ||||
for (const STextCall& tc : m_TextCalls) | for (const STextCall& tc : m_TextCalls) | ||||
{ | { | ||||
// If this is just a placeholder for a sprite call, continue | // If this is just a placeholder for a sprite call, continue | ||||
if (tc.m_pSpriteCall) | if (tc.m_pSpriteCall) | ||||
continue; | continue; | ||||
CGUIColor color = tc.m_UseCustomColor ? tc.m_Color : DefaultColor; | textRenderer.Color(tc.m_UseCustomColor ? tc.m_Color : DefaultColor); | ||||
textRenderer.Color(color); | |||||
textRenderer.Font(tc.m_Font); | textRenderer.Font(tc.m_Font); | ||||
textRenderer.Put(floorf(pos.x + tc.m_Pos.x), floorf(pos.y + tc.m_Pos.y), &tc.m_String); | textRenderer.Put(floorf(pos.x + tc.m_Pos.x), floorf(pos.y + tc.m_Pos.y), &tc.m_String); | ||||
} | } | ||||
textRenderer.Render(); | textRenderer.Render(); | ||||
for (const SSpriteCall& sc : m_SpriteCalls) | for (const SSpriteCall& sc : m_SpriteCalls) | ||||
pGUI->DrawSprite(sc.m_Sprite, sc.m_CellID, z, sc.m_Area + pos); | pGUI->DrawSprite(sc.m_Sprite, sc.m_CellID, z, sc.m_Area + pos); | ||||
if (isClipped) | if (isClipped) | ||||
glDisable(GL_SCISSOR_TEST); | glDisable(GL_SCISSOR_TEST); | ||||
tech->EndPass(); | tech->EndPass(); | ||||
} | } |
Wildfire Games · Phabricator