Files

36 lines
741 B
C++
Raw Permalink Normal View History

2019-01-18 21:26:42 +01:00
#pragma once
#include <set>
#include <string>
#include <vector>
2014-01-31 08:23:00 +13:00
2019-01-18 21:26:42 +01:00
class gxCanvas;
2014-01-31 08:23:00 +13:00
2019-01-18 21:26:42 +01:00
class CachedTexture {
2019-01-18 17:04:17 +01:00
public:
2019-01-18 21:26:42 +01:00
CachedTexture(int w, int h, int flags, int cnt);
CachedTexture(const std::string& f, int flags, int w, int h, int first, int cnt);
CachedTexture(const CachedTexture& t);
~CachedTexture();
2014-01-31 08:23:00 +13:00
2019-01-18 21:26:42 +01:00
CachedTexture& operator=(const CachedTexture& t);
2014-01-31 08:23:00 +13:00
2019-01-18 21:26:42 +01:00
std::string getName() const;
2014-01-31 08:23:00 +13:00
2019-01-18 21:26:42 +01:00
const std::vector<gxCanvas*>& getFrames() const;
2014-01-31 08:23:00 +13:00
2019-01-18 21:26:42 +01:00
bool operator<(const CachedTexture& t) const
2019-01-18 17:04:17 +01:00
{
return rep < t.rep;
}
2014-01-31 08:23:00 +13:00
2019-01-18 21:26:42 +01:00
static void setPath(const std::string& t);
2014-01-31 08:23:00 +13:00
2019-01-18 17:04:17 +01:00
private:
2019-01-18 21:26:42 +01:00
struct CTInstance;
CTInstance* rep;
2014-01-31 08:23:00 +13:00
2019-01-18 21:26:42 +01:00
CTInstance* findRep(const std::string& f, int flags, int w, int h, int first, int cnt);
2014-01-31 08:23:00 +13:00
2019-01-18 21:26:42 +01:00
static std::set<CTInstance*> rep_set;
2014-01-31 08:23:00 +13:00
};