From 43befa6fd26e8aababbe8d29c63f186c90f7ffb5 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 18 Feb 2016 04:55:39 -0800 Subject: [PATCH] Fix crash when attempting to initialize cache --- hecl/lib/Runtime/ShaderCacheManager.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/hecl/lib/Runtime/ShaderCacheManager.cpp b/hecl/lib/Runtime/ShaderCacheManager.cpp index 766759949..50d73bc59 100644 --- a/hecl/lib/Runtime/ShaderCacheManager.cpp +++ b/hecl/lib/Runtime/ShaderCacheManager.cpp @@ -64,7 +64,12 @@ void ShaderCacheManager::bootstrapIndex() m_idxFr.close(); m_datFr.close(); - SystemStringView idxFilename(m_idxFr.filename()); +#if _WIN32 + SystemString tmp = m_idxFr.wfilename(); +#else + SystemString tmp = m_idxFr.filename(); +#endif + SystemStringView idxFilename(tmp); FILE* idxFp = HECL::Fopen(idxFilename.c_str(), _S("wb")); if (!idxFp) @@ -75,8 +80,12 @@ void ShaderCacheManager::bootstrapIndex() fwrite(&m_extensionsHash, 1, 8, idxFp); fwrite(&ZERO64, 1, 8, idxFp); fclose(idxFp); - - SystemStringView datFilename(m_datFr.filename()); +#if _WIN32 + tmp = m_datFr.wfilename(); +#else + tmp = m_datFr.filename(); +#endif + SystemStringView datFilename(tmp); FILE* datFp = HECL::Fopen(datFilename.c_str(), _S("wb")); if (!datFp)