Palette never gets changed in GL mode now.

This commit is contained in:
Jeff Teunissen 2000-09-21 19:15:44 +00:00
parent 1d3935a903
commit 9691cca81d
3 changed files with 48 additions and 28 deletions

View file

@ -191,8 +191,7 @@ void V_UpdatePalette (void)
basepal = host_basepal;
newpal = pal;
for (i=0 ; i<256 ; i++)
{
for (i=0; i<256; i++) {
ir = basepal[0];
ig = basepal[1];
ib = basepal[2];
@ -207,3 +206,19 @@ void V_UpdatePalette (void)
VID_ShiftPalette (pal);
}
/*
BuildGammaTable
In software mode, this function gets the palette ready for changing...in
in GL, it does very little as you can see.
*/
void
BuildGammaTable (float b, float c)
{
int i;
for (i = 0; i < 256; i++)
gammatable[i] = i;
return;
}

View file

@ -88,6 +88,8 @@ extern int in_forward, in_forward2, in_back;
frame_t *view_frame;
player_state_t *view_message;
void BuildGammaTable (float, float);
/*
===============
V_CalcRoll
@ -280,32 +282,6 @@ cvar_t *contrast;
byte gammatable[256]; // palette is sent through this
void BuildGammaTable (float b, float c)
{
int i, j, inf = 0;
if ((b == 1.0) && (c == 1.0)) {
for (i = 0; i < 256; i++)
gammatable[i] = i;
return;
}
for (i=0 ; i<256 ; i++) {
if (!(i == 128)) {
if (i < 128) {
j = i + (int) ((128 - i) * (1 - c));
} else {
j = i + (int) ((i - 128) * (1 - c));
}
} else {
j = i;
}
inf = (j * b); // gamma is brightness now, and positive
inf = bound(0, inf, 255);
gammatable[i] = inf;
}
}
/*
=================
V_CheckGamma

View file

@ -104,3 +104,32 @@ void V_UpdatePalette (void)
}
VID_ShiftPalette (pal);
}
void
BuildGammaTable (float b, float c)
{
int i, j;
int inf = 0;
if ((b == 1.0) && (c == 1.0)) {
for (i = 0; i < 256; i++)
gammatable[i] = i;
return;
}
for (i=0 ; i<256 ; i++) {
if (!(i == 128)) {
if (i < 128) {
j = i + (int) ((128 - i) * (1 - c));
} else {
j = i + (int) ((i - 128) * (1 - c));
}
} else {
j = i;
}
inf = (j * b); // gamma is brightness now, and positive
inf = bound(0, inf, 255);
gammatable[i] = inf;
}
}