mirror of https://git.code.sf.net/p/quake/newtree
Palette never gets changed in GL mode now.
This commit is contained in:
parent
1d3935a903
commit
9691cca81d
|
@ -191,8 +191,7 @@ void V_UpdatePalette (void)
|
||||||
basepal = host_basepal;
|
basepal = host_basepal;
|
||||||
newpal = pal;
|
newpal = pal;
|
||||||
|
|
||||||
for (i=0 ; i<256 ; i++)
|
for (i=0; i<256; i++) {
|
||||||
{
|
|
||||||
ir = basepal[0];
|
ir = basepal[0];
|
||||||
ig = basepal[1];
|
ig = basepal[1];
|
||||||
ib = basepal[2];
|
ib = basepal[2];
|
||||||
|
@ -207,3 +206,19 @@ void V_UpdatePalette (void)
|
||||||
VID_ShiftPalette (pal);
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -88,6 +88,8 @@ extern int in_forward, in_forward2, in_back;
|
||||||
frame_t *view_frame;
|
frame_t *view_frame;
|
||||||
player_state_t *view_message;
|
player_state_t *view_message;
|
||||||
|
|
||||||
|
void BuildGammaTable (float, float);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
===============
|
||||||
V_CalcRoll
|
V_CalcRoll
|
||||||
|
@ -280,32 +282,6 @@ cvar_t *contrast;
|
||||||
|
|
||||||
byte gammatable[256]; // palette is sent through this
|
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
|
V_CheckGamma
|
||||||
|
|
|
@ -104,3 +104,32 @@ void V_UpdatePalette (void)
|
||||||
}
|
}
|
||||||
VID_ShiftPalette (pal);
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue