From 81df69dfeeacd0c59472d518eea35204b3412534 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Sun, 28 Jan 2001 05:53:04 +0000 Subject: [PATCH] OpenGL now uses SDL-GL instead of gii --- acconfig.h | 5 ++--- include/d_delay.h | 9 ++------- main/Makefile.am | 4 ++-- main/game.c | 25 ++++++++++++------------- video/Makefile.am | 2 +- video/ogl_glx.c | 2 +- 6 files changed, 20 insertions(+), 27 deletions(-) diff --git a/acconfig.h b/acconfig.h index 304ba9a6..ec853811 100644 --- a/acconfig.h +++ b/acconfig.h @@ -34,9 +34,8 @@ # define SDL_AUDIO 1 # ifdef OGL -# define GLX_VIDEO 1 -# define GII_INPUT 1 -# define GII_XWIN 1 +# define SDL_GL_VIDEO 1 +# define SDL_INPUT 1 # else # ifdef GGI # define GGI_VIDEO 1 diff --git a/include/d_delay.h b/include/d_delay.h index ce519dc9..fda286c1 100644 --- a/include/d_delay.h +++ b/include/d_delay.h @@ -3,11 +3,6 @@ #ifndef _D_DELAY #define _D_DELAY -//#ifdef __LINUX__ - void d_delay (int ms); -/*#else -#include -#define d_delay delay -#endif - */ +void d_delay (int ms); + #endif diff --git a/main/Makefile.am b/main/Makefile.am index b3b67af0..79ed37ee 100644 --- a/main/Makefile.am +++ b/main/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = editor old -INCLUDES = -I $(top_srcdir)/includes -fwritable-strings +INCLUDES = -I$(top_srcdir)/includes -fwritable-strings bin_PROGRAMS = d2x @@ -29,7 +29,7 @@ else d2x_LDADD = ../3d/lib3d.a ../2d/lib2d.a ../mem/libmem.a ../cfile/libcfile.a ../iff/libiff.a ../texmap/libtexmap.a ../misc/libmisc.a ../maths/libmaths.a ../arch/libarch.a ../video/libvideo.a ../sound/libsound.a ../input/libinput.a -lm -ldl -lpthread ${SDL_LIBS} if USE_OPENGL - d2x_LDADD += ${OGL_LIBS} -lgii -L/usr/X11R6/lib -lXext + d2x_LDADD += ${OGL_LIBS} endif if USE_SVGALIB diff --git a/main/game.c b/main/game.c index 1e233b83..f8f4ff5f 100644 --- a/main/game.c +++ b/main/game.c @@ -12,7 +12,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ #ifdef RCS -char game_rcsid[] = "$Id: game.c,v 1.4 2001-01-24 04:42:20 bradleyb Exp $"; +char game_rcsid[] = "$Id: game.c,v 1.5 2001-01-28 05:53:04 bradleyb Exp $"; #endif #ifdef WINDOWS @@ -107,6 +107,7 @@ char game_rcsid[] = "$Id: game.c,v 1.4 2001-01-24 04:42:20 bradleyb Exp $"; #include "robot.h" #include "playsave.h" #include "fix.h" +#include "d_delay.h" #ifdef OGL #include "ogl_init.h" @@ -1151,6 +1152,8 @@ int Movie_fixed_frametime; #define Movie_fixed_frametime 0 #endif +static const int max_fps = 80; + void calc_frame_time() { fix timer_value,last_frametime = FrameTime; @@ -1162,18 +1165,14 @@ void calc_frame_time() timer_value = timer_get_fixed_seconds(); FrameTime = timer_value - last_timer_value; - #ifndef RELEASE - if (Saving_movie_frames || Movie_fixed_frametime) { - if (FrameTime > f1_0/15) - mprintf((0,"slow frame: %x\n",FrameTime)); - else - do { - timer_value = timer_get_fixed_seconds(); - FrameTime = timer_value - last_timer_value; - } while (FrameTime < f1_0/15); - FrameTime = f1_0/15; - } - #endif + do { + timer_value = timer_get_fixed_seconds(); + FrameTime = timer_value - last_timer_value; + if (FrameTime < f1_0/max_fps); + { + d_delay(1); + } + } while (FrameTime < f1_0/max_fps); #if defined(TIMER_TEST) && !defined(NDEBUG) _timer_value = timer_value; diff --git a/video/Makefile.am b/video/Makefile.am index 48c433c7..7c2df905 100644 --- a/video/Makefile.am +++ b/video/Makefile.am @@ -2,7 +2,7 @@ noinst_LIBRARIES = libvideo.a INCLUDES = -I $(top_srcdir) -I$(top_srcdir)/includes -I$(top_srcdir)/main libvideo_a_SOURCES = \ -ogl.c ogl_glx.c ogl_gr.c \ +ogl.c ogl_glx.c ogl_sdl.c ogl_gr.c \ sdl_gr.c dos_gr.c svgalib_gr.c ggi_gr.c EXTRA_DIST = \ diff --git a/video/ogl_glx.c b/video/ogl_glx.c index e52258e9..558c4a95 100644 --- a/video/ogl_glx.c +++ b/video/ogl_glx.c @@ -1,6 +1,6 @@ //opengl platform specific functions for GLX - Added 9/15/99 Matthew Mueller #include -#ifdef OGL +#ifdef GLX_GL_VIDEO #include #include -- 2.39.2