narzoul / DDrawCompat

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

Cursor disappear problem in version 0.4.0 #152

Closed mcdd-workgroup closed 8 months ago

mcdd-workgroup commented 1 year ago

I put the dll into RA2 directory, but when I set the screen solution from 800x600 to 1920x1080, the cursor disappear! But in other screen solution my cursor is OK. And in window mode my cursor is OK too(1920x1080). Why it happened?

mcdd-workgroup commented 1 year ago

There is also a problem that my anti-virus software said that dll is a virus... When I move the dll, the software delete it immidiately.

narzoul commented 1 year ago

I don't know, the cursor works fine for me at DisplayResolution=desktop. Is that what you're referring to? Please attach your DDrawCompat-game.log file so I can check your exact config. System specs would also be useful.

I can't do much about antivirus software here. You'll have to consult its documentation on how to add an exception or something. Out of curiosity, what are you using? I checked virustotal and nothing suspicious was reported: https://www.virustotal.com/gui/file/b64c015b8b750b0f58181efd25160680a54ba6de9d3fe19f0d4fb403622bb151

I'm also a little confused, if it's deleted immediately, how did you test the different resolution settings?

mcdd-workgroup commented 1 year ago

Hi there, when antivirus aoftware delete it, I set the file to the whitelist, and the software doesn't delete it anymore. Well, I'll attach the DDrawCompat-game.log now. If you got something wrong, please tell me. Thx a lot!!! DDrawCompat-game.log

mcdd-workgroup commented 1 year ago

My PC's spec is there: System: Windows 10 Home Edition 21H1 CPU:AMD Athlon X4 730 Quad Core RAM:8GB Graphic: nVidia GTX550 Ti

Hope it helps you :)

narzoul commented 1 year ago

I just realized you may have been talking about changing the resolution in ra2.ini, not in DDrawCompat settings. But even if I change the resolution there, the cursor is fine.

Windows seems to apply some compatibility shims by default, including enabling exclusive fullscreen mode. I think this currently takes precedence over the FullscreenMode=borderless setting of DDrawCompat. The easiest way to get rid of the default Windows compatibility settings is to rename the executable to something other than game.exe, like game2.exe and launch the game through that, if possible (doesn't work in the Origin version of the game).

If exclusive fullscreen mode is the problem (renaming the executable should confirm it), then I remember some other user had problems with some 3rd party software called f.lux making the cursor invisible in another game. If you have something like that running, try closing it too. See this other issue for details: https://github.com/narzoul/DDrawCompat/issues/85

The reason why it might work in non-native resolutions is that DDrawCompat emulates hardware cursors in software when it has to perform display scaling, i.e. when the DisplayResolution setting doesn't match the application's internal resolution. It seems that in your case the software cursor works correctly, only the hardware cursor has issues. There is currently no way to force using software cursors from DDrawCompat, other than changing DisplayResolution to something different than the game's resolution (or vice versa). But I'm hoping one of the above tips will fix the issue without having to add such a setting.

Does the issue also happen when not using DDrawCompat?

mcdd-workgroup commented 1 year ago

When I use older DDrawCompat, this issue didn't happen. In v0.4.0, every resolution the cursor appear and work fine, except 1920x1080. But curiously, when I exited the game, and moduled ra2.ini, let "ScreenWidth=1920""ScreenHeight=1080", and cursor be normal again! Although if I set resolution to other size, next set the resolution to 1920x1080 (in the game option, not ra2.ini, the issue happened base on it) again, the cursor disappear again...... Um...I will try to enable the "disable fullscreen optimize" option. I think have no 3rd party software like f.lux(but there are a software called OpenAL in my PC, is it a problem?), so I have no idea of this method, or I uninstall OpenAL? I am sure that my PC system resolution is 1920x1080, so I don't think it's DisplayResolution setting doesn't match the application's internal resolution.

It's a great work, of course :D

narzoul commented 1 year ago

Ok, thanks for the details! I can finally reproduce the issue now by changing the resolution setting in the game. I didn't realize there was an in-game setting for it too (didn't think there would be). It's definitely a bug in DDrawCompat then, hopefully I can fix it soon. I'll post a test release here when I do.

mcdd-workgroup commented 1 year ago

Thanks for your work! Wish you can repair it soon :)

narzoul commented 8 months ago

Fixed in v0.5.0.