D3D7: textures, mipmaps, DDSCAPS_COMPLEX

André Johansen andrejoh at c2i.net
Mon Sep 6 16:35:42 CDT 2004


Hi!

First some good news (for me at least):
Cedega from CVS can now be used to play Anarchy Online! [1]

To get this working, Marius Grigoriu had to implement support for
DDSCAPS_COMPLEX in the Cedega code; this support seems to be lacking
in Wine.

I've had a look at the patch, and both the Cedega and Wine
implementations -- they are quite similar, but do have some
differences in the texture creation part.  In particular, Cedega has a
lot of additional code in create_texture, and the parts in Wine's
version seems to reside in the function create_mipmaps in the Cedega
file (dlls/ddraw/ddraw/main.c).

As far as I've understood things, the Cedega DDraw code is under the
AFPL license, and cannot be merged with the Wine LPGL code; thus I've
not looked further into that (the changes seems to be related to cube
map support).

However, the patch from Marius is released under the X11 license, and
can be applied to Wine with minor tweaking (due to support for
compressed textures in the Wine code).

Should this be applied to the Wine tree (depending on me having ported
it correctly, of course)?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ddraw-complex-mipmap.patch
Type: text/x-patch
Size: 2387 bytes
Desc: DDSCAPS_COMPLEX support
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20040906/e83d5b7b/ddraw-complex-mipmap.bin
-------------- next part --------------

For reference, I've included the related part from the original patch
as well (see also [1]).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ddraw-complex-mipmap-cedega.patch
Type: text/x-patch
Size: 1888 bytes
Desc: Original patch for Cedega
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20040906/e83d5b7b/ddraw-complex-mipmap-cedega.bin
-------------- next part --------------



Unfortunately, even with this patch, running AO under Wine crashes
with some texture related code:

First chance exception: divide by zero in 32-bit code (0x419c6d5c).
Register dump:
 CS:0023 SS:002b DS:002b ES:002b FS:003b GS:0033
 EIP:419c6d5c ESP:4085e784 EBP:4085e7e4 EFLAGS:00210246(   - 00      -RIZP1)
 EAX:00000000 EBX:00000002 ECX:00000000 EDX:00000000
 ESI:4085e958 EDI:00000002
Stack dump:
0x4085e784:  4085e984 4085e928 40530088 0000007c
0x4085e794:  0010180f 00000100 00000100 00000200
0x4085e7a4:  00000000 00000000 00000000 00000000
0x4085e7b4:  50bb0000 00000000 00000000 00000000
0x4085e7c4:  00000000 00000000 00000000 00000000
0x4085e7d4:  00000000 00000020 00000041 00000000
Backtrace:
=>1 0x419c6d5c _D3DXLoadTextureFromSurface at 28+0x3e9 in randy31d (0x4085e7e4)
  2 0x00007c00 (0x00000010)
  3 0x00000000 (0x00000000)
0x419c6d5c _D3DXLoadTextureFromSurface at 28 in randy31d: divl     0x40(%ebp),%eax
Wine-dbg>bt
Backtrace:
=>1 0x419c6d5c _D3DXLoadTextureFromSurface at 28+0x3e9 in randy31d (0x4085e7e4)
  2 0x00007c00 (0x00000010)
  3 0x00000000 (0x00000000)

Doing "bt all" crashes the debugger with this message after getting a
listing of one thread:

wineserver: debugger.c:477: debugger_detach: Assertion `event->sender->debug_event == event' failed.


I've been unable to figure out what happens here, but I assume it
might be caused by an invalid texture surface.  Hacking in the AO code
base (as in disabling certain textures), I've been able to get all the
way into the client, but with almost no rendering.

Any further help would be greatly appreciated!


[1] http://www.csh.rit.edu/~marius/aolinux/

-- 
Try   Anarchy  Online   http://www.anarchy-online.com/content/downloads/tryout/
Netiquette guidelines   ftp://ftp.rfc-editor.org/in-notes/rfc1855.txt
How to quote properly   http://www.i-hate-computers.demon.co.uk/
Hvordan sitere riktig   http://home.online.no/~vidaandr/news/OBSquoting.html


More information about the wine-devel mailing list