From 32df15a254f64eea54550bdf89c8f966488df61d Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Fri, 28 Nov 2014 08:30:31 +0000 Subject: [PATCH] Fix C/GTK2/SDL1.2 build. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@4769 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/gtkbits.h | 4 ++-- polymer/eduke32/build/src/gtkbits.c | 4 ++-- polymer/eduke32/build/src/sdlayer.c | 6 +++--- polymer/eduke32/build/src/sdlayer12.c | 14 ++++++++++++++ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/polymer/eduke32/build/include/gtkbits.h b/polymer/eduke32/build/include/gtkbits.h index fc6bbb67c..10f1c86de 100644 --- a/polymer/eduke32/build/include/gtkbits.h +++ b/polymer/eduke32/build/include/gtkbits.h @@ -7,8 +7,8 @@ extern "C" { extern void gtkbuild_init(int32_t *argc, char ***argv); extern void gtkbuild_exit(int32_t r); -extern int32_t gtkbuild_msgbox(char *name, char *msg); -extern int32_t gtkbuild_ynbox(char *name, char *msg); +extern int32_t gtkbuild_msgbox(const char *name, const char *msg); +extern int32_t gtkbuild_ynbox(const char *name, const char *msg); #ifdef __cplusplus } diff --git a/polymer/eduke32/build/src/gtkbits.c b/polymer/eduke32/build/src/gtkbits.c index f9b45a3b3..a31a06478 100644 --- a/polymer/eduke32/build/src/gtkbits.c +++ b/polymer/eduke32/build/src/gtkbits.c @@ -16,7 +16,7 @@ int32_t gtkenabled = 0; static GdkPixbuf *appicon = NULL; -int32_t gtkbuild_msgbox(char *name, char *msg) +int32_t gtkbuild_msgbox(const char *name, const char *msg) { GtkWidget *dialog; @@ -34,7 +34,7 @@ int32_t gtkbuild_msgbox(char *name, char *msg) return 1; } -int32_t gtkbuild_ynbox(char *name, char *msg) +int32_t gtkbuild_ynbox(const char *name, const char *msg) { int32_t r; GtkWidget *dialog; diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index 364871e76..88e454f15 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -375,6 +375,8 @@ int32_t main(int32_t argc, char *argv[]) } #ifdef USE_OPENGL +void setvsync(int32_t sync); +#if SDL_MAJOR_VERSION != 1 void setvsync(int32_t sync) { if (vsync_render == sync) return; @@ -384,6 +386,7 @@ void setvsync(int32_t sync) SDL_GL_SetSwapInterval(vsync_render); } #endif +#endif int32_t sdlayer_checkversion(void); #if SDL_MAJOR_VERSION != 1 @@ -1363,9 +1366,6 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs) { SDL_GL_MULTISAMPLESAMPLES, glmultisample }, { SDL_GL_STENCIL_SIZE, 1 }, { SDL_GL_ACCELERATED_VISUAL, 1 }, -#if SDL_MAJOR_VERSION == 1 - { SDL_GL_SWAP_CONTROL, vsync_render }, -#endif }; do diff --git a/polymer/eduke32/build/src/sdlayer12.c b/polymer/eduke32/build/src/sdlayer12.c index f5d9fb576..e42a9d0c1 100644 --- a/polymer/eduke32/build/src/sdlayer12.c +++ b/polymer/eduke32/build/src/sdlayer12.c @@ -337,6 +337,20 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs) if (nogl) return -1; + struct glattribs + { + SDL_GLattr attr; + int32_t value; + } sdlayer_gl_attributes [] = + { + { SDL_GL_DOUBLEBUFFER, 1 }, + { SDL_GL_MULTISAMPLEBUFFERS, glmultisample > 0 }, + { SDL_GL_MULTISAMPLESAMPLES, glmultisample }, + { SDL_GL_STENCIL_SIZE, 1 }, + { SDL_GL_ACCELERATED_VISUAL, 1 }, + { SDL_GL_SWAP_CONTROL, vsync_render }, + }; + do { SDL_GL_ATTRIBUTES(i, sdlayer_gl_attributes);