Changeset View
Changeset View
Standalone View
Standalone View
source/gui/CGUISprite.h
Show First 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | |||||
class CGUISpriteInstance | class CGUISpriteInstance | ||||
{ | { | ||||
public: | public: | ||||
CGUISpriteInstance(); | CGUISpriteInstance(); | ||||
CGUISpriteInstance(const CStr& SpriteName); | CGUISpriteInstance(const CStr& SpriteName); | ||||
CGUISpriteInstance(const CGUISpriteInstance& Sprite); | CGUISpriteInstance(const CGUISpriteInstance& Sprite); | ||||
CGUISpriteInstance& operator=(const CGUISpriteInstance&); | CGUISpriteInstance& operator=(const CGUISpriteInstance&); | ||||
CGUISpriteInstance& operator=(const CStr& SpriteName); | CGUISpriteInstance& operator=(const CStr& SpriteName); | ||||
void Draw(CRect Size, int CellID, std::map<CStr, CGUISprite*>& Sprites, float Z) const; | void Draw(const CGUI* guiPage, CRect Size, int CellID, std::map<CStr, CGUISprite*>& Sprites, float Z) const; | ||||
void Invalidate(); | void Invalidate(); | ||||
bool IsEmpty() const; | bool IsEmpty() const; | ||||
const CStr& GetName() { return m_SpriteName; } | const CStr& GetName() { return m_SpriteName; } | ||||
private: | private: | ||||
CStr m_SpriteName; | CStr m_SpriteName; | ||||
// Stored drawing calls, for more efficient rendering | // Stored drawing calls, for more efficient rendering | ||||
mutable GUIRenderer::DrawCalls m_DrawCallCache; | mutable GUIRenderer::DrawCalls m_DrawCallCache; | ||||
// Relevant details of previously rendered sprite; the cache is invalidated | // Relevant details of previously rendered sprite; the cache is invalidated | ||||
// whenever any of these values changes. | // whenever any of these values changes. | ||||
mutable CRect m_CachedSize; | mutable CRect m_CachedSize; | ||||
mutable int m_CachedCellID; | mutable int m_CachedCellID; | ||||
}; | }; | ||||
#endif // INCLUDED_CGUISPRITE | #endif // INCLUDED_CGUISPRITE |
Wildfire Games · Phabricator