- 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;
|
itemLoadAttempted[texSystemId] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Renderer &renderer = Renderer::getInstance();
|
if(attemptToLoadTexture == true) {
|
||||||
*tex = renderer.newTexture2D(rsGlobal);
|
Renderer &renderer = Renderer::getInstance();
|
||||||
if (*tex) {
|
*tex = renderer.newTexture2D(rsGlobal);
|
||||||
|
if (*tex) {
|
||||||
|
|
||||||
(*tex)->setForceCompressionDisabled(compressionDisabled);
|
(*tex)->setForceCompressionDisabled(compressionDisabled);
|
||||||
(*tex)->setMipmap(setMipMap);
|
(*tex)->setMipmap(setMipMap);
|
||||||
if(setAlpha == true) {
|
if(setAlpha == true) {
|
||||||
|
|
||||||
(*tex)->setFormat(Texture::fAlpha);
|
(*tex)->setFormat(Texture::fAlpha);
|
||||||
(*tex)->getPixmap()->init(1);
|
(*tex)->getPixmap()->init(1);
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
string fileToLoad = uniqueFilePath;
|
|
||||||
if(loadUniqueFilePath == false) {
|
|
||||||
|
|
||||||
fileToLoad = getGameCustomCoreDataPath(data_path,uniqueFilePath);
|
|
||||||
}
|
}
|
||||||
(*tex)->getPixmap()->load(fileToLoad);
|
|
||||||
(*tex)->setTextureSystemId(texSystemId);
|
|
||||||
|
|
||||||
renderer.initTexture(rsGlobal,*tex);
|
try {
|
||||||
}
|
string fileToLoad = uniqueFilePath;
|
||||||
catch (const megaglest_runtime_error& ex) {
|
if(loadUniqueFilePath == false) {
|
||||||
message(ex.what(),GlobalStaticFlags::getIsNonGraphicalModeEnabled(),
|
|
||||||
tempDataLocation);
|
fileToLoad = getGameCustomCoreDataPath(data_path,uniqueFilePath);
|
||||||
cleanupTexture (tex);
|
}
|
||||||
|
(*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…
Reference in New Issue