summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/HiresTextures.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2014-09-28 14:54:56 +1000
committerskidau <skidau@gmail.com>2014-09-28 14:54:56 +1000
commit275226c2b6bc037ad6abd8afccce72f02475c2e5 (patch)
tree7ad4e4fbde9a4814cb9aa3560cc78d4055fc354e /Source/Core/VideoCommon/HiresTextures.cpp
parentafccf2276db7cc607aefbc8e8e2cb83f4c0f4790 (diff)
parent4ed9b561bd002545fc7178d404b169b1914c17bd (diff)
Merge pull request #1147 from RachelBryk/unicode-tex
Allow custom textures to load from unicode paths.
Diffstat (limited to 'Source/Core/VideoCommon/HiresTextures.cpp')
-rw-r--r--Source/Core/VideoCommon/HiresTextures.cpp8
1 files changed, 7 insertions, 1 deletions
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<u8> 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());