Page MenuHomePhabricator (Chris)

resource.h
No OneTemporary

Authored By
Unknown
Size
931 B
Referenced Files
None
Subscribers
None

resource.h

#ifndef _paintown_resource_manager_h
#define _paintown_resource_manager_h
#include "factory/collector.h"
#include "file-system.h"
#include "thread.h"
#include <map>
#include <string>
#include <vector>
class Sound;
namespace Graphics{
class Bitmap;
}
/* thread-safe */
class Resource{
public:
/* do not prepend Util::getDataPath() to paths. Resource will do it for you.
*/
static Sound * getSound(const Filesystem::RelativePath & path);
static Graphics::Bitmap * getBitmap(const Filesystem::RelativePath & path);
private:
friend class Collector;
Resource();
virtual ~Resource();
Sound * _getSound(const Filesystem::AbsolutePath & path);
Graphics::Bitmap * _getBitmap(const Filesystem::AbsolutePath & path);
private:
static Resource * resource;
std::map<std::string, Sound*> sounds;
std::map<std::string, Graphics::Bitmap*> bitmaps;
Util::Thread::LockObject lock;
};
#endif

File Metadata

Mime Type
text/x-c++
Expires
Sat, Nov 14, 3:06 PM (3 m, 52 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
124403
Default Alt Text
resource.h (931 B)

Event Timeline