wined3d: Don't store primary surface palette in device palettes.

This commit is contained in:
Alexander Dorofeyev 2008-03-25 02:04:02 +02:00 committed by Alexandre Julliard
parent 9b913b3b79
commit f2e03d6c3f
2 changed files with 8 additions and 29 deletions

View File

@ -157,17 +157,6 @@ static HRESULT WINAPI IWineD3DPaletteImpl_SetEntries(IWineD3DPalette *iface, DW
}
}
/* If the palette is the primary palette, set the entries to the device */
if(This->Flags & WINEDDPCAPS_PRIMARYSURFACE) {
unsigned int i;
IWineD3DDeviceImpl *device = This->wineD3DDevice;
PALETTEENTRY *entry = PalEnt;
for(i = Start; i < Start+Count; i++) {
device->palettes[device->currentPalette][i] = *entry++;
}
}
return WINED3D_OK;
}

View File

@ -206,26 +206,16 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetPalette(IWineD3DSurface *iface, IWineD
if(This->resource.usage & WINED3DUSAGE_RENDERTARGET)
This->palette->Flags &= ~WINEDDPCAPS_PRIMARYSURFACE;
if(PalImpl != NULL) {
if(This->resource.usage & WINED3DUSAGE_RENDERTARGET) {
/* Set the device's main palette if the palette
* wasn't a primary palette before
*/
if(!(PalImpl->Flags & WINEDDPCAPS_PRIMARYSURFACE)) {
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
unsigned int i;
for(i=0; i < 256; i++) {
device->palettes[device->currentPalette][i] = PalImpl->palents[i];
}
}
(PalImpl)->Flags |= WINEDDPCAPS_PRIMARYSURFACE;
}
}
This->palette = PalImpl;
return IWineD3DSurface_RealizePalette(iface);
if(PalImpl != NULL) {
if(This->resource.usage & WINED3DUSAGE_RENDERTARGET) {
(PalImpl)->Flags |= WINEDDPCAPS_PRIMARYSURFACE;
}
return IWineD3DSurface_RealizePalette(iface);
}
else return WINED3D_OK;
}
HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetColorKey(IWineD3DSurface *iface, DWORD Flags, WINEDDCOLORKEY *CKey) {