dege-diosg / dgVoodoo2

Glide/DirectX implementation on D3D11/12
851 stars 36 forks source link

DDRAW / DX5 Commandos: Behind Enemy Lines mouse/cursor and FPS issues #43

Open iGom opened 3 years ago

iGom commented 3 years ago

I tried to run Commandos: Behind Enemy Lines under dgVoodoo 2.72 (debug) but there are problems with moving the mouse, the faster the cursor moves, the more frames per second the game generates and every mouse move generates an error:

ERROR: DirectDrawSurface (04D9C428)::Unlock: Unlocking a surface that has no locked portions at all.

a few other errors:

ERROR: Direct3D (09807E78)::Init: Failed while creating object on DirectDraw (04C74DD0).    
ERROR: DirectDraw (04C74DD0)::QueryInterface: Creating aggregated D3D object has failed on DirectDraw.  
ERROR: DirectDraw (04C74DD0)::QueryInterface: Unknown interface (riid = {{b502d1bd-9a57-11d0-8fde-00c04fd9189d}}) is being queried
ERROR: Direct3D (09807E78)::Init: Failed while creating object on DirectDraw (04C74DD0).    
ERROR: DirectDraw (04C74DD0)::QueryInterface: Creating aggregated D3D object has failed on DirectDraw.

Full log COMMANDOS.LOG

dege-diosg commented 3 years ago

A had a look at this game and the error messages are indeed present. However, they are legit. The game tries to unlock unlocked surfaces. It must be an API driving bug from on the game side but it's harmless in practice. The FPS grows with the mouse move because the game draws the cursor directly to the 'primary' DDraw surface which makes dgVoodoo to update the screen immediately, after each change, generating additional frames. It's not a problem or bug either.

You have the option DirectXExt\PrimarySurfaceBatchedUpdate to let primary screen changes accumulate and be updated at the end of the frame but this only works well with games pumping the message queue properly (I'm not sure Commandos is such a game).

So, I cannot see problems/bugs with this game.