Commit 2e851544 authored by Oliver Stieber's avatar Oliver Stieber Committed by Alexandre Julliard

Allow the palette to be set and retrieved.

parent 5617b716
......@@ -4463,25 +4463,62 @@ HRESULT WINAPI IWineD3DDeviceImpl_ValidateDevice(IWineD3DDevice *iface, DWORD*
HRESULT WINAPI IWineD3DDeviceImpl_SetPaletteEntries(IWineD3DDevice *iface, UINT PaletteNumber, CONST PALETTEENTRY* pEntries) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
FIXME("(%p) : stub\n", This);
int j;
TRACE("(%p) : PaletteNumber %u\n", This, PaletteNumber);
if ( PaletteNumber < 0 || PaletteNumber >= MAX_PALETTES) {
WARN("(%p) : (%u) Out of range 0-%u, returning Invalid Call\n", This, PaletteNumber, MAX_PALETTES);
return D3DERR_INVALIDCALL;
}
for (j = 0; j < 256; ++j) {
This->palettes[PaletteNumber][j].peRed = pEntries[j].peRed;
This->palettes[PaletteNumber][j].peGreen = pEntries[j].peGreen;
This->palettes[PaletteNumber][j].peBlue = pEntries[j].peBlue;
This->palettes[PaletteNumber][j].peFlags = pEntries[j].peFlags;
}
TRACE("(%p) : returning\n", This);
return D3D_OK;
}
HRESULT WINAPI IWineD3DDeviceImpl_GetPaletteEntries(IWineD3DDevice *iface, UINT PaletteNumber, PALETTEENTRY* pEntries) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
FIXME("(%p) : stub\n", This);
int j;
TRACE("(%p) : PaletteNumber %u\n", This, PaletteNumber);
if ( PaletteNumber < 0 || PaletteNumber >= MAX_PALETTES) {
WARN("(%p) : (%u) Out of range 0-%u, returning Invalid Call\n", This, PaletteNumber, MAX_PALETTES);
return D3DERR_INVALIDCALL;
}
for (j = 0; j < 256; ++j) {
pEntries[j].peRed = This->palettes[PaletteNumber][j].peRed;
pEntries[j].peGreen = This->palettes[PaletteNumber][j].peGreen;
pEntries[j].peBlue = This->palettes[PaletteNumber][j].peBlue;
pEntries[j].peFlags = This->palettes[PaletteNumber][j].peFlags;
}
TRACE("(%p) : returning\n", This);
return D3D_OK;
}
HRESULT WINAPI IWineD3DDeviceImpl_SetCurrentTexturePalette(IWineD3DDevice *iface, UINT PaletteNumber) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
FIXME("(%p) : stub\n", This);
TRACE("(%p) : PaletteNumber %u\n", This, PaletteNumber);
if ( PaletteNumber < 0 || PaletteNumber >= MAX_PALETTES) {
WARN("(%p) : (%u) Out of range 0-%u, returning Invalid Call\n", This, PaletteNumber, MAX_PALETTES);
return D3DERR_INVALIDCALL;
}
/*TODO: stateblocks */
This->currentPalette = PaletteNumber;
TRACE("(%p) : returning\n", This);
return D3D_OK;
}
HRESULT WINAPI IWineD3DDeviceImpl_GetCurrentTexturePalette(IWineD3DDevice *iface, UINT* PaletteNumber) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
FIXME("(%p) : stub\n", This);
if (PaletteNumber == NULL) {
WARN("(%p) : returning Invalid Call\n", This);
return D3DERR_INVALIDCALL;
}
/*TODO: stateblocks */
*PaletteNumber = This->currentPalette;
TRACE("(%p) : returning %u\n", This, *PaletteNumber);
return D3D_OK;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment