hiho
as with newer versions more and more games i try no longer work (which worked with wine around 0.9.0) i try to find the reasons. i stumbled over this code in dlls/d3d8/surface.c:
date: 2006-02-14 17:05:35 +0000; author: julliard; state: Exp; lines: +202 -319 Roderick Colenbrander thunderbird2k@gmx.net d3d8: Move d3d8 surface over to wined3d (based on the work of Oliver Stieber).
149 1.48 (julliard 14-Feb-06): if (This == D3D8_SURFACE_GET_DEVICE(This)->backBuffer || This == D3D8_SURFACE_GET_DEVICE(This)->renderTarget || This == D3D8_SURFACE_GET_DEVICE(This)->frontBuffer || D3D8_SURFACE_GET_DEVICE(This)->depthStencilBuffer) { 150 1.48 (julliard 14-Feb-06): if (This == D3D8_SURFACE_GET_DEVICE(This)->backBuffer) { 151 1.48 (julliard 14-Feb-06): TRACE("(%p, backBuffer) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, D3D8_SURFACE(This)->resource.allocatedMemory); 152 1.48 (julliard 14-Feb-06): } else if (This == D3D8_SURFACE_GET_DEVICE(This)->frontBuffer) { 153 1.48 (julliard 14-Feb-06): TRACE("(%p, frontBuffer) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, D3D8_SURFACE(This)->resource.allocatedMemory); 154 1.48 (julliard 14-Feb-06): } else if (This == D3D8_SURFACE_GET_DEVICE(This)->renderTarget) { 155 1.48 (julliard 14-Feb-06): TRACE("(%p, renderTarget) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, D3D8_SURFACE(This)->resource.allocatedMemory); 156 1.48 (julliard 14-Feb-06): } else if (This == D3D8_SURFACE_GET_DEVICE(This)->depthStencilBuffer) { 157 1.48 (julliard 14-Feb-06): TRACE("(%p, stencilBuffer) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, D3D8_SURFACE(This)->resource.allocatedMemory); 158 1.9 (julliard 17-May-03): } 159 1.9 (julliard 17-May-03): } else { 160 1.48 (julliard 14-Feb-06): TRACE("(%p) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, D3D8_SURFACE(This)->resource.allocatedMemory); 161 1.9 (julliard 17-May-03): }
why is in line 149 for the depthStencilBuffer check not comparing against This like in three checks before? if there is a reason, if would be good to have a comment there - otherwise it looks like an error.
On 15/02/06, Christoph Frick frick@sc-networks.de wrote:
as with newer versions more and more games i try no longer work (which worked with wine around 0.9.0)
In general, are those d3d8 or d3d9 games?
On Wed, Feb 15, 2006 at 12:42:51PM +0100, H. Verbeet wrote:
as with newer versions more and more games i try no longer work (which worked with wine around 0.9.0)
In general, are those d3d8 or d3d9 games?
well for the tests i did i have problems with out-of-memory in games programmed in java (il2 sturmovik + pacfic fighters), problems with GLX (BadMatch) with pacfic fighters and nascar racing 2003 and a segfault related to my mail i sent there with life for speed,which is actually d3d8 (although i though it would use d3d9). the only three "games" that use d3d9 on my disk are ankh and richard burns ralley (which never worked from the first day) and the ogre 3d engine demos (many demos worked with wine a few days ago).
long story short - i have the general impression that lots of stuff that worked with earlier wine versions no longer works for me with different reasons and theses are not all d3d related (as i dont use d3d if there is an ogl alterantive).
149 1.48 (julliard 14-Feb-06): if (This == D3D8_SURFACE_GET_DEVICE(This)->backBuffer || This == D3D8_SURFACE_GET_DEVICE(This)->renderTarget || This == D3D8_SURFACE_GET_DEVICE(This)->frontBuffer || D3D8_SURFACE_GET_DEVICE(This)->depthStencilBuffer) { 150 1.48 why is in line 149 for the depthStencilBuffer check not comparing against This like in three checks before? if there is a reason, if would be good to have a comment there - otherwise it looks like an error.
The patch for the biggest part makes 'old' code working using a new wined3d based d3d8 surface. In order to make the old code reasable I added those D3D8_SURFACE / D3D8_SURFACE_GET_DEVICE macros to get access to data hidden in the wined3d surface which is wrapped inside a d3d8 surface. The LockRect code to which you are refering is just the old surface code moved over to the new surface structure using the macros I mentioned. I didn't change much in the old code except for macro changes and sometimes a little more. I have checked the old d3d8 code and the line looks the same. I think the missing is a bug but I don't know for sure. Note that code will be moved to wined3d soon.
Roderick