From 6b57afe022f9746975ec875963b70959b821feb1 Mon Sep 17 00:00:00 2001
From: TimeServ <timeserv@users.sourceforge.net>
Date: Wed, 1 Nov 2006 07:23:08 +0000
Subject: [PATCH] fix 8-bit sw on 64-bit X

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2438 fc73d0e0-1445-4013-8a0c-d673dee63da5
---
 engine/sw/vid_x.c | 40 ++++++++++------------------------------
 1 file changed, 10 insertions(+), 30 deletions(-)

diff --git a/engine/sw/vid_x.c b/engine/sw/vid_x.c
index 35aab1d92..6b8cd8b02 100644
--- a/engine/sw/vid_x.c
+++ b/engine/sw/vid_x.c
@@ -24,8 +24,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "quakedef.h"
 #include "d_local.h"
 
+// these need to be fixed to assured n-bit types
 typedef unsigned short PIXEL;
-typedef unsigned long PIXEL32;
+typedef unsigned int PIXEL32;
 
 #include <ctype.h>
 #include <sys/time.h>
@@ -540,7 +541,6 @@ qboolean SWVID_Init (rendererstate_t *info, unsigned char *palette)
 
 		return false;
 	}
-printf("%8x\n", (int)vid_dpy);
 
 // catch signals so i can turn on auto-repeat
 
@@ -584,7 +584,7 @@ printf("%8x\n", (int)vid_dpy);
 	{
 		Con_Printf("Found more than one visual id at depth %d:\n", template.depth);
 		for (i=0 ; i<num_visuals ; i++)
-			printf("	-visualid %d\n", (int)(x_visinfo[i].visualid));
+			Con_Printf("	-visualid %d\n", (int)(x_visinfo[i].visualid));
 	}
 	else if (num_visuals == 0)
 	{
@@ -602,13 +602,13 @@ printf("%8x\n", (int)vid_dpy);
 
 	if (verbose)
 	{
-		printf("Using visualid %d:\n", (int)(x_visinfo->visualid));
-		printf("	screen %d\n", x_visinfo->screen);
-		printf("	red_mask 0x%x\n", (int)(x_visinfo->red_mask));
-		printf("	green_mask 0x%x\n", (int)(x_visinfo->green_mask));
-		printf("	blue_mask 0x%x\n", (int)(x_visinfo->blue_mask));
-		printf("	colormap_size %d\n", x_visinfo->colormap_size);
-		printf("	bits_per_rgb %d\n", x_visinfo->bits_per_rgb);
+		Con_Printf("Using visualid %d:\n", (int)(x_visinfo->visualid));
+		Con_Printf("	screen %d\n", x_visinfo->screen);
+		Con_Printf("	red_mask 0x%x\n", (int)(x_visinfo->red_mask));
+		Con_Printf("	green_mask 0x%x\n", (int)(x_visinfo->green_mask));
+		Con_Printf("	blue_mask 0x%x\n", (int)(x_visinfo->blue_mask));
+		Con_Printf("	colormap_size %d\n", x_visinfo->colormap_size);
+		Con_Printf("	bits_per_rgb %d\n", x_visinfo->bits_per_rgb);
 	}
 
 //our rendering works in 8, 16, or 32 bpp.
@@ -1159,26 +1159,6 @@ void	SWVID_Update (vrect_t *rects)
 
 }
 
-static int dither;
-
-void VID_DitherOn(void)
-{
-    if (dither == 0)
-    {
-		vid.recalc_refdef = 1;
-        dither = 1;
-    }
-}
-
-void VID_DitherOff(void)
-{
-    if (dither)
-    {
-		vid.recalc_refdef = 1;
-        dither = 0;
-    }
-}
-
 int Sys_OpenWindow(void)
 {
 	return 0;