Be more robust to broken terrain property files.
This was SVN commit r8888.
This commit is contained in:
parent
caad072347
commit
bf3d5c75f0
@ -98,7 +98,7 @@ CStr8 CTerrain::GetMovementClass(ssize_t i, ssize_t j) const
|
||||
{
|
||||
CMiniPatch* tile = GetTile(i, j);
|
||||
if (tile && tile->GetTextureEntry())
|
||||
return tile->GetTextureEntry()->GetProperties()->GetMovementClass();
|
||||
return tile->GetTextureEntry()->GetProperties().GetMovementClass();
|
||||
|
||||
return "default";
|
||||
}
|
||||
|
@ -33,6 +33,8 @@ CTerrainTextureEntry::CTerrainTextureEntry(CTerrainPropertiesPtr props, const Vf
|
||||
m_BaseColor(0),
|
||||
m_BaseColorValid(false)
|
||||
{
|
||||
debug_assert(props);
|
||||
|
||||
CTextureProperties texture(path);
|
||||
texture.SetWrap(GL_REPEAT);
|
||||
|
||||
|
@ -68,8 +68,8 @@ public:
|
||||
CStr GetTag() const
|
||||
{ return m_Tag; }
|
||||
|
||||
CTerrainPropertiesPtr GetProperties() const
|
||||
{ return m_pProperties; }
|
||||
const CTerrainProperties& GetProperties() const
|
||||
{ return *m_pProperties; }
|
||||
|
||||
// Get texture handle, load texture if not loaded.
|
||||
const CTexturePtr& GetTexture() {
|
||||
|
@ -194,7 +194,8 @@ void CTerrainTextureManager::RecurseDirectory(const CTerrainPropertiesPtr& paren
|
||||
|
||||
int CTerrainTextureManager::LoadTerrainTextures()
|
||||
{
|
||||
RecurseDirectory(CTerrainPropertiesPtr(), L"art/textures/terrain/types/");
|
||||
CTerrainPropertiesPtr rootProps(new CTerrainProperties(CTerrainPropertiesPtr()));
|
||||
RecurseDirectory(rootProps, L"art/textures/terrain/types/");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user