Fixed path of terrains.xml - was ".../types/grass//terrains.xml", which caused it to not be found, which caused terrain textures without their own .xml to be ignored.

Removed GetRandomTexture, since it's never used.

This was SVN commit r3888.
This commit is contained in:
Ykkrosh 2006-05-21 23:22:55 +00:00
parent e2ce59292d
commit a3b9d7d946
2 changed files with 1 additions and 14 deletions

View File

@ -147,7 +147,7 @@ void CTextureManager::RecurseDirectory(CTerrainPropertiesPtr parentProps, const
// Load terrains.xml first, if it exists
char fn[PATH_MAX];
snprintf(fn, PATH_MAX, "%s/%s", cur_dir_path, "terrains.xml");
snprintf(fn, PATH_MAX, "%s%s", cur_dir_path, "terrains.xml");
if (vfs_exists(fn))
props = GetPropertiesFromFile(parentProps, fn);
@ -186,18 +186,6 @@ CTerrainGroup *CTextureManager::FindGroup(CStr name)
return m_TerrainGroups[name] = new CTerrainGroup(name, ++m_LastGroupIndex);
}
/* There was a GetRandomTexture in MainFrm.cpp (sced) previously that gave compile errors...
So I thought "better fix it up and put it in CTextureManager instead".. well, it is never used
except for one *comment* in MainFrm.cpp - d'oh */
CTextureEntry* CTextureManager::GetRandomTexture()
{
if (!m_TextureEntries.size())
return NULL;
u32 type=rand()%(u32)m_TextureEntries.size();
return m_TextureEntries[type];
}
void CTerrainGroup::AddTerrain(CTextureEntry *pTerrain)
{
m_Terrains.push_back(pTerrain);

View File

@ -88,7 +88,6 @@ public:
CTextureEntry* FindTexture(CStr tag);
CTextureEntry* FindTexture(Handle handle);
CTextureEntry* GetRandomTexture();
// Create a texture object for a new terrain texture at path, using the
// property sheet props.