DirectDraw -> WineD3D patch
Stefan Dösinger
stefandoesinger at gmx.at
Sat Mar 4 03:41:22 CST 2006
Hi,
> from IWineD3DDeviceImpl_CreatePalette:
> + memset(&palVersion, 0, sizeof(LOGPALETTE));
> + object->hpal = CreatePalette(&palVersion);
> + memcpy(&object->palVersion, &palVersion, sizeof(LOGPALETTE));
> + /* FIXME Using the palVersion member from IWineD3DPaletteImpl for
> CreatePalette + * directly causes a heap corruption. Why? In original
> ddraw this was a WORD, + * which failed too. Confused ...
> + */
> + object->palNumEntries = IWineD3DPaletteImpl_Size(Flags);
>
> That can't really work. This only creates a palette with zero entries.
> You need to set palNumEntries before calling CreatePalette.
> Attached patch( applies on top of yours ) should fix it( i.e. do it the
> same way it is done in the current implementation).
> But the text colors in AoE are still lacking :/.
> Needs some more investigation ...
I'll look at this, the whole palette code is a bit messy. My suspicion is that
IDirectDrawPaletteImpl_SetEntries / IWineD3DPaletteImpl_SetEntries doesn't
update all surfaces that use a palette. I also have to take
IWineD3DDevice::SetCurrentTexturePalette,
IWineD3DDevice::GetCurrentTexturePalette as well as
IWineD3DDevice::SetPaletteEntries and GetPaletteEntries in account.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20060304/70685ca7/attachment.pgp
More information about the wine-devel
mailing list