From 4ed9b561bd002545fc7178d404b169b1914c17bd Mon Sep 17 00:00:00 2001 From: Rachel Bryk Date: Mon, 22 Sep 2014 12:13:29 -0400 Subject: [PATCH] Allow custom textures to load from unicode paths. --- Source/Core/VideoCommon/HiresTextures.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/HiresTextures.cpp b/Source/Core/VideoCommon/HiresTextures.cpp index 605cef4756..2728725b25 100644 --- a/Source/Core/VideoCommon/HiresTextures.cpp +++ b/Source/Core/VideoCommon/HiresTextures.cpp @@ -94,7 +94,13 @@ PC_TexFormat GetHiresTex(const std::string& filename, unsigned int* pWidth, unsi int height; int channels; - u8 *temp = SOIL_load_image(textureMap[filename].c_str(), &width, &height, &channels, SOIL_LOAD_RGBA); + File::IOFile file; + file.Open(textureMap[filename], "rb"); + std::vector buffer(file.GetSize()); + file.ReadBytes(buffer.data(), file.GetSize()); + + u8* temp = SOIL_load_image_from_memory(buffer.data(), (int)buffer.size(), &width, &height, &channels, SOIL_LOAD_RGBA); + if (temp == nullptr) { ERROR_LOG(VIDEO, "Custom texture %s failed to load", textureMap[filename].c_str());