GTK+: Set locale to C when loading shader files.

We can't know what format they're in, and for some reason español
breaks them.
This commit is contained in:
Brandon Wright 2018-12-04 11:18:22 -06:00
parent 51d3051712
commit b9ad162723
2 changed files with 5 additions and 0 deletions

View File

@ -362,6 +362,8 @@ int S9xOpenGLDisplayDriver::load_shaders (const char *shader_file)
{ {
int length = strlen (shader_file); int length = strlen (shader_file);
setlocale (LC_ALL, "C");
if ((length > 6 && !strcasecmp(shader_file + length - 6, ".glslp")) || if ((length > 6 && !strcasecmp(shader_file + length - 6, ".glslp")) ||
(length > 5 && !strcasecmp(shader_file + length - 5, ".glsl"))) (length > 5 && !strcasecmp(shader_file + length - 5, ".glsl")))
{ {
@ -374,12 +376,14 @@ int S9xOpenGLDisplayDriver::load_shaders (const char *shader_file)
if (glsl_shader->param.size () > 0) if (glsl_shader->param.size () > 0)
window->enable_widget ("shader_parameters_item", TRUE); window->enable_widget ("shader_parameters_item", TRUE);
setlocale (LC_ALL, "");
return 1; return 1;
} }
delete glsl_shader; delete glsl_shader;
} }
setlocale (LC_ALL, "");
return 0; return 0;
} }

View File

@ -42,6 +42,7 @@ int main (int argc, char *argv[])
g_set_prgname ("snes9x"); g_set_prgname ("snes9x");
g_set_application_name ("Snes9x"); g_set_application_name ("Snes9x");
setlocale (LC_ALL, "");
bindtextdomain (GETTEXT_PACKAGE, SNES9XLOCALEDIR); bindtextdomain (GETTEXT_PACKAGE, SNES9XLOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE); textdomain (GETTEXT_PACKAGE);