diff options
| author | shuffle2 <godisgovernment@gmail.com> | 2014-08-20 10:57:31 -0700 |
|---|---|---|
| committer | shuffle2 <godisgovernment@gmail.com> | 2014-08-20 10:57:31 -0700 |
| commit | d29e3331426823b0dcd49a7436a4a8a6bdf60dcf (patch) | |
| tree | 84bbe066f736929fc1b4e381f3c719006070d409 /Source/Core/VideoCommon/HiresTextures.cpp | |
| parent | a09cf1d8f1bdc58de56b8fbb2d2282b8e59d2e69 (diff) | |
| parent | a9c33075f2f2b8ca6ffb699308a282e385a726b9 (diff) | |
Merge pull request #833 from shuffle2/msvc-improvements
misc improvements for msvc build. -Werror for msvc!
Diffstat (limited to 'Source/Core/VideoCommon/HiresTextures.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/HiresTextures.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/HiresTextures.cpp b/Source/Core/VideoCommon/HiresTextures.cpp index f9e7d918c9..605cef4756 100644 --- a/Source/Core/VideoCommon/HiresTextures.cpp +++ b/Source/Core/VideoCommon/HiresTextures.cpp @@ -107,13 +107,13 @@ PC_TexFormat GetHiresTex(const std::string& filename, unsigned int* pWidth, unsi //int offset = 0; PC_TexFormat returnTex = PC_TEX_FMT_NONE; - switch (texformat) - { // TODO(neobrain): This function currently has no way to enforce RGBA32 // output, which however is required on some configurations to function // properly. As a lazy workaround, we hence disable the optimized code // path for now. #if 0 + switch (texformat) + { case GX_TF_I4: case GX_TF_I8: case GX_TF_IA4: @@ -131,7 +131,6 @@ PC_TexFormat GetHiresTex(const std::string& filename, unsigned int* pWidth, unsi } returnTex = PC_TEX_FMT_IA8; break; -#endif default: *required_size = width * height * 4; if (data_size < *required_size) @@ -141,6 +140,14 @@ PC_TexFormat GetHiresTex(const std::string& filename, unsigned int* pWidth, unsi returnTex = PC_TEX_FMT_RGBA32; break; } +#else + *required_size = width * height * 4; + if (data_size < *required_size) + goto cleanup; + + memcpy(data, temp, width * height * 4); + returnTex = PC_TEX_FMT_RGBA32; +#endif INFO_LOG(VIDEO, "Loading custom texture from %s", textureMap[filename].c_str()); cleanup: |
