From df3d9fe4df1757b2595958d12a042dc2f5b57724 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 2 Jan 2012 10:53:57 +0900 Subject: [PATCH] Correct the fullbright start color extraction. I don't know what despair and I were thinking, but we obviously didn't understand the colormap code at the time. --- libs/video/targets/vid_3dfxsvga.c | 2 +- libs/video/targets/vid_fbdev.c | 4 ++-- libs/video/targets/vid_glx.c | 2 +- libs/video/targets/vid_sdl.c | 2 +- libs/video/targets/vid_sgl.c | 2 +- libs/video/targets/vid_svgalib.c | 2 +- libs/video/targets/vid_wgl.c | 2 +- libs/video/targets/vid_x11.c | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libs/video/targets/vid_3dfxsvga.c b/libs/video/targets/vid_3dfxsvga.c index 9c958fa25..bc6a3ca2a 100644 --- a/libs/video/targets/vid_3dfxsvga.c +++ b/libs/video/targets/vid_3dfxsvga.c @@ -291,7 +291,7 @@ VID_Init (unsigned char *palette) vid.maxwarpwidth = WARP_WIDTH; vid.maxwarpheight = WARP_HEIGHT; vid.colormap8 = vid_colormap; - vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048)); + vid.fullbright = 256 - vid.colormap8[256 * VID_GRADES]; // interpret command-line params diff --git a/libs/video/targets/vid_fbdev.c b/libs/video/targets/vid_fbdev.c index 592f6b9f7..318f676ad 100644 --- a/libs/video/targets/vid_fbdev.c +++ b/libs/video/targets/vid_fbdev.c @@ -308,7 +308,7 @@ VID_SetMode (const char *name, unsigned char *palette) vid.height = vmode->yres; vid.rowbytes = vmode->xres * (vmode->depth >> 3); vid.colormap8 = (byte *) vid_colormap; - vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048)); + vid.fullbright = 256 - vid.colormap8[256 * VID_GRADES]; vid.conrowbytes = vid.rowbytes; vid.numpages = 1; @@ -416,7 +416,7 @@ VID_Init (unsigned char *palette) vid.rowbytes = 320; vid.aspect = ((float) vid.height / (float) vid.width) * (4.0 / 3.0); vid.colormap8 = (byte *) vid_colormap; - vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048)); + vid.fullbright = 256 - vid.colormap8[256 * VID_GRADES]; vid.conrowbytes = vid.rowbytes; vid.conwidth = vid.width; vid.conheight = vid.height; diff --git a/libs/video/targets/vid_glx.c b/libs/video/targets/vid_glx.c index c01177956..7a5619088 100644 --- a/libs/video/targets/vid_glx.c +++ b/libs/video/targets/vid_glx.c @@ -206,7 +206,7 @@ VID_Init (unsigned char *palette) vid.maxwarpwidth = WARP_WIDTH; vid.maxwarpheight = WARP_HEIGHT; vid.colormap8 = vid_colormap; - vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048)); + vid.fullbright = 256 - vid.colormap8[256 * VID_GRADES]; X11_OpenDisplay (); diff --git a/libs/video/targets/vid_sdl.c b/libs/video/targets/vid_sdl.c index 8169e82c8..86f63d8a3 100644 --- a/libs/video/targets/vid_sdl.c +++ b/libs/video/targets/vid_sdl.c @@ -112,7 +112,7 @@ VID_Init (unsigned char *palette) VGA_height = vid.height; vid.numpages = 1; vid.colormap8 = vid_colormap; - vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048)); + vid.fullbright = 256 - vid.colormap8[256 * VID_GRADES]; vid.do_screen_buffer = do_screen_buffer; VGA_pagebase = vid.buffer = screen->pixels; VGA_rowbytes = vid.rowbytes = screen->pitch; diff --git a/libs/video/targets/vid_sgl.c b/libs/video/targets/vid_sgl.c index bf17bd02b..0287b37e5 100644 --- a/libs/video/targets/vid_sgl.c +++ b/libs/video/targets/vid_sgl.c @@ -115,7 +115,7 @@ VID_Init (unsigned char *palette) vid.maxwarpwidth = WARP_WIDTH; vid.maxwarpheight = WARP_HEIGHT; vid.colormap8 = vid_colormap; - vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048)); + vid.fullbright = 256 - vid.colormap8[256 * VID_GRADES]; // Check if we want fullscreen if (vid_fullscreen->int_val) { diff --git a/libs/video/targets/vid_svgalib.c b/libs/video/targets/vid_svgalib.c index 0321355aa..3839a309f 100644 --- a/libs/video/targets/vid_svgalib.c +++ b/libs/video/targets/vid_svgalib.c @@ -305,7 +305,7 @@ VID_SetMode (int modenum, unsigned char *palette) } vid.colormap8 = (byte *) vid_colormap; - vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048)); + vid.fullbright = 256 - vid.colormap8[256 * VID_GRADES]; vid.conrowbytes = vid.rowbytes; vid.numpages = 1; diff --git a/libs/video/targets/vid_wgl.c b/libs/video/targets/vid_wgl.c index 39080ca40..8f61ecb94 100644 --- a/libs/video/targets/vid_wgl.c +++ b/libs/video/targets/vid_wgl.c @@ -537,7 +537,7 @@ VID_Init (unsigned char *palette) vid.maxwarpwidth = WARP_WIDTH; vid.maxwarpheight = WARP_HEIGHT; vid.colormap8 = vid_colormap; - vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048)); + vid.fullbright = 256 - vid.colormap8[256 * VID_GRADES]; #ifdef SPLASH_SCREEN if(hwnd_dialog) diff --git a/libs/video/targets/vid_x11.c b/libs/video/targets/vid_x11.c index ac7a6050f..bcecb4e09 100644 --- a/libs/video/targets/vid_x11.c +++ b/libs/video/targets/vid_x11.c @@ -403,7 +403,7 @@ VID_Init (unsigned char *palette) vid.numpages = 2; vid.colormap8 = vid_colormap; - vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048)); + vid.fullbright = 256 - vid.colormap8[256 * VID_GRADES]; srandom (getpid ());