Minor const-related code cleanup.
parent
6215d145c8
commit
d8b97ddc2f
|
@ -32,13 +32,13 @@ MeshManager::~MeshManager()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool MeshManager::find(string name, Mesh** mesh)
|
bool MeshManager::find(const string& name, Mesh** mesh)
|
||||||
{
|
{
|
||||||
return findResource(name, (void**) mesh);
|
return findResource(name, (void**) mesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Mesh* MeshManager::load(string name)
|
Mesh* MeshManager::load(const string& name)
|
||||||
{
|
{
|
||||||
DPRINTF("Loading mesh: %s\n", name.c_str());
|
DPRINTF("Loading mesh: %s\n", name.c_str());
|
||||||
ContentType fileType = DetermineFileType(name);
|
ContentType fileType = DetermineFileType(name);
|
||||||
|
|
|
@ -24,8 +24,8 @@ class MeshManager : public ResourceManager
|
||||||
MeshManager(char* _baseDir) : ResourceManager(_baseDir) {};
|
MeshManager(char* _baseDir) : ResourceManager(_baseDir) {};
|
||||||
~MeshManager();
|
~MeshManager();
|
||||||
|
|
||||||
bool find(string name, Mesh**);
|
bool find(const string& name, Mesh**);
|
||||||
Mesh* load(string name);
|
Mesh* load(const string& name);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _MESHMANAGER_H_
|
#endif // _MESHMANAGER_H_
|
||||||
|
|
|
@ -37,7 +37,7 @@ ResourceManager::~ResourceManager()
|
||||||
// in res and return true. Otherwise, leave res untouched and return false.
|
// in res and return true. Otherwise, leave res untouched and return false.
|
||||||
// find() can be safely called with res == NULL just to test whether or not
|
// find() can be safely called with res == NULL just to test whether or not
|
||||||
// the resource is resident.
|
// the resource is resident.
|
||||||
bool ResourceManager::findResource(string name, void** res)
|
bool ResourceManager::findResource(const string& name, void** res)
|
||||||
{
|
{
|
||||||
ResourceTable::iterator iter = resources.find(name);
|
ResourceTable::iterator iter = resources.find(name);
|
||||||
if (iter != resources.end())
|
if (iter != resources.end())
|
||||||
|
@ -53,7 +53,7 @@ bool ResourceManager::findResource(string name, void** res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ResourceManager::addResource(string name, void* res)
|
void ResourceManager::addResource(const string& name, void* res)
|
||||||
{
|
{
|
||||||
resources.insert(ResourceTable::value_type(name, res));
|
resources.insert(ResourceTable::value_type(name, res));
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,17 +19,17 @@ class ResourceManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ResourceManager();
|
ResourceManager();
|
||||||
ResourceManager(string _baseDir);
|
ResourceManager(std::string _baseDir);
|
||||||
ResourceManager(char* _baseDir);
|
ResourceManager(char* _baseDir);
|
||||||
~ResourceManager();
|
~ResourceManager();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool findResource(string name, void**);
|
bool findResource(const std::string& name, void**);
|
||||||
void addResource(string name, void*);
|
void addResource(const std::string& name, void*);
|
||||||
string baseDir;
|
std::string baseDir;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef std::map<string, void*> ResourceTable;
|
typedef std::map<std::string, void*> ResourceTable;
|
||||||
|
|
||||||
ResourceTable resources;
|
ResourceTable resources;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue