FunkyFr3sh / cnc-ddraw

GDI, OpenGL and Direct3D 9 re-implementation of the DirectDraw API for classic 2D games for better compatibility with Windows ME, 2000, XP, Vista, 7, 8, 10, 11, Wine (Linux/macOS/Android) and Virtual Machines
https://discord.gg/afWXJNDDF5
MIT License
2.23k stars 143 forks source link

Desperados: Wanted Dead or Alive colorkey issues #249

Closed emxd closed 1 year ago

emxd commented 1 year ago

Hello,

Desperados (the original DDraw from 2001, not the SDL remake from 2018) has the same issue as Kohan: Immortal Sovereigns.

1

The upperbound on colorkey is unset in Desperados? After setting

lpColorKey->dwColorSpaceHighValue = lpColorKey->dwColorSpaceLowValue;

in

https://github.com/FunkyFr3sh/cnc-ddraw/blob/ce84abfac06fc929b59da162ed4f41caa7ecd0c0/src/IDirectDraw/IDirectDrawSurface.c#L309-L315

the game is displayed correctly. I don't know if this the "correct" way of solving it :), I just got inspired from wine where the HighValue is also set to LowValue (https://pastebin.com/SmdfCa2b) i.e. fixed_color_key.dwColorSpaceLowValue = fixed_color_key.dwColorSpaceHighValue = color_key->dwColorSpaceLowValue;

I leave it to your expertise on how to fix this...

Demo for the game can be downloaded from https://archive.org/details/desperadosDemo

Funky-Fr3sh commented 1 year ago

Yes that was indeed the problem. The wine solution would have worked in this game, but it would have dropped support for other games since they pretty much disabled the entire colorspace feature.

I added the missing check for DDCKEY_COLORSPACE and it should be working now for everygame.

Posting from my alt-account currently because I need to setup 2FA on main account, github doesn't let me log in atm! So I probably better don't post a build here since you can't know if it's really me posting. Do you know how to build it on your own?

emxd commented 1 year ago

No problem, I was just going through some ddraw games I used to play. Thanks for the fix!