diff --git a/configure.in b/configure.in index ab44ceb..100711f 100644 --- a/configure.in +++ b/configure.in @@ -92,38 +92,6 @@ AC_SUBST(HAVE_SVGALIB) AC_SUBST(SVGALIB_CFLAGS) AC_SUBST(SVGALIB_LIBS) -dnl Check for GLIDE -AC_ARG_WITH(glide, - [ --with-glide=DIR use GLIDE 2.x found in DIR ], - HAVE_GLIDE=$withval, - HAVE_GLIDE=auto) -if test "x$HAVE_GLIDE" != xno; then - AC_CHECK_LIB(glide, grGammaCorrectionValue, - GLIDE_LIBS="-lglide", - AC_CHECK_LIB(glide2x, grGammaCorrectionValue, - GLIDE_LIBS="-lglide2x", - GLIDE_LIBS="" - ) - ) - if test "x$HAVE_GLIDE" != xauto; then - GLIDE_CFLAGS="$GLIDE_CFLAGS -I$withval/include" - GLIDE_LIBS="$GLIDE_LIBS -L$withval/lib" - else - GLIDE_CFLAGS="$GLIDE_CFLAGS -I/usr/include/glide -I/usr/local/include/glide" - fi - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $GLIDE_CFLAGS" - AC_CHECK_HEADER(glide.h, HAVE_GLIDE=yes, HAVE_GLIDE=no) - if test "x$HAVE_GLIDE" != xyes; then - HAVE_GLIDE=no - else - AC_DEFINE(HAVE_GLIDE, 1, [Define this if you have Glide]) - fi - CPPFLAGS="$save_CPPFLAGS" -fi -AC_SUBST(GLIDE_CFLAGS) -AC_SUBST(GLIDE_LIBS) - dnl Check for X11 AC_PATH_XTRA if test "x$no_x" = x; then @@ -397,7 +365,7 @@ eval PKGLIBDIR="$libdir/$PACKAGE" AC_DEFINE_UNQUOTED(PKGLIBDIR, "$PKGLIBDIR", [Define this to the path containing the dynamic modules (\${exec-prefix}/lib/quake2/)]) eval PKGDATADIR="$datadir/$PACKAGE" -AC_DEFINE_UNQUOTED(PKGDATADIR, "$PKGDATADIR", [Define this to the path containing the game data (\${prefix}/share/quake2/)]) +AC_DEFINE_UNQUOTED(PKGDATADIR, "$PKGDATADIR", [Define this to the path containing the game data (\${prefix}/share/games/quake2/)]) dnl --------------------------------- dnl Work out what refreshers to build @@ -425,7 +393,7 @@ if test "x$HAVE_X" = xyes -a "x$HAVE_OPENGL" = xyes; then BUILD_GLX="yes" fi -if test "x$HAVE_X" = xyes -a "x$HAVE_GLIDE" = xyes -a "x$HAVE_SVGALIB" = xyes; then +if test "x$HAVE_X" = xyes -a "x$HAVE_OPENGL" = xyes -a "x$HAVE_SVGALIB" = xyes; then VID_REFS="$VID_REFS ref_tdfx.la" BUILD_TDFX="yes" fi diff --git a/src/Makefile.am b/src/Makefile.am index 25503f7..d0edf08 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -76,8 +76,8 @@ endif # ref_tdfx if BUILD_TDFX ref_tdfx_la_SOURCES = $(REF_GL_COMMON) rw_in_svgalib.c gl_fxmesa.c -ref_tdfx_la_CFLAGS = $(std_cflags) -fPIC @GLIDE_CFLAGS@ @X_CFLAGS@ @SVGALIB_CFLAGS@ -ref_tdfx_la_LDADD = @GLIDE_LIBS@ @X_LIBS@ @SVGALIB_LIBS@ +ref_tdfx_la_CFLAGS = $(std_cflags) -fPIC @SVGALIB_CFLAGS@ +ref_tdfx_la_LDADD = @SVGALIB_LIBS@ ref_tdfx_la_LDFLAGS = $(module_ldflags) endif diff --git a/src/gl_fxmesa.c b/src/gl_fxmesa.c index 373bc15..0c0fd66 100644 --- a/src/gl_fxmesa.c +++ b/src/gl_fxmesa.c @@ -61,18 +61,56 @@ #include "glw.h" -#include - /*****************************************************************************/ glwstate_t glw_state; -static qboolean GLimp_SwitchFullscreen( int width, int height ); +//static qboolean GLimp_SwitchFullscreen( int width, int height ); qboolean GLimp_InitGL (void); +qboolean have_stencil = false; extern cvar_t *vid_fullscreen; extern cvar_t *vid_ref; +#define GLAPI extern +#define GLAPIENTRY + +#define FXMESA_NONE 0 // to terminate attribList +#define FXMESA_DOUBLEBUFFER 10 +#define FXMESA_ALPHA_SIZE 11 // followed by an integer +#define FXMESA_DEPTH_SIZE 12 // followed by an integer + + +typedef struct tfxMesaContext *fxMesaContext; + +typedef long FxI32; +typedef FxI32 GrScreenResolution_t; +typedef FxI32 GrDitherMode_t; +typedef FxI32 GrScreenRefresh_t; + + +#define GR_REFRESH_75Hz 0x3 + +#define GR_DITHER_2x2 0x1 +#define GR_DITHER_4x4 0x2 +#define GR_RESOLUTION_320x200 0x0 +#define GR_RESOLUTION_320x240 0x1 +#define GR_RESOLUTION_400x256 0x2 +#define GR_RESOLUTION_512x384 0x3 +#define GR_RESOLUTION_640x200 0x4 +#define GR_RESOLUTION_640x350 0x5 +#define GR_RESOLUTION_640x400 0x6 +#define GR_RESOLUTION_640x480 0x7 +#define GR_RESOLUTION_800x600 0x8 +#define GR_RESOLUTION_960x720 0x9 +#define GR_RESOLUTION_856x480 0xA +#define GR_RESOLUTION_512x256 0xB +#define GR_RESOLUTION_1024x768 0xC +#define GR_RESOLUTION_1280x1024 0xD +#define GR_RESOLUTION_1600x1200 0xE +#define GR_RESOLUTION_400x300 0xF + + static fxMesaContext fc = NULL; //FX Mesa Functions @@ -86,7 +124,7 @@ void (*qfxMesaSwapBuffers)(void); #define NUM_RESOLUTIONS 16 -static resolutions[NUM_RESOLUTIONS][3]={ +static int resolutions[NUM_RESOLUTIONS][3]={ { 320,200, GR_RESOLUTION_320x200 }, { 320,240, GR_RESOLUTION_320x240 }, { 400,256, GR_RESOLUTION_400x256 }, @@ -125,7 +163,7 @@ static void signal_handler(int sig) { printf("Received signal %d, exiting...\n", sig); GLimp_Shutdown(); - _exit(0); + exit(0); } static void InitSig(void) diff --git a/src/vid_menu.c b/src/vid_menu.c index bfb9beb..27b751a 100644 --- a/src/vid_menu.c +++ b/src/vid_menu.c @@ -176,7 +176,7 @@ static void ApplyChanges( void *unused ) vid_ref->modified = true; break; case REF_FXGL: - Cvar_Set("vid_ref", "fxgl"); + Cvar_Set("vid_ref", "tdfx"); /* below is wrong if we use different libs for different GL reflibs */ Cvar_Set( "gl_driver", "libGL.so.1" ); if (gl_driver->modified)