From 3ea4bdda6841c44de421fb8769fc17a5fc2bb8bb Mon Sep 17 00:00:00 2001 From: Jeff Teunissen Date: Mon, 22 Jan 2001 18:21:46 +0000 Subject: [PATCH] Handle 3DFX_set_dither_mode extension properly. --- source/vid_3dfxsvga.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/source/vid_3dfxsvga.c b/source/vid_3dfxsvga.c index 2017c88..8a77c20 100644 --- a/source/vid_3dfxsvga.c +++ b/source/vid_3dfxsvga.c @@ -112,25 +112,31 @@ GL_Init void GL_Init (void) { + QF_3DfxSetDitherModeEXT dither_select = NULL; + int p; + GL_Init_Common (); + if (!(QFGL_ExtensionPresent ("3DFX_set_dither_mode"))) + return; + + if (!(dither_select = QFGL_ExtensionAddress ("gl3DfxSetDitherModeEXT"))) + return; + Con_Printf ("Dithering: "); - if (QFGL_ExtensionPresent ("3DFX_set_dither_mode")) { - QF_3DfxSetDitherModeEXT dither_select = NULL; - - dither_select = QFGL_ExtensionAddress ("gl3DfxSetDitherModeEXT"); - - if (COM_CheckParm ("-dither_2x2")) { + if ((p = COM_CheckParm ("-dither") && p < com_argc)) { + if (strequal (com_argv[p+1], "2x2") { dither_select (GR_DITHER_2x2); Con_Printf ("2x2.\n"); - } else if (COM_CheckParm ("-dither_4x4")) { + } + if (strequal (com_argv[p+1], "4x4") { dither_select (GR_DITHER_4x4); Con_Printf ("4x4.\n"); - } else { - glDisable (GL_DITHER); - Con_Printf ("disabled.\n"); } + } else { + glDisable (GL_DITHER); + Con_Printf ("disabled.\n"); } }