Jeck - Signed/unsigned fix in resource manager, options save fix.

This commit is contained in:
wagic.jeck
2009-09-14 18:30:47 +00:00
parent 0eb79c23b9
commit 5467fd379f
5 changed files with 11 additions and 4 deletions

View File

@@ -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;

View File

@@ -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{

View File

@@ -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){

View File

@@ -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;

View File

@@ -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;
}
}