mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-17 10:21:11 +00:00
Not found Land Textures are no longer a fatal error (Bug #3037)
Log warning message and show the default texture when encountering invalid ESM::LandTexture references. (cherry picked from commit 35fa1f5865bcb8370505f0a2b641c8363024c8a7)
This commit is contained in:
parent
a1939ae05f
commit
3c02703876
@ -36,9 +36,7 @@ namespace CSVRender
|
|||||||
return ltex;
|
return ltex;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::stringstream error;
|
return NULL;
|
||||||
error << "Can't find LandTexture " << index << " from plugin " << plugin;
|
|
||||||
throw std::runtime_error(error.str());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainStorage::getBounds(float &minX, float &maxX, float &minY, float &maxY)
|
void TerrainStorage::getBounds(float &minX, float &maxX, float &minY, float &maxY)
|
||||||
|
@ -68,7 +68,7 @@ namespace MWRender
|
|||||||
{
|
{
|
||||||
const MWWorld::ESMStore &esmStore =
|
const MWWorld::ESMStore &esmStore =
|
||||||
MWBase::Environment::get().getWorld()->getStore();
|
MWBase::Environment::get().getWorld()->getStore();
|
||||||
return esmStore.get<ESM::LandTexture>().find(index, plugin);
|
return esmStore.get<ESM::LandTexture>().search(index, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -301,11 +301,17 @@ namespace ESMTerrain
|
|||||||
|
|
||||||
std::string Storage::getTextureName(UniqueTextureId id)
|
std::string Storage::getTextureName(UniqueTextureId id)
|
||||||
{
|
{
|
||||||
|
static const std::string defaultTexture = "textures\\_land_default.dds";
|
||||||
if (id.first == 0)
|
if (id.first == 0)
|
||||||
return "textures\\_land_default.dds"; // Not sure if the default texture really is hardcoded?
|
return defaultTexture; // Not sure if the default texture really is hardcoded?
|
||||||
|
|
||||||
// NB: All vtex ids are +1 compared to the ltex ids
|
// NB: All vtex ids are +1 compared to the ltex ids
|
||||||
const ESM::LandTexture* ltex = getLandTexture(id.first-1, id.second);
|
const ESM::LandTexture* ltex = getLandTexture(id.first-1, id.second);
|
||||||
|
if (!ltex)
|
||||||
|
{
|
||||||
|
std::cerr << "Unable to find land texture index " << id.first-1 << " in plugin " << id.second << ", using default texture instead" << std::endl;
|
||||||
|
return defaultTexture;
|
||||||
|
}
|
||||||
|
|
||||||
// this is needed due to MWs messed up texture handling
|
// this is needed due to MWs messed up texture handling
|
||||||
std::string texture = Misc::ResourceHelpers::correctTexturePath(ltex->mTexture);
|
std::string texture = Misc::ResourceHelpers::correctTexturePath(ltex->mTexture);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user