This nice patch of Jerome Gardou improves palette
when VBEMP & inbuilt Mesa is used for
Diablo II, MS Age Of Empires 1, Anno 1602
to the state we had in SVN r75060 and below.
We already committed this fix into 0.4.8-release before.
/* Get the handle for the bitmap */
desc->hBitmap = (HBITMAP)psurf->SurfObj.hsurf;
+ /* Allocate a palette for this surface */
+ if (format->bit_count <= 8)
+ {
+ PPALETTE palette = PALETTE_AllocPalette(PAL_INDEXED, 1 << format->bit_count, NULL, 0, 0, 0);
+ if (palette)
+ {
+ SURFACE_vSetPalette(psurf, palette);
+ PALETTE_ShareUnlockPalette(palette);
+ }
+ }
+
/* Unlock the surface and return */
SURFACE_UnlockSurface(psurf);