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_HEIGHT 200
//unsigned short d_8to16table[256];
unsigned int d_8to24table[256];
unsigned char d_15to8table[65536];

View file

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

View file

@ -83,7 +83,6 @@ byte vid_current_palette[768]; // save for mode changes
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
void VID_MenuDraw (void);

View file

@ -69,8 +69,6 @@
#include "fbset.h"
unsigned short d_8to16table[256];
extern void ReadModeDB(void);
extern struct VideoMode *FindVideoMode(const char *name);
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
VID_DescribeMode_f (void)
{
@ -506,8 +476,6 @@ VID_Init (unsigned char *palette)
if (fbdev_inited)
return;
Cmd_AddCommand ("gamma", VID_Gamma_f, "No Description");
if (UseDisplay) {
fbname = getenv("FRAMEBUFFER");
if (!fbname)
@ -561,6 +529,7 @@ VID_Init (unsigned char *palette)
VID_SetMode (current_mode.name, palette);
Con_CheckResize (); // Now that we have a window size, fix console
VID_InitGamma (palette);
VID_SetPalette (palette);
}
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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