halpz / re3

2.5k stars 422 forks source link

[macOS] [Arm] GLFW fails to create viewport/window on retina displays #6

Open shinra-electric opened 1 year ago

shinra-electric commented 1 year ago

Describe the bug

I have built an arm64 binary and am trying to get it to run on an M1 MacBook Pro. It fails at launch with the warning: WARNING: Cannot find desired video mode, selecting device cancelled

I have also built an amd64 binary and ran it on an old 2015 MacBook Air (non-retina display), and it works fine.

I read online that the Retina display is the issue. (Obviously this may not be accurate, because internets...). It may also affect Intel Macs with retina displays, but I can't test this.

The warning is called from here after a check for bestFsMode. The comments say Find the videomode that best fits what we got from the settings file, but I guess this inference from the settings file is not working...

To Reproduce Build an arm64 binary and try to run on an M1 Mac with Retina display.

Expected behavior Game boots

x7a commented 1 year ago

First of all, this is not a re3 problem considering it is tied to every game within the original trilogy. In case the game does not find a settings file, it attempts to generate one instead. Moreover, it applies its default resolution which is 640x480 with the exception of San Andreas, where it is 800x600. Considering the resolution cannot be applied, the configuration file does not generate, hence the startup failure. While the original games utilize gta3.set/gta_vc.set, the re3 rework uses re3.ini/reVC.ini.

Your best bet is to create one yourself. Simply create a new re3.ini/reVC.ini file with a supported resolution only. This should result in a successful launch. There is no need to go beyond, since the game will auto-generate the rest for you.

[VideoMode]
Depth = 32
Height = 1890
Width = 3024