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.33k stars 148 forks source link

Mouse/cursor position is offset when Presentation ≠ "Fullscreen" #239

Closed lampiaio closed 1 year ago

lampiaio commented 1 year ago

Hello,

I am running Escape Velocity: Nova. When running the game at 1280x720 (on a 1920x1080 display) on any setting other than Fullscreen (so that I can use the Lanczos shader to make the text more readable), the cursor will be offset. That is, the cursor is drawn to the left + above relative to where the clicks actually register (the offset amount seems to vary across the screen, I'm not sure).

The issue does not occur if I set Presentation to Fullscreen. I've tried changing other settings, but apparently that is the only setting that makes it happen or not.

I'm aware the game in question isn't as popular as the ones cnc-ddraw is mostly used for, so I'm wondering if this kind of issue has ever been reported for any of them (and if there's a solution in the settings I may be overlooking).

Any help is appreciated!

ETA: I've further narrowed down the issue: it does not occur if the game executable's original filename "EV Nova.exe" stays unaltered. When the .exe is renamed to anything else (e.g. "EV Nova 1280x720.exe", as I had), the cursor offset described above occurs. I have no idea what's going on behind the scenes to cause this, but hopefully this solution can be of help to someone in the future.

FunkyFr3sh commented 1 year ago

Yes, cnc-ddraw detects the game by the name of the executable and does apply some compatibility settings. It's possible to rename the section or copy the settings around in ddraw.ini to make it working with every exectuable name, just search for [EV Nova] and copy/rename it.

Here's the latest build that works with every exectuable name (I made some changes to EV Nova recently):

cnc-ddraw_ev-nova_5.7.0.3.zip

lampiaio commented 1 year ago

Thank you for the quick reply and for the latest build (it's working flawlessly with modified names), that was faster than a hyperspace jump 🚀

Two minor datapoints I'd like to contribute:

Thanks again for your help!

FunkyFr3sh commented 1 year ago
  • Setting "Limit game speed" to "No limit" makes the game load much faster. I think it's because the loading bar is tied to the refresh rate? There seems to be no in-game implications, so it's up to the player to decide if they want the nostalgic loading experience or rush into the game as fast as possible!

Oh, nice one!

  • Unless I enable "Fix invisible videos / UI elements", the cursor stays as the Windows hourglass.

Yeah, I know about the cursor issue in the main menu. The game only sets the cursor once and then it would never touch it again. With some bad luck windows overrides the cursor you end up with the wait cursor or maybe the resize cursor (if windowed). Still have to think about a good solution that doesn't break other games