Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen scaling appears off on MacOS Monterey M1 arm64 #773

Closed
dougnukem opened this issue Dec 31, 2021 · 1 comment
Closed

Screen scaling appears off on MacOS Monterey M1 arm64 #773

dougnukem opened this issue Dec 31, 2021 · 1 comment

Comments

@dougnukem
Copy link

I was able to compile OneLife for my on my Macbook with an M1 processor arm64 architecture.

When I launch it the actual game display appears to only take up 1/2 (or 1/4) of the screen, and the UI/mouse targets appear to use the full window coordinates (e.g. the top right of the screen maps to the top right of the game display but doesn't line up with the native mouse).

onelife_macos

In case anyone else needs instructions for compiling it on MacOS M1 here's what I modified in the build scripts:

I had to build/install libSDL 1.2 from github manually (I couldn't figure out how to make homebrew make the SDL framework/libraries available)

# Brew install dependencies
$ brew install xquartz
$ brew install sdl sdl_image sdl_mixer sdl_ttf portmidi
$ brew install imagemagick xclip
$ git clone https://github.com/libsdl-org/SDL-1.2.git SDL-1.2
$ cd SDL-1.2
$ ./configure && make && make install

Then in minorGems/game/platforms/SDL/Makefile.MacOSX

PLATFORM_COMPILE_FLAGS = -DBSD -D__mac__ -I/System/Library/Frameworks/OpenGL.framework/Headers -I/opt/homebrew/include
PLATFORM_LINK_FLAGS = -L/opt/homebrew/lib /opt/homebrew/lib/libSDLmain.a /opt/homebrew/lib/libSDL.a -Wl -framework OpenGL -framework Cocoa ../../minorGems/game/platforms/SDL/mac/SDLMain.m ${CUSTOM_MACOSX_LINK_FLAGS}
LINK_FLAGS =-L/opt/homebrew/lib -lSDLmain -lSDL

@jasonrohrer
Copy link
Owner

I recall there being some kind of Retina display issues. OHOL uses SDL 1.2, which is pretty ancient, and probably doesn't handle this correctly.

There are a bunch of things in the game's settings folder to play with:

  1. Trying to run it in a window instead of fullscreen.
  2. Trying out various fixed resolutions (and disabling useLargestWindow)
  3. Trying different cursorModes (0 is native (default), 1 is drawn, 2 is both).

Since Mac is no longer an officially supported platform, I'm not going to find a root fix for this. But there have been some kind of Retina issues forever (coordinates or screen sizes are reported in a strange way).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants