WineD3D: optimize d3dfmt_convert_surface

Roderick Colenbrander thunderbird2k at gmx.net
Fri Jul 28 06:57:49 CDT 2006


Hi,

Some old 2d games use an 8bit palette for surfaces. There's no good way in OpenGL to emulate this, so before the images can be uploaded the need to be converted to 32bit RGBA. This is done using the call d3dfmt_convert_surface. The call builds a palette and uses this palette to convert the data.

Right now d3dfmt_convert_surface is called in a very inefficient way. It is called line by line and for each line the palette is created over and over again. As games easily use about 500 lines and because the conversion is already very slow, this is a waste of resources.

This patch replaces the line by line conversion with a single conversion. The code has been tested with a number of games (StarCraft and C&C Red Alert) aswell as with some DirectX7 SDK samples and it worked correctly and made games a little faster. Further the old directdraw code used this conversion function in a similar way.

Regards,
Roderick Colenbrander
-- 


"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wined3d_convert_surface.patch
Type: text/x-diff
Size: 3009 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20060728/263d66a3/wined3d_convert_surface.bin


More information about the wine-patches mailing list