mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 15:01:41 +00:00
Fix some compile errors from Johnny's patch.
Turns out he has to compile without -Werror.
This commit is contained in:
parent
850382eed4
commit
d80342e0a8
2 changed files with 6 additions and 56 deletions
|
@ -20,5 +20,7 @@ void VID_Update (vrect_t *rects);
|
|||
void VID_LockBuffer (void);
|
||||
void VID_UnlockBuffer (void);
|
||||
void VID_InitBuffers (void);
|
||||
void VID_MakeColormaps (void);
|
||||
|
||||
|
||||
#endif//__vid_internal_h
|
||||
|
|
|
@ -43,34 +43,6 @@
|
|||
unsigned short sw32_8to16table[256];
|
||||
|
||||
|
||||
/*
|
||||
lhfindcolor
|
||||
|
||||
LordHavoc: finds nearest matching color in a palette
|
||||
*/
|
||||
static int
|
||||
lhfindcolor (byte *pal, int colors, int r, int g, int b)
|
||||
{
|
||||
int i, dist, best, bestdist, rd, gd, bd;
|
||||
best = 0;
|
||||
bestdist = 1000000000;
|
||||
for (i = 0;i < colors;i++)
|
||||
{
|
||||
rd = pal[i*3+0] - r;
|
||||
gd = pal[i*3+1] - g;
|
||||
bd = pal[i*3+2] - b;
|
||||
dist = rd*rd+gd*gd+bd*bd;
|
||||
if (dist < bestdist)
|
||||
{
|
||||
if (!dist) // exact match
|
||||
return i;
|
||||
best = i;
|
||||
bestdist = dist;
|
||||
}
|
||||
}
|
||||
return best;
|
||||
}
|
||||
|
||||
/*
|
||||
VID_MakeColormap32
|
||||
|
||||
|
@ -160,41 +132,17 @@ VID_MakeColormap16 (void *outcolormap, byte *pal)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
VID_MakeColormap8
|
||||
|
||||
LordHavoc: makes a 8bit color*light table
|
||||
*/
|
||||
static void
|
||||
VID_MakeColormap8 (void *outcolormap, byte *pal)
|
||||
{
|
||||
int c, l;
|
||||
byte *out;
|
||||
out = (byte *) outcolormap;
|
||||
for (l = 0;l < VID_GRADES;l++)
|
||||
{
|
||||
for (c = 0;c < vid.fullbright;c++)
|
||||
out[l*256+c] = lhfindcolor(pal, 256,
|
||||
(pal[c*3+0] * l) >> (VID_CBITS - 1),
|
||||
(pal[c*3+1] * l) >> (VID_CBITS - 1),
|
||||
(pal[c*3+2] * l) >> (VID_CBITS - 1));
|
||||
for (;c < 256;c++)
|
||||
out[l*256+c] = c;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
VID_MakeColormaps
|
||||
|
||||
LordHavoc: makes 8bit, 16bit, and 32bit colormaps and palettes
|
||||
*/
|
||||
void
|
||||
VID_MakeColormaps (int fullbrights, byte *pal)
|
||||
VID_MakeColormaps (void)
|
||||
{
|
||||
vid.fullbright = fullbrights;
|
||||
vid.colormap16 = malloc (256*VID_GRADES * sizeof (short));
|
||||
vid.colormap32 = malloc (256*VID_GRADES * sizeof (int));
|
||||
SYS_CHECKMEM (vid.colormap8 && vid.colormap16 && vid.colormap32);
|
||||
VID_MakeColormap16(vid.colormap16, pal);
|
||||
VID_MakeColormap32(vid.colormap32, pal);
|
||||
SYS_CHECKMEM (vid.colormap16 && vid.colormap32);
|
||||
VID_MakeColormap16(vid.colormap16, vid.palette);
|
||||
VID_MakeColormap32(vid.colormap32, vid.palette);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue