Jeck - Signed/unsigned fix in resource manager, options save fix.
This commit is contained in:
@@ -2,6 +2,12 @@
|
||||
#define _WCACHEDRESOURCE_H_
|
||||
#include <hge/hgeparticle.h>
|
||||
|
||||
#if defined WIN32 || defined LINUX
|
||||
#define INVALID_MTEX ((GLuint) -1)
|
||||
#else
|
||||
#define INVALID_MTEX -1
|
||||
#endif
|
||||
|
||||
class WResource{
|
||||
public:
|
||||
friend class WResourceManager;
|
||||
|
||||
@@ -29,7 +29,7 @@ enum ENUM_RETRIEVE_STYLE{
|
||||
RETRIEVE_VRAM, //Retrieve it, and use vram if have to we create it. Must still remove it.
|
||||
RETRIEVE_MANAGE, //Makes resource permanent.
|
||||
RETRIEVE_THUMB, //Retrieve it as a thumbnail.
|
||||
CACHE_THUMB = RETRIEVE_THUMB, //Backwords compatibility.
|
||||
CACHE_THUMB = RETRIEVE_THUMB, //Backwards compatibility.
|
||||
};
|
||||
|
||||
enum ENUM_CACHE_SUBTYPE{
|
||||
|
||||
@@ -526,7 +526,6 @@ void OptionsList::save(){
|
||||
for (int i = 0; i < nbitems; i++){
|
||||
listItems[i]->setData();
|
||||
}
|
||||
::options.save();
|
||||
}
|
||||
|
||||
void OptionsList::Update(float dt){
|
||||
@@ -652,6 +651,8 @@ void OptionsMenu::save(){
|
||||
for(int x=0;x<MAX_OPTION_TABS;x++)
|
||||
if(tabs[x] != NULL)
|
||||
tabs[x]->save();
|
||||
|
||||
::options.save();
|
||||
}
|
||||
|
||||
bool OptionsMenu::isTab(string name){
|
||||
|
||||
@@ -234,7 +234,7 @@ bool WCachedTexture::Attempt(string filename, int submode, int & error){
|
||||
}
|
||||
|
||||
//Failure of a different sort.
|
||||
if(texture->mTexId == -1){
|
||||
if(texture->mTexId == INVALID_MTEX){
|
||||
SAFE_DELETE(texture);
|
||||
error = CACHE_ERROR_BAD;
|
||||
return false;
|
||||
|
||||
@@ -417,7 +417,7 @@ JTexture* WResourceManager::GetTexture(int id){
|
||||
for(it = textureWCache.managed.begin();it!= textureWCache.managed.end(); it++){
|
||||
if(it->second){
|
||||
jtex = it->second->Actual();
|
||||
if(jtex->mTexId == id)
|
||||
if(id == (int) jtex->mTexId)
|
||||
return jtex;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user