Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/CGUISprite.h
Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
public: | public: | ||||
NONCOPYABLE(CGUISpriteInstance); | NONCOPYABLE(CGUISpriteInstance); | ||||
MOVABLE(CGUISpriteInstance); | MOVABLE(CGUISpriteInstance); | ||||
CGUISpriteInstance(); | CGUISpriteInstance(); | ||||
CGUISpriteInstance(const CStr& SpriteName); | CGUISpriteInstance(const CStr& SpriteName); | ||||
void Draw(const CRect& Size, int CellID, std::map<CStr, const CGUISprite*>& Sprites, float Z) const; | void Draw(const CGUI* pGUI, const CRect& Size, int CellID, std::map<CStr, const CGUISprite*>& Sprites, float Z) const; | ||||
bool IsEmpty() const; | bool IsEmpty() const; | ||||
const CStr& GetName() const { return m_SpriteName; } | const CStr& GetName() const { return m_SpriteName; } | ||||
void SetName(const CStr& SpriteName); | void SetName(const CStr& 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