Fixes crashes when sw32_r_pixbytes is set to 2 or 4

This commit is contained in:
Johnny 2014-02-02 05:19:04 -02:00 committed by Bill Currie
parent 9d71d9bb7a
commit 850382eed4
2 changed files with 2 additions and 3 deletions

View file

@ -71,6 +71,7 @@ sw32_D_Init (void)
vr_data.vid->init_caches = sw32_D_InitCaches;
VID_InitBuffers ();
VID_MakeColormaps();
}
void

View file

@ -188,15 +188,13 @@ VID_MakeColormap8 (void *outcolormap, byte *pal)
LordHavoc: makes 8bit, 16bit, and 32bit colormaps and palettes
*/
static __attribute__((used)) void //FIXME
void
VID_MakeColormaps (int fullbrights, byte *pal)
{
vid.fullbright = fullbrights;
vid.colormap8 = malloc (256*VID_GRADES * sizeof (byte));
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_MakeColormap8(vid.colormap8, pal);
VID_MakeColormap16(vid.colormap16, pal);
VID_MakeColormap32(vid.colormap32, pal);
}