2018-09-23 19:31:33 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
struct lcStringCacheEntry
|
|
|
|
{
|
|
|
|
int Left, Right, Top, Bottom;
|
|
|
|
};
|
|
|
|
|
|
|
|
class lcStringCache
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
lcStringCache();
|
|
|
|
~lcStringCache();
|
|
|
|
|
|
|
|
void AddRef(lcContext* Context);
|
|
|
|
void Release(lcContext* Context);
|
|
|
|
|
2018-09-29 19:45:21 -07:00
|
|
|
void CacheStrings(const QStringList& Strings);
|
2018-09-23 19:31:33 -07:00
|
|
|
void GetStringDimensions(int* cx, int* cy, const QString& String) const;
|
|
|
|
void DrawStrings(lcContext* Context, const lcMatrix44* Transforms, const QStringList& Strings) const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
lcTexture* mTexture;
|
|
|
|
int mRefCount;
|
|
|
|
|
|
|
|
std::map<QString, lcStringCacheEntry> mStrings;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern lcStringCache gStringCache;
|