Changeset View
Changeset View
Standalone View
Standalone View
source/gui/CGUIText.cpp
/* Copyright (C) 2019 Wildfire Games. | /* Copyright (C) 2021 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 414 Lines • ▼ Show 20 Lines | if (j == static_cast<int>(string.m_Words.size()) - 2) | ||||
done = true; | done = true; | ||||
} | } | ||||
return done; | return done; | ||||
} | } | ||||
void CGUIText::Draw(CGUI& pGUI, const CGUIColor& DefaultColor, const CPos& pos, const float z, const CRect& clipping) const | void CGUIText::Draw(CGUI& pGUI, const CGUIColor& DefaultColor, const CPos& pos, const float z, const CRect& clipping) const | ||||
{ | { | ||||
OGL_SCOPED_DEBUG_GROUP("Draw GUI text"); | |||||
vladislavbelov: I'd prefer single name macro instead of duplicating. And the `group` word is too common and… | |||||
Not Done Inline ActionsShould be removed, the GUI code shouldn't have GL related stuff. The same for other GUI changes. vladislavbelov: Should be removed, the GUI code shouldn't have GL related stuff. The same for other GUI changes. | |||||
CShaderTechniquePtr tech = g_Renderer.GetShaderManager().LoadEffect(str_gui_text); | CShaderTechniquePtr tech = g_Renderer.GetShaderManager().LoadEffect(str_gui_text); | ||||
tech->BeginPass(); | tech->BeginPass(); | ||||
bool isClipped = clipping != CRect(); | bool isClipped = clipping != CRect(); | ||||
if (isClipped) | if (isClipped) | ||||
{ | { | ||||
glEnable(GL_SCISSOR_TEST); | glEnable(GL_SCISSOR_TEST); | ||||
Show All 32 Lines |
Wildfire Games · Phabricator
I'd prefer single name macro instead of duplicating. And the group word is too common and might be used in the code.