Changeset View
Changeset View
Standalone View
Standalone View
source/gui/GUIRenderer.cpp
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
DrawCalls& DrawCalls::operator=(const DrawCalls&) | DrawCalls& DrawCalls::operator=(const DrawCalls&) | ||||
{ | { | ||||
return *this; | return *this; | ||||
} | } | ||||
void GUIRenderer::UpdateDrawCallCache(DrawCalls& Calls, const CStr& SpriteName, const CRect& Size, int CellID, std::map<CStr, CGUISprite*>& Sprites) | void GUIRenderer::UpdateDrawCallCache(const CGUI* guiPage, DrawCalls& Calls, const CStr& SpriteName, const CRect& Size, int CellID, std::map<CStr, CGUISprite*>& Sprites) | ||||
{ | { | ||||
// This is called only when something has changed (like the size of the | // This is called only when something has changed (like the size of the | ||||
// sprite), so it doesn't need to be particularly efficient. | // sprite), so it doesn't need to be particularly efficient. | ||||
// Clean up the old data | // Clean up the old data | ||||
Calls.clear(); | Calls.clear(); | ||||
// If this object has zero size, there's nothing to render. (This happens | // If this object has zero size, there's nothing to render. (This happens | ||||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | else if (SpriteName.Find("cropped:") != -1) | ||||
Sprites[SpriteName] = Sprite; | Sprites[SpriteName] = Sprite; | ||||
} | } | ||||
if (SpriteName.Find("color:") != -1) | if (SpriteName.Find("color:") != -1) | ||||
{ | { | ||||
CStrW value = wstring_from_utf8(SpriteName.AfterLast("color:").BeforeFirst(":")); | CStrW value = wstring_from_utf8(SpriteName.AfterLast("color:").BeforeFirst(":")); | ||||
CColor color; | CColor color; | ||||
// Check color is valid | // Check color is valid | ||||
if (!GUI<CColor>::ParseString(value, color)) | if (!GUI<CColor>::ParseString(guiPage, value, color)) | ||||
{ | { | ||||
LOGERROR("GUI: Error parsing sprite 'color' (\"%s\")", utf8_from_wstring(value)); | LOGERROR("GUI: Error parsing sprite 'color' (\"%s\")", utf8_from_wstring(value)); | ||||
return; | return; | ||||
} | } | ||||
SGUIImage* Image = new SGUIImage; | SGUIImage* Image = new SGUIImage; | ||||
// If we are using a mask, this is an effect. | // If we are using a mask, this is an effect. | ||||
▲ Show 20 Lines • Show All 313 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator