mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-15 06:04:49 +01:00
Change palette data_rgb to external RGBQUAD array for software rendering, it was not used before
This commit is contained in:
parent
6e01d1c722
commit
a0c80f3e83
10
palette.c
10
palette.c
@ -35,7 +35,13 @@ HRESULT __stdcall ddraw_palette_SetEntries(IDirectDrawPaletteImpl *This, DWORD d
|
||||
for(i=0;i<256;i++)
|
||||
{
|
||||
This->data_bgr[i] = (lpEntries[i].peBlue<<16)|(lpEntries[i].peGreen<<8)|lpEntries[i].peRed;
|
||||
This->data_rgb[i] = (lpEntries[i].peRed<<16)|(lpEntries[i].peGreen<<8)|(lpEntries[i].peBlue);
|
||||
if (This->data_rgb)
|
||||
{
|
||||
This->data_rgb[i].rgbRed = lpEntries[i].peRed;
|
||||
This->data_rgb[i].rgbGreen = lpEntries[i].peGreen;
|
||||
This->data_rgb[i].rgbBlue = lpEntries[i].peBlue;
|
||||
This->data_rgb[i].rgbReserved = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return DD_OK;
|
||||
@ -105,6 +111,8 @@ HRESULT __stdcall ddraw_CreatePalette(IDirectDrawImpl *This, DWORD dwFlags, LPPA
|
||||
printf(" Palette = %p\n", Palette);
|
||||
*lpDDPalette = (LPDIRECTDRAWPALETTE)Palette;
|
||||
|
||||
Palette->data_rgb = NULL;
|
||||
|
||||
ddraw_palette_SetEntries(Palette, dwFlags, 0, 256, lpDDColorArray);
|
||||
|
||||
ddraw_palette_AddRef(Palette);
|
||||
|
Loading…
x
Reference in New Issue
Block a user