diff options
| author | Matthew Parlane <parlane@gmail.com> | 2013-11-17 11:12:07 +1300 |
|---|---|---|
| committer | Matthew Parlane <parlane@gmail.com> | 2013-11-17 11:14:38 +1300 |
| commit | 33d8166620d308f5d7644e64ca92e588ff75fa44 (patch) | |
| tree | d7fa08d4b12bd3119af0e76632cd29fb86aa4693 /Source/Core/VideoCommon/Src/TextureCacheBase.cpp | |
| parent | cce869ae0169970ef20663d04701c58527755ddf (diff) | |
Use IOFile for TextureToPng to support non-ascii
Changed save texture/screenshot uses to std::string
Removed unneeded new/delete calls when dealing with temp data.
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureCacheBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/TextureCacheBase.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp index 05c2e88aae..31ba3d5e61 100644 --- a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp @@ -283,7 +283,7 @@ PC_TexFormat TextureCache::LoadCustomTexture(u64 tex_hash, int texformat, unsign void TextureCache::DumpTexture(TCacheEntryBase* entry, unsigned int level) { - char szTemp[MAX_PATH]; + std::string filename; std::string szDir = File::GetUserPath(D_DUMPTEXTURES_IDX) + SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID; @@ -295,19 +295,19 @@ void TextureCache::DumpTexture(TCacheEntryBase* entry, unsigned int level) // TODO: TLUT format should actually be stored in filename? :/ if (level == 0) { - sprintf(szTemp, "%s/%s_%08x_%i.png", szDir.c_str(), - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), - (u32) (entry->hash & 0x00000000FFFFFFFFLL), entry->format & 0xFFFF); + filename = StringFromFormat("%s/%s_%08x_%i.png", szDir.c_str(), + SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), + (u32)(entry->hash & 0x00000000FFFFFFFFLL), entry->format & 0xFFFF); } else { - sprintf(szTemp, "%s/%s_%08x_%i_mip%i.png", szDir.c_str(), + filename = StringFromFormat("%s/%s_%08x_%i_mip%i.png", szDir.c_str(), SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), (u32) (entry->hash & 0x00000000FFFFFFFFLL), entry->format & 0xFFFF, level); } - if (false == File::Exists(szTemp)) - entry->Save(szTemp, level); + if (!File::Exists(filename)) + entry->Save(filename, level); } static u32 CalculateLevelSize(u32 level_0_size, u32 level) |
