diff options
| author | NeoBrainX <NeoBrainX@gmail.com> | 2013-06-17 12:05:47 +0200 |
|---|---|---|
| committer | NeoBrainX <NeoBrainX@gmail.com> | 2013-06-17 12:05:47 +0200 |
| commit | ca22872daed7c384db350b2987b21ea92299a9e8 (patch) | |
| tree | 21414cf12a5eb7a2b3cc4e0b1702aabf4c7c8890 /Source/Core/VideoCommon/Src/TextureConversionShader.cpp | |
| parent | f0ea525d3b4dea15363674c822943ecf38da26b3 (diff) | |
| parent | 43a4d418896f47ea971ccd83d5630a97f0f0000b (diff) | |
Merge 'master' into shader-uids-awesome.
Conflicts:
Source/Core/VideoCommon/Src/LightingShaderGen.cpp
Source/Core/VideoCommon/Src/PixelShaderGen.cpp
Source/Core/VideoCommon/Src/PixelShaderGen.h
Source/Core/VideoCommon/Src/VertexShaderGen.cpp
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureConversionShader.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/TextureConversionShader.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureConversionShader.cpp b/Source/Core/VideoCommon/Src/TextureConversionShader.cpp index 539d8799f9..40873b903e 100644 --- a/Source/Core/VideoCommon/Src/TextureConversionShader.cpp +++ b/Source/Core/VideoCommon/Src/TextureConversionShader.cpp @@ -6,6 +6,9 @@ #include <stdio.h> #include <math.h> #include <locale.h> +#ifdef __APPLE__ + #include <xlocale.h> +#endif #include "TextureConversionShader.h" #include "TextureDecoder.h" @@ -804,7 +807,10 @@ void WriteZ24Encoder(char* p, API_TYPE ApiType) const char *GenerateEncodingShader(u32 format,API_TYPE ApiType) { - setlocale(LC_NUMERIC, "C"); // Reset locale for compilation +#ifndef ANDROID + locale_t locale = newlocale(LC_NUMERIC_MASK, "C", NULL); // New locale for compilation + locale_t old_locale = uselocale(locale); // Apply the locale for this thread +#endif text[sizeof(text) - 1] = 0x7C; // canary char *p = text; @@ -887,8 +893,11 @@ const char *GenerateEncodingShader(u32 format,API_TYPE ApiType) if (text[sizeof(text) - 1] != 0x7C) PanicAlert("TextureConversionShader generator - buffer too small, canary has been eaten!"); - - setlocale(LC_NUMERIC, ""); // restore locale + +#ifndef ANDROID + uselocale(old_locale); // restore locale + freelocale(locale); +#endif return text; } |
