diff --git a/source/graphics/TextureManager.cpp b/source/graphics/TextureManager.cpp index ee95c08e9d..600e42680d 100755 --- a/source/graphics/TextureManager.cpp +++ b/source/graphics/TextureManager.cpp @@ -10,7 +10,8 @@ #define LOG_CATEGORY "graphics" -static const char* SupportedTextureFormats[] = { ".png", ".dds", ".tga", ".bmp" }; +// filter for vfs_next_dirent +static const char* SupportedTextureFormats[] = { "*.png", "*.dds", "*.tga", "*.bmp" }; @@ -91,7 +92,7 @@ void CTextureManager::DeleteTexture(CTextureEntry* entry) delete entry; } -void CTextureManager::LoadTerrainTextures(int terraintype,const char* fileext) +void CTextureManager::LoadTerrainTextures(int terraintype,const char* fileext_filter) { CStr pathname("art/textures/terrain/types/"); pathname+=m_TerrainTextures[terraintype].m_Name; @@ -102,7 +103,7 @@ void CTextureManager::LoadTerrainTextures(int terraintype,const char* fileext) if (dir > 0) { - while (vfs_next_dirent(dir, &dent, fileext) == 0) + while (vfs_next_dirent(dir, &dent, fileext_filter) == 0) { LOG(NORMAL, LOG_CATEGORY, "CTextureManager::LoadTerrainTextures(): texture %s added to type %s", dent.name, m_TerrainTextures[terraintype].m_Name.c_str()); AddTexture(dent.name, terraintype); @@ -136,7 +137,7 @@ void CTextureManager::LoadTerrainTextures() // now iterate through terrain types loading all textures of that type for (uint i=0;i