Skip to content

Commit 8dc1609

Browse files
committed
[0.4.8] [WIN32SS] D3DKMT commit fix of zefklop for CORE-13714
This commit was *not* committed to master yet. I'll leave the ticket unresolved until it'll be. We had the palette for some games regressed starting with r75061 when using VBEMP (and our inbuilt Mesa, not the rapps Mesa). This wasn't noticed early because the same commit led to many games crashing as well. After we recovered from the crashes later, we were confronted with a regressed palette state. E.g. in Diablo II, Anno 1602, MS Age of Empires. With that commit the palette now looks like in r75060 again. Palette in Rapps Mesa is now equal again to palette inbuilt Mesa. The palette is still not perfect - (CORE-10738 still needs to be addressed later). Many thanks to zefklop!
1 parent f4b2e53 commit 8dc1609

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

win32ss/reactx/ntddraw/d3dkmt.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ NtGdiDdDDICreateDCFromMemory(D3DKMT_CREATEDCFROMMEMORY *desc)
8686
/* Get the handle for the bitmap */
8787
desc->hBitmap = (HBITMAP)psurf->SurfObj.hsurf;
8888

89+
/* Allocate a palette for this surface */
90+
if (format->bit_count <= 8)
91+
{
92+
PPALETTE palette = PALETTE_AllocPalette(PAL_INDEXED, 1 << format->bit_count, NULL, 0, 0, 0);
93+
if (palette)
94+
{
95+
SURFACE_vSetPalette(psurf, palette);
96+
PALETTE_ShareUnlockPalette(palette);
97+
}
98+
}
99+
89100
/* Unlock the surface and return */
90101
SURFACE_UnlockSurface(psurf);
91102

0 commit comments

Comments
 (0)