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
This commit is contained in:
hendricks266 2016-12-26 06:01:40 +00:00
parent 158fcb5e01
commit d232f2364b
3 changed files with 8 additions and 12 deletions

View file

@ -500,7 +500,6 @@ int32_t main(int32_t argc, char *argv[])
} }
int setvsync(int newSync);
#if SDL_MAJOR_VERSION != 1 #if SDL_MAJOR_VERSION != 1
int setvsync(int newSync) int setvsync(int newSync)
{ {
@ -539,7 +538,7 @@ int setvsync(int newSync)
OSD_Printf("restartvid: Reset failed...\n"); OSD_Printf("restartvid: Reset failed...\n");
} }
return vsync_renderlayer; return newSync;
} }
#endif #endif

View file

@ -55,7 +55,6 @@ HWND win_gethwnd(void)
} }
#endif #endif
#ifdef USE_OPENGL
int setvsync(int newSync) int setvsync(int newSync)
{ {
if (vsync_renderlayer == newSync) if (vsync_renderlayer == newSync)
@ -67,9 +66,8 @@ int setvsync(int newSync)
if (setgamemode(fullscreen, xdim, ydim, bpp)) if (setgamemode(fullscreen, xdim, ydim, bpp))
OSD_Printf("restartvid: Reset failed...\n"); OSD_Printf("restartvid: Reset failed...\n");
return vsync_renderlayer; return newSync;
} }
#endif
int32_t sdlayer_checkversion(void) int32_t sdlayer_checkversion(void)
{ {

View file

@ -130,9 +130,7 @@ int32_t bpp=0;
int32_t bytesperline=0; int32_t bytesperline=0;
int32_t lockcount=0; int32_t lockcount=0;
int32_t glcolourdepth=32; int32_t glcolourdepth=32;
#ifdef USE_OPENGL
static int32_t vsync_renderlayer; static int32_t vsync_renderlayer;
#endif
uint32_t maxrefreshfreq=60; uint32_t maxrefreshfreq=60;
intptr_t frameplace=0; intptr_t frameplace=0;
char modechange=1; char modechange=1;
@ -589,9 +587,7 @@ void uninitsystem(void)
// //
void system_getcvars(void) void system_getcvars(void)
{ {
#ifdef USE_OPENGL vsync = setvsync(vsync);
setvsync(vsync);
#endif
} }
@ -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)) #define CHECK(w,h) if ((w < maxx) && (h < maxy))
#ifdef USE_OPENGL
int setvsync(int newSync) int setvsync(int newSync)
{ {
#ifdef USE_OPENGL
if (!glinfo.vsync) if (!glinfo.vsync)
{ {
vsync_renderlayer = 0; vsync_renderlayer = 0;
return 0; return 0;
} }
vsync_renderlayer = newSync;
# ifdef USE_GLEXT # ifdef USE_GLEXT
bwglSwapIntervalEXT(newSync); bwglSwapIntervalEXT(newSync);
# endif # endif
#endif
vsync_renderlayer = newSync;
return newSync; return newSync;
} }
#ifdef USE_OPENGL
static void cdsenummodes(void) static void cdsenummodes(void)
{ {
DEVMODE dm; DEVMODE dm;