Hi all,
Today I have been doing some experiments with halflife2 and the game works (atleast if launched through steam in my case) but there are some issues which I tried to address.
The game uses the D3D9 Query mechanism (CreateQuery/Issue/GetData) to retrieve status information. HL2 uses this all the time and because the implementation is stubbed for the biggest part (and perhaps impossible to fully implement) you see thousands of FIXMEs which reduce the performance from a playable framerate to less than 1 fps. While looking into this issue I (perhaps) found one or more bugs and second I need some assistance.
According to MSDN CreateQuery should be called with a NULL pointer to see if the 'Type' in question is available. Halflife2 doesn't do this NULL pointer check and passes a pointer. Further wine returns D3D_OK for unsupported types which should be D3DERR_NOTAVAILABLE (wined3d's CreateQuery does this). I expect this is wrong and can supply a patch for this yet. The reason you see below.
When the Query mechanism isn't available halflife2 moves over to a different backend (I think). Suddenly the screen becomes black and you see hundreds of lines like this: fixme:d3d_surface:IWineD3DSurfaceImpl_UnlockRect unsupported unlocking to surface surf@0x7fe1d810 usage(512)
I looked up the error and it seems UnlockRect isn't handling D3DUSAGE_DYNAMIC but I don't have enough d3d/opengl knowledge to fix this issue. I hope that someone can assist me with the UnlockRect (if it doesn't take that much time) so that halflife2 works fine out of the box.
Regards, Roderick