Jeck - CommonRes transparently finds themed versions of files. Use JRenderer::LoadTexture for unthemed files, and CommonRes::LoadTexture for themed files. Res/graphics/back.jpg renamed to Res/graphics/backdrop.jpg due to collision with sets/back.jpg.
This commit is contained in:
47
projects/mtg/include/WResourceManager.h
Normal file
47
projects/mtg/include/WResourceManager.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#ifndef _WRESOURCEMANAGER_H_
|
||||
#define _WRESOURCEMANAGER_H_
|
||||
#include <JResourceManager.h>
|
||||
#include <JTypes.h>
|
||||
|
||||
//This class is a wrapper for JResourceManager
|
||||
class WResourceManager
|
||||
{
|
||||
public:
|
||||
WResourceManager();
|
||||
~WResourceManager();
|
||||
|
||||
//Wrapped from JResourceManager
|
||||
int CreateTexture(const string &textureName);
|
||||
JTexture* GetTexture(const string &textureName);
|
||||
JTexture* GetTexture(int id);
|
||||
|
||||
int CreateQuad(const string &quadName, const string &textureName, float x, float y, float width, float height);
|
||||
JQuad* GetQuad(const string &quadName);
|
||||
JQuad* GetQuad(int id);
|
||||
|
||||
int LoadJLBFont(const string &fontName, int height);
|
||||
JLBFont* GetJLBFont(const string &fontName);
|
||||
JLBFont* GetJLBFont(int id);
|
||||
|
||||
int LoadMusic(const string &musicName);
|
||||
JMusic* GetMusic(const string &musicName);
|
||||
JMusic* GetMusic(int id);
|
||||
|
||||
int LoadSample(const string &sampleName);
|
||||
JSample* GetSample(const string &sampleName);
|
||||
JSample* GetSample(int id);
|
||||
|
||||
//Wrapped from JRenderer, if we need it.
|
||||
JTexture* LoadTexture(const char* filename, int mode = 0, int textureFormat = TEXTURE_FORMAT);
|
||||
|
||||
//Our new redirect system.
|
||||
string graphicsFile(const string filename, const string specific = "");
|
||||
string musicFile(const string filename, const string specific = "");
|
||||
string sfxFile(const string filename, const string specific = "");
|
||||
bool fileOK(string filename, bool relative = false);
|
||||
|
||||
private:
|
||||
static JResourceManager * jrm;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user