18 #include "precompiled.h"
37 #pragma warning(disable:4512)
38 #pragma warning(disable:4100)
41 #include <boost/algorithm/string.hpp>
52 TerrainAlphaMap::iterator it;
56 it->second.m_hCompositeAlphaMap = 0;
81 long pos=tag.ReverseFind(
".");
84 tag = tag.substr(0, pos);
92 LOGWARNING(L
"CTerrainTextureManager: Couldn't find terrain %hs", tag.c_str());
110 typedef std::vector<CTerrainTextureEntry*>::iterator Iter;
130 for(
size_t i = 0; i < pathnames.size(); i++)
132 if (pathnames[i].Extension() != L
".xml")
135 if (pathnames[i].Basename() == L
"terrains")
149 VfsPath pathname = path /
"terrains.xml";
156 LOGMESSAGE(L
"CTerrainTextureManager::RecurseDirectory(%ls): no terrains.xml (or errors while loading) - using parent properties", path.
string().c_str());
162 (void)
g_VFS->GetDirectoryEntries(path, 0, &subdirectoryNames);
163 for (
size_t i=0;i<subdirectoryNames.size();i++)
165 VfsPath subdirectoryPath = path / subdirectoryNames[i] /
"";
196 std::vector<CTerrainTextureEntry *>::iterator it;
TerrainAlphaMap m_TerrainAlphas
shared_ptr< CTerrainProperties > CTerrainPropertiesPtr
std::vector< CTerrainTextureEntry * > m_Terrains
std::vector< CTerrainTextureEntry * > m_TextureEntries
Status ogl_tex_free(Handle &ht)
Release this texture reference.
void RecurseDirectory(const CTerrainPropertiesPtr &props, const VfsPath &path)
void UnloadTerrainTextures()
CTerrainTextureEntry * FindTexture(const CStr &tag)
friend class CTerrainTextureEntry
TerrainGroupMap m_TerrainGroups
static CTerrainPropertiesPtr FromXML(const CTerrainPropertiesPtr &parent, const VfsPath &pathname)
CTerrainGroup * FindGroup(const CStr &name)
int LoadTerrainTextures()
const String & string() const
void LoadTextures(const CTerrainPropertiesPtr &props, const VfsPath &path)
CTerrainPropertiesPtr GetPropertiesFromFile(const CTerrainPropertiesPtr &props, const VfsPath &pathname)
std::vector< OsPath > DirectoryNames
bool VfsFileExists(const VfsPath &pathname)
void AddTerrain(CTerrainTextureEntry *)
CTerrainTextureEntry * AddTexture(const CTerrainPropertiesPtr &props, const VfsPath &path)
std::vector< VfsPath > VfsPaths
void RemoveTerrain(CTerrainTextureEntry *)
void DeleteTexture(CTerrainTextureEntry *entry)
Status GetPathnames(const PIVFS &fs, const VfsPath &path, const wchar_t *filter, VfsPaths &pathnames)
~CTerrainTextureManager()