Some more modification of texture dumping and loading.

They now use gameID instead of game name for the folders.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3247 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
death2droid 2009-05-16 01:21:57 +00:00
parent 14beb0ce7f
commit 254edc3813
3 changed files with 10 additions and 9 deletions

View File

@ -30,14 +30,14 @@ namespace HiresTextures
std::map<std::string, std::string> 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));

View File

@ -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);
};

View File

@ -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);