mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 11:42:31 +01:00
- small bugfix for lazy loading textures
This commit is contained in:
parent
62821793c0
commit
c442328b58
@ -206,33 +206,35 @@ void CoreData::loadTextureIfRequired(Texture2D **tex,string data_path,
|
||||
itemLoadAttempted[texSystemId] = true;
|
||||
}
|
||||
|
||||
Renderer &renderer = Renderer::getInstance();
|
||||
*tex = renderer.newTexture2D(rsGlobal);
|
||||
if (*tex) {
|
||||
if(attemptToLoadTexture == true) {
|
||||
Renderer &renderer = Renderer::getInstance();
|
||||
*tex = renderer.newTexture2D(rsGlobal);
|
||||
if (*tex) {
|
||||
|
||||
(*tex)->setForceCompressionDisabled(compressionDisabled);
|
||||
(*tex)->setMipmap(setMipMap);
|
||||
if(setAlpha == true) {
|
||||
(*tex)->setForceCompressionDisabled(compressionDisabled);
|
||||
(*tex)->setMipmap(setMipMap);
|
||||
if(setAlpha == true) {
|
||||
|
||||
(*tex)->setFormat(Texture::fAlpha);
|
||||
(*tex)->getPixmap()->init(1);
|
||||
}
|
||||
|
||||
try {
|
||||
string fileToLoad = uniqueFilePath;
|
||||
if(loadUniqueFilePath == false) {
|
||||
|
||||
fileToLoad = getGameCustomCoreDataPath(data_path,uniqueFilePath);
|
||||
(*tex)->setFormat(Texture::fAlpha);
|
||||
(*tex)->getPixmap()->init(1);
|
||||
}
|
||||
(*tex)->getPixmap()->load(fileToLoad);
|
||||
(*tex)->setTextureSystemId(texSystemId);
|
||||
|
||||
renderer.initTexture(rsGlobal,*tex);
|
||||
}
|
||||
catch (const megaglest_runtime_error& ex) {
|
||||
message(ex.what(),GlobalStaticFlags::getIsNonGraphicalModeEnabled(),
|
||||
tempDataLocation);
|
||||
cleanupTexture (tex);
|
||||
try {
|
||||
string fileToLoad = uniqueFilePath;
|
||||
if(loadUniqueFilePath == false) {
|
||||
|
||||
fileToLoad = getGameCustomCoreDataPath(data_path,uniqueFilePath);
|
||||
}
|
||||
(*tex)->getPixmap()->load(fileToLoad);
|
||||
(*tex)->setTextureSystemId(texSystemId);
|
||||
|
||||
renderer.initTexture(rsGlobal,*tex);
|
||||
}
|
||||
catch (const megaglest_runtime_error& ex) {
|
||||
message(ex.what(),GlobalStaticFlags::getIsNonGraphicalModeEnabled(),
|
||||
tempDataLocation);
|
||||
cleanupTexture (tex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user