diff --git a/gtk/configure.ac b/gtk/configure.ac index 69bb52ac..d9ee98af 100644 --- a/gtk/configure.ac +++ b/gtk/configure.ac @@ -459,7 +459,7 @@ if test $ac_cv_my_sar_int8 = yes && \ CFLAGS="$CFLAGS -DRIGHTSHIFT_IS_SAR" fi -CFLAGS="$CFLAGS -DUNZIP_SUPPORT -DSPC700_C -I. -I.. $ZIP_CFLAGS" +CFLAGS="$CFLAGS -DUNZIP_SUPPORT -DSNES9X_GTK -DSPC700_C -I. -I.. $ZIP_CFLAGS" CXXFLAGS="$CFLAGS" diff --git a/gtk/src/shaders/CGLCG.h b/gtk/src/shaders/CGLCG.h index cf0c3095..693dcb9f 100644 --- a/gtk/src/shaders/CGLCG.h +++ b/gtk/src/shaders/CGLCG.h @@ -192,7 +192,7 @@ #ifndef CGGLCG_H #define CGGLCG_H -#include +#include "shader_platform.h" #include "CCGShader.h" #include "cgFunctions.h" diff --git a/gtk/src/shaders/cgFunctions.cpp b/gtk/src/shaders/cgFunctions.cpp index 6b1d6e4b..11b15f1e 100644 --- a/gtk/src/shaders/cgFunctions.cpp +++ b/gtk/src/shaders/cgFunctions.cpp @@ -193,7 +193,7 @@ #include "cgFunctions.h" #include #include -#include +#include "shader_platform.h" void* hCgDll = NULL; void* hCgGLDll = NULL; diff --git a/gtk/src/shaders/cgMini.h b/gtk/src/shaders/cgMini.h index aa170c14..c289e14b 100644 --- a/gtk/src/shaders/cgMini.h +++ b/gtk/src/shaders/cgMini.h @@ -199,7 +199,7 @@ #define CGD3D9DLL_API #define CGGL_API -#include +#include "shader_platform.h" #define CG_API typedef struct _CGprogram* CGprogram; diff --git a/gtk/src/shaders/glsl.cpp b/gtk/src/shaders/glsl.cpp index 57bbf1cf..d5f50d68 100644 --- a/gtk/src/shaders/glsl.cpp +++ b/gtk/src/shaders/glsl.cpp @@ -1,7 +1,6 @@ #include "glsl.h" #include "../../conffile.h" #include "shader_helpers.h" -#include "../gtk_s9x.h" static const GLfloat tex_coords[16] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f }; @@ -516,7 +515,10 @@ bool GLSLShader::load_shader (char *filename) if (value) { param[i].val = atof (value); - param[i].val = CLAMP (param[i].val, param[i].min, param[i].max); + if (param[i].val < param[i].min) + param[i].val = param[i].min; + if (param[i].val > param[i].max) + param[i].val = param[i].max; } } diff --git a/gtk/src/shaders/glsl.h b/gtk/src/shaders/glsl.h index eb1f24c0..4eaa2a64 100644 --- a/gtk/src/shaders/glsl.h +++ b/gtk/src/shaders/glsl.h @@ -1,8 +1,8 @@ #include #include #include -#include #include "../../conffile.h" +#include "shader_platform.h" static const unsigned int glsl_max_passes = 20; diff --git a/gtk/src/shaders/shader_helpers.cpp b/gtk/src/shaders/shader_helpers.cpp index b912215a..e329ea33 100644 --- a/gtk/src/shaders/shader_helpers.cpp +++ b/gtk/src/shaders/shader_helpers.cpp @@ -1,9 +1,9 @@ -#include #include #include #include #include "shader_helpers.h" +#include "shader_platform.h" static void gl_error_callback( GLenum source, GLenum type, diff --git a/gtk/src/shaders/shader_helpers.h b/gtk/src/shaders/shader_helpers.h index bede2a25..91d06744 100644 --- a/gtk/src/shaders/shader_helpers.h +++ b/gtk/src/shaders/shader_helpers.h @@ -1,7 +1,7 @@ #ifndef __SHADER_HELPERS_H #define __SHADER_HELPERS_H -#include +#include "shader_platform.h" typedef struct _STGA { diff --git a/gtk/src/shaders/shader_platform.h b/gtk/src/shaders/shader_platform.h new file mode 100644 index 00000000..f235af0c --- /dev/null +++ b/gtk/src/shaders/shader_platform.h @@ -0,0 +1,9 @@ +#ifndef __SHADER_PLATFORM_H +#define __SHADER_PLATFORM_H + +#ifdef SNES9X_GTK +#include +#include +#endif + +#endif /* __SHADER_PLATFORM_H */