Skip to content

Commit

Permalink
Allow custom textures to load from unicode paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
RachelBryk committed Sep 22, 2014
1 parent d4952c7 commit a0e3139
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Source/Core/VideoCommon/HiresTextures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,15 @@ 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");
u8* buffer = new u8[file.GetSize()];
file.ReadBytes(buffer, file.GetSize());

u8* temp = SOIL_load_image_from_memory(buffer, (int)file.GetSize(), &width, &height, &channels, SOIL_LOAD_RGBA);
file.Close();
delete[] buffer;

if (temp == nullptr)
{
ERROR_LOG(VIDEO, "Custom texture %s failed to load", textureMap[filename].c_str());
Expand Down

0 comments on commit a0e3139

Please sign in to comment.