diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 747ad9f2fe..b3b8c07e18 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include "Profiler.h" #include "PixelShaderGen.h" @@ -382,6 +383,7 @@ static void BuildSwapModeTable() const char *GeneratePixelShader(u32 texture_mask, bool dstAlphaEnable, bool HLSL) { + setlocale(LC_NUMERIC, "C"); // Reset locale for compilation text[sizeof(text) - 1] = 0x7C; // canary DVSTARTPROFILE(); @@ -551,6 +553,7 @@ const char *GeneratePixelShader(u32 texture_mask, bool dstAlphaEnable, bool HLSL if (text[sizeof(text) - 1] != 0x7C) PanicAlert("PixelShader generator - buffer too small, canary has been eaten!"); + setlocale(LC_NUMERIC, ""); // restore locale return text; } diff --git a/Source/Core/VideoCommon/Src/TextureConversionShader.cpp b/Source/Core/VideoCommon/Src/TextureConversionShader.cpp index c3a440009f..1263f52cfa 100644 --- a/Source/Core/VideoCommon/Src/TextureConversionShader.cpp +++ b/Source/Core/VideoCommon/Src/TextureConversionShader.cpp @@ -18,6 +18,7 @@ #include #include +#include #include "Common.h" #include "TextureConversionShader.h" @@ -642,6 +643,7 @@ void WriteZ24Encoder(char* p) const char *GenerateEncodingShader(u32 format) { + setlocale(LC_NUMERIC, "C"); // Reset locale for compilation text[sizeof(text) - 1] = 0x7C; // canary char *p = text; @@ -725,6 +727,7 @@ const char *GenerateEncodingShader(u32 format) if (text[sizeof(text) - 1] != 0x7C) PanicAlert("TextureConversionShader generator - buffer too small, canary has been eaten!"); + setlocale(LC_NUMERIC, ""); // restore locale return text; } diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp index 1cfc509e22..a49f83a71e 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp @@ -16,6 +16,7 @@ // http://code.google.com/p/dolphin-emu/ #include +#include #include "Profiler.h" #include "NativeVertexFormat.h" @@ -80,6 +81,7 @@ char *GenerateLightShader(char* p, int index, const LitChannel& chan, const char const char *GenerateVertexShader(u32 components, bool D3D) { + setlocale(LC_NUMERIC, "C"); // Reset locale for compilation text[sizeof(text) - 1] = 0x7C; // canary DVSTARTPROFILE(); @@ -496,5 +498,6 @@ char* GenerateLightShader(char* p, int index, const LitChannel& chan, const char } WRITE(p, "\n"); + setlocale(LC_NUMERIC, ""); // restore locale return p; }