narzoul / DDrawCompat

DirectDraw and Direct3D 1-7 compatibility, performance and visual enhancements for Windows Vista, 7, 8, 10 and 11
BSD Zero Clause License
885 stars 67 forks source link

RollerCoaster Tycoon Deluxe: Can't see file select windows #225

Closed OpenRift412 closed 7 months ago

OpenRift412 commented 1 year ago

In the original Rollercoaster Tycoon, there seems to be an issue where file selection windows don't show when saving or loading a game, as well as other places where file selection is required. Instead it just freezes the game until you press escape, which closes what I assume is the invisible file select window. The thing is though, this functionality works perfectly fine in RCT2. Is there a certain setting I should have set for RCT1 for these dialogues to show?

Here's what they look like in RCT2 for context. It essentially minimizes the main window while the file selection prompt shows up. image

OpenRift412 commented 1 year ago

Here's a log of me loading up the game and attempting to load a saved game. Don't know if this will be much help but I might as well include it. DDrawCompat-RCT.log

narzoul commented 1 year ago

The game uses an unusual combination of flags when calling SetCooperativeLevel before displaying those dialogs: DDSCL_FULLSCREEN | DDSCL_NORMAL. This was confusing DDrawCompat, which thought the game remained in fullscreen mode after this, but it actually switches to windowed mode.

It's a little strange that the runtime even allows this, because according to the SDK, this combination should be invalid:

DDSCL_NORMAL The application functions as a regular Microsoft® Windows® application. This flag cannot be used with the DDSCL_ALLOWMODEX, DDSCL_EXCLUSIVE, or DDSCL_FULLSCREEN flags.

Anyway, I made a quick fix: ddraw.zip (diff.txt compared to v0.4.0)

OpenRift412 commented 1 year ago

Nice, thanks! I'll test this one out!

OpenRift412 commented 1 year ago

Seems like to works pretty good. Though it does seem to be affected by Windows' interface scaling, which can sometimes result in windows being 25% bigger than it would be at 100% scaling meaning they can be bigger than the actual screen. Don't know if there's a way to make that independent of System scaling (I tried messing with DpiAwareness but it didn't seem to help), but that may be something else that's worth looking into.

narzoul commented 1 year ago

Yeah, I know about the scaling problem, but there is no good solution (that I know of). Using DisplayResolution=app is probably the only good workaround (besides manually changing the scale factor every time before playing). At lower resolutions, Windows should automatically set the scale factor to 100%.

There may be some way to remove scaling at native resolution by abusing the DPI-unaware setting, but it's a lot of work with no guaranteed results, so I probably won't get into it before the next release.

narzoul commented 7 months ago

The invisible dialog windows are fixed in v0.5.0. Also, using DpiAwareness=unaware should fix the oversized dialogs now. Make sure to remove high DPI scaling overrides from the executable first (or set it to "system" there), as mentioned in the wiki too.