From d232f2364b30dceb5fb2bff98c9b520d8ef7e897 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 26 Dec 2016 06:01:40 +0000 Subject: [PATCH] Fix USE_OPENGL=0 RENDERTYPE=WIN and USE_OPENGL=0 SDL_TARGET=1 builds. git-svn-id: https://svn.eduke32.com/eduke32@5954 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/sdlayer.c | 3 +-- polymer/eduke32/build/src/sdlayer12.c | 4 +--- polymer/eduke32/build/src/winlayer.c | 13 ++++++------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index a6f5b9dba..8d18c62a5 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -500,7 +500,6 @@ int32_t main(int32_t argc, char *argv[]) } -int setvsync(int newSync); #if SDL_MAJOR_VERSION != 1 int setvsync(int newSync) { @@ -539,7 +538,7 @@ int setvsync(int newSync) OSD_Printf("restartvid: Reset failed...\n"); } - return vsync_renderlayer; + return newSync; } #endif diff --git a/polymer/eduke32/build/src/sdlayer12.c b/polymer/eduke32/build/src/sdlayer12.c index 296f1b8a5..7d841e037 100644 --- a/polymer/eduke32/build/src/sdlayer12.c +++ b/polymer/eduke32/build/src/sdlayer12.c @@ -55,7 +55,6 @@ HWND win_gethwnd(void) } #endif -#ifdef USE_OPENGL int setvsync(int newSync) { if (vsync_renderlayer == newSync) @@ -67,9 +66,8 @@ int setvsync(int newSync) if (setgamemode(fullscreen, xdim, ydim, bpp)) OSD_Printf("restartvid: Reset failed...\n"); - return vsync_renderlayer; + return newSync; } -#endif int32_t sdlayer_checkversion(void) { diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index 8125a0b60..0bb5de185 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -130,9 +130,7 @@ int32_t bpp=0; int32_t bytesperline=0; int32_t lockcount=0; int32_t glcolourdepth=32; -#ifdef USE_OPENGL static int32_t vsync_renderlayer; -#endif uint32_t maxrefreshfreq=60; intptr_t frameplace=0; char modechange=1; @@ -589,9 +587,7 @@ void uninitsystem(void) // void system_getcvars(void) { -#ifdef USE_OPENGL - setvsync(vsync); -#endif + vsync = setvsync(vsync); } @@ -1725,22 +1721,25 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs) #define CHECK(w,h) if ((w < maxx) && (h < maxy)) -#ifdef USE_OPENGL int setvsync(int newSync) { +#ifdef USE_OPENGL if (!glinfo.vsync) { vsync_renderlayer = 0; return 0; } - vsync_renderlayer = newSync; # ifdef USE_GLEXT bwglSwapIntervalEXT(newSync); # endif +#endif + + vsync_renderlayer = newSync; return newSync; } +#ifdef USE_OPENGL static void cdsenummodes(void) { DEVMODE dm;