mirror of
https://github.com/xemu-project/xemu.git
synced 2025-03-03 10:07:39 +00:00
nv2a: Set C numeric locale before shader gen
This commit is contained in:
parent
b3abb982e8
commit
be8b612186
@ -21,6 +21,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu-common.h"
|
||||
#include <locale.h>
|
||||
|
||||
#include "shaders_common.h"
|
||||
#include "shaders.h"
|
||||
@ -941,11 +942,19 @@ static GLuint create_gl_shader(GLenum gl_shader_type,
|
||||
return shader;
|
||||
}
|
||||
|
||||
ShaderBinding* generate_shaders(const ShaderState *state)
|
||||
ShaderBinding *generate_shaders(const ShaderState *state)
|
||||
{
|
||||
int i, j;
|
||||
char tmp[64];
|
||||
|
||||
char *previous_numeric_locale = setlocale(LC_NUMERIC, NULL);
|
||||
if (previous_numeric_locale) {
|
||||
previous_numeric_locale = g_strdup(previous_numeric_locale);
|
||||
}
|
||||
|
||||
/* Ensure numeric values are printed with '.' radix, no grouping */
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
|
||||
char vtx_prefix;
|
||||
GLuint program = glCreateProgram();
|
||||
|
||||
@ -1092,5 +1101,10 @@ ShaderBinding* generate_shaders(const ShaderState *state)
|
||||
ret->material_alpha_loc = -1;
|
||||
}
|
||||
|
||||
if (previous_numeric_locale) {
|
||||
setlocale(LC_NUMERIC, previous_numeric_locale);
|
||||
g_free(previous_numeric_locale);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -134,6 +134,6 @@ typedef struct ShaderBinding {
|
||||
GLint material_alpha_loc;
|
||||
} ShaderBinding;
|
||||
|
||||
ShaderBinding* generate_shaders(const ShaderState *state);
|
||||
ShaderBinding *generate_shaders(const ShaderState *state);
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user