diff --git a/Source/Core/VideoCommon/Src/HiresTextures.cpp b/Source/Core/VideoCommon/Src/HiresTextures.cpp index d0526b11e8..80540b920e 100644 --- a/Source/Core/VideoCommon/Src/HiresTextures.cpp +++ b/Source/Core/VideoCommon/Src/HiresTextures.cpp @@ -30,14 +30,14 @@ namespace HiresTextures std::map textureMap; -void Init(const char *gameCode,const char *gameName) +void Init(const char *gameCode) { static bool bCheckedDir; CFileSearch::XStringVector Directories; //Directories.push_back(std::string(FULL_HIRES_TEXTURES_DIR)); char szDir[MAX_PATH]; - sprintf(szDir,"%s/%s",FULL_HIRES_TEXTURES_DIR,gameName); + sprintf(szDir,"%s/%s",FULL_HIRES_TEXTURES_DIR,gameCode); Directories.push_back(std::string(szDir)); diff --git a/Source/Core/VideoCommon/Src/HiresTextures.h b/Source/Core/VideoCommon/Src/HiresTextures.h index ae2c96e959..8b5d51fec7 100644 --- a/Source/Core/VideoCommon/Src/HiresTextures.h +++ b/Source/Core/VideoCommon/Src/HiresTextures.h @@ -24,7 +24,7 @@ namespace HiresTextures { -void Init(const char *gameCode,const char *gameName); +void Init(const char *gameCode); void Shutdown(); PC_TexFormat GetHiresTex(const char *fileName, int *pWidth, int *pHeight, int texformat, u8 *data); }; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp index 552cdaa411..530eb1acbe 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp @@ -160,7 +160,7 @@ void TextureMngr::Init() { temp = (u8*)AllocateMemoryPages(TEMP_SIZE); TexDecoder_SetTexFmtOverlayOptions(g_Config.bTexFmtOverlayEnable, g_Config.bTexFmtOverlayCenter); - HiresTextures::Init(((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.GetUniqueID().c_str(),((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.m_strName.c_str()); + HiresTextures::Init(((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.GetUniqueID().c_str()); } void TextureMngr::Invalidate(bool shutdown) @@ -463,15 +463,16 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width char szTemp[MAX_PATH]; char szDir[MAX_PATH]; - bool bCheckedDir = false; + bool bCheckedDumpDir = false; - sprintf(szDir,"%s/%s",FULL_DUMP_TEXTURES_DIR,((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.m_strName.c_str()); + sprintf(szDir,"%s/%s",FULL_DUMP_TEXTURES_DIR,((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.GetUniqueID().c_str()); - if(!bCheckedDir) + if(!bCheckedDumpDir) { - File::CreateDir(szDir); - bCheckedDir = true; + if (!File::Exists(szDir) || !File::IsDirectory(szDir)) + File::CreateDir(szDir); + bCheckedDumpDir = true; } sprintf(szTemp, "%s/%s_%08x_%i.tga",szDir, ((struct SConfig *)globals->config)->m_LocalCoreStartupParameter.GetUniqueID().c_str(), texHash, tex_format);