d_8to16table moved to vid_common_sw.c and fix vid_fbdev blackness (must call

VID_InitGamma before VID_SetPalette)
This commit is contained in:
Bill Currie 2001-04-17 06:13:51 +00:00
parent 4b19a1967d
commit f5c01925d4
10 changed files with 3 additions and 41 deletions

View file

@ -57,7 +57,6 @@
#define WARP_WIDTH 320 #define WARP_WIDTH 320
#define WARP_HEIGHT 200 #define WARP_HEIGHT 200
//unsigned short d_8to16table[256];
unsigned int d_8to24table[256]; unsigned int d_8to24table[256];
unsigned char d_15to8table[65536]; unsigned char d_15to8table[65536];

View file

@ -36,6 +36,8 @@
#include "QF/sys.h" #include "QF/sys.h"
#include "QF/vid.h" #include "QF/vid.h"
unsigned short d_8to16table[256];
void void
VID_InitBuffers (void) VID_InitBuffers (void)
{ {

View file

@ -83,7 +83,6 @@ byte vid_current_palette[768]; // save for mode changes
static qboolean nomodecheck = false; static qboolean nomodecheck = false;
unsigned short d_8to16table[256]; // not used in 8 bpp mode
unsigned d_8to24table[256]; // not used in 8 bpp mode unsigned d_8to24table[256]; // not used in 8 bpp mode
void VID_MenuDraw (void); void VID_MenuDraw (void);

View file

@ -69,8 +69,6 @@
#include "fbset.h" #include "fbset.h"
unsigned short d_8to16table[256];
extern void ReadModeDB(void); extern void ReadModeDB(void);
extern struct VideoMode *FindVideoMode(const char *name); extern struct VideoMode *FindVideoMode(const char *name);
void ConvertFromVideoMode(const struct VideoMode *vmode, void ConvertFromVideoMode(const struct VideoMode *vmode,
@ -156,34 +154,6 @@ D_EndDirectRect (int x, int y, int width, int height)
} }
static void
VID_Gamma_f (void)
{
float gamma, f, inf;
unsigned char palette[768];
int i;
if (Cmd_Argc () == 2) {
gamma = atof (Cmd_Argv (1));
for (i = 0; i < 768; i++) {
f = pow ((vid_basepal[i] + 1) / 256.0, gamma);
inf = f * 255 + 0.5;
if (inf < 0)
inf = 0;
if (inf > 255)
inf = 255;
palette[i] = inf;
}
VID_SetPalette (palette);
/* Force a surface cache flush */
vid.recalc_refdef = 1;
}
}
static void static void
VID_DescribeMode_f (void) VID_DescribeMode_f (void)
{ {
@ -506,8 +476,6 @@ VID_Init (unsigned char *palette)
if (fbdev_inited) if (fbdev_inited)
return; return;
Cmd_AddCommand ("gamma", VID_Gamma_f, "No Description");
if (UseDisplay) { if (UseDisplay) {
fbname = getenv("FRAMEBUFFER"); fbname = getenv("FRAMEBUFFER");
if (!fbname) if (!fbname)
@ -561,6 +529,7 @@ VID_Init (unsigned char *palette)
VID_SetMode (current_mode.name, palette); VID_SetMode (current_mode.name, palette);
Con_CheckResize (); // Now that we have a window size, fix console Con_CheckResize (); // Now that we have a window size, fix console
VID_InitGamma (palette);
VID_SetPalette (palette); VID_SetPalette (palette);
} }
} }

View file

@ -142,7 +142,6 @@ static int VID_highhunkmark;
unsigned char vid_curpal[256 * 3]; unsigned char vid_curpal[256 * 3];
unsigned short d_8to16table[256];
unsigned int d_8to24table[256]; unsigned int d_8to24table[256];
int driver = grDETECT, mode; int driver = grDETECT, mode;

View file

@ -60,7 +60,6 @@ cvar_t *vid_fullscreen;
cvar_t *vid_system_gamma; cvar_t *vid_system_gamma;
qboolean vid_gamma_avail; qboolean vid_gamma_avail;
extern viddef_t vid; // global video state extern viddef_t vid; // global video state
unsigned short d_8to16table[256];
int modestate; // FIXME: just to avoid cross-comp. int modestate; // FIXME: just to avoid cross-comp.
// errors - remove later // errors - remove later

View file

@ -102,7 +102,6 @@ typedef struct {
} keymap_t; } keymap_t;
viddef_t vid; // global video state viddef_t vid; // global video state
unsigned short d_8to16table[256];
int num_shades = 32; int num_shades = 32;

View file

@ -104,7 +104,6 @@ typedef struct {
} keymap_t; } keymap_t;
viddef_t vid; // global video state viddef_t vid; // global video state
unsigned short d_8to16table[256];
int num_shades = 32; int num_shades = 32;

View file

@ -60,8 +60,6 @@ void VGA_UpdatePlanarScreen (void *srcbuffer);
cvar_t *vid_system_gamma; cvar_t *vid_system_gamma;
qboolean vid_gamma_avail; qboolean vid_gamma_avail;
unsigned short d_8to16table[256];
static int num_modes, current_mode; static int num_modes, current_mode;
static vga_modeinfo *modes; static vga_modeinfo *modes;

View file

@ -80,7 +80,6 @@
#include "dga_check.h" #include "dga_check.h"
extern viddef_t vid; // global video state extern viddef_t vid; // global video state
unsigned short d_8to16table[256];
static Colormap x_cmap; static Colormap x_cmap;
static GC x_gc; static GC x_gc;