Fixed image management
This commit is contained in:
parent
983019f187
commit
f4db0992ef
@ -51,6 +51,7 @@ namespace spades {
|
||||
if(it == images.end()){
|
||||
GLImage *img = CreateImage(name);
|
||||
images[name] = img;
|
||||
img->AddRef();
|
||||
return img;
|
||||
}
|
||||
it->second->AddRef();
|
||||
@ -60,16 +61,7 @@ namespace spades {
|
||||
GLImage *GLImageManager::CreateImage(const std::string &name) {
|
||||
SPADES_MARK_FUNCTION();
|
||||
|
||||
Bitmap *bmp;
|
||||
bmp = Bitmap::Load(name);
|
||||
/*
|
||||
IStream *stream = FileManager::OpenForReading(name.c_str());
|
||||
try{
|
||||
bmp = Bitmap::FromTarga(stream);
|
||||
}catch(...){
|
||||
delete stream;
|
||||
throw;
|
||||
}*/
|
||||
Handle<Bitmap> bmp(Bitmap::Load(name), false);
|
||||
|
||||
return GLImage::FromBitmap(bmp, device);
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ namespace spades {
|
||||
if(it == models.end()){
|
||||
GLModel *m = CreateModel(name);
|
||||
models[name] = m;
|
||||
m->AddRef();
|
||||
return m;
|
||||
}
|
||||
it->second->AddRef(); // model manager owns this reference
|
||||
|
Loading…
x
Reference in New Issue
Block a user