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

Fix building with Xcode 10 #3451

Merged
merged 5 commits into from Aug 12, 2018
Merged

Fix building with Xcode 10 #3451

merged 5 commits into from Aug 12, 2018

Conversation

hrubymar10
Copy link
Member

@hrubymar10 hrubymar10 commented Aug 11, 2018

Problem description

Whole problem is described in issue #3350

TODO

  • Rename problematic files - 49f6736
  • Fix Visual Studio project - ac43a2d
  • Fix CMake, Scons and CodeBlocks builds - ef7a24e
  • Fix issue 1) Load screen missing - NOT CAUSED BY XCODE 10
  • Fix issue 2) Blurry video in window mode - 5a89822
  • Fix issue 3) Bad resolution in fullscreen - 5a89822

New bugs introduced by XCode 10

1) Blank screen on start

Game starts with blank screen. You can click elements (you can hear click sound) but you won't see anything until you move window. When you move window or resize it video appears. This issue is not caused by Xcode 10 but by macOS 10.14 api changes. I'll create new issue for tracking macOS 10.14 specific problems.
image

2) Blurry video in window mode

2018-08-11 at 14 33

3) Bad resolution in fullscreen

When I switch game to fullscreen display starts to be cropped. Click coordinates works as expected (means that when you click somewhere in bottom right side, you will got window with credits or game quits or preferences appears (depends on where exactly you click)
image

(Before click)
2018-08-11 at 14 27

(After click)
image

@hrubymar10 hrubymar10 added Bug Issues involving unexpected behavior. Blocker: New Stable Issues that must be resolved prior to the next stable series being released. macOS OS-specific issues that apply to Apple macOS. Xcode labels Aug 11, 2018
@hrubymar10
Copy link
Member Author

Update
Issue 2) and 3) are probably caused by retina/Hi-DPi scalling on my MacBook Pro (with retina display)

Bonus
Wesnoth now supports darkmode on macOS 10.14 😄
what is totally important...

2018-08-11 at 14 37

@Vultraz
Copy link
Member

Vultraz commented Aug 11, 2018

1 is almost certainly the same underlying window size issue as the other bugs. The logo and text draw, just outside the bounds of the visible area.

@hrubymar10
Copy link
Member Author

hrubymar10 commented Aug 11, 2018

Update
2) and 3) could be fixed by including window_flags |= SDL_WINDOW_ALLOW_HIGHDPI; into video.cpp

@Vultraz
Copy link
Member

Vultraz commented Aug 11, 2018

To be expected, yes.

@hrubymar10
Copy link
Member Author

@Vultraz , can I include this flag to all builds (including windows, linux, ...) or only for apple? (#if defined(__APPLE__)).

Also another question: It is easy fix but isn't it just workaround?

@Vultraz
Copy link
Member

Vultraz commented Aug 11, 2018

That flag is indeed meant to be used on high-DPI systems, though I think it's really meant for macOS, since Windows doesn't use the macOS method of having a canvas 2x the size rendered in 1x the space. Should be fine on all builds.

src/video.cpp Outdated
@@ -232,6 +232,7 @@ void CVideo::init_window()

// Add any more default flags here
window_flags |= SDL_WINDOW_RESIZABLE;
window_flags |= SDL_WINDOW_ALLOW_HIGHDPI;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be indented with tabs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F**k... Again? 😃

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed - 0021006

@hrubymar10
Copy link
Member Author

Update
I just realised that issue 1) is little bit different. It starts with loadscreen but you can't see anything until you move window. Redraw order?

@hrubymar10
Copy link
Member Author

hrubymar10 commented Aug 11, 2018

Update
Cannot reproduce issue 1) when building on Xcode 10 using macOS 10.13 SDK. Problem is probably caused by change introduced with macOS 10.14 SDK.

IIRC there was some changes in 10.14 SDK around graphics. Apple deprecated OpenGL in favour of Metal. Maybe it is related.

From macOS 10.14 Beta 6 Release notes:

OpenGL and OpenCL Deprecation
Deprecations
• The APIs in the OpenGL and OpenCL frameworks are deprecated and remain present for compatibility purposes. Transition to Metal if your app is using OpenGL or OpenCL.

Xcode 10 Beta 5 Release Notes available from unofficial 3rd-party site: https://devapple.weebly.com/uploads/1/0/8/0/108009593/release_notes_for_xcode_10_beta_5.pdf

and

macOS 10.14 Beta 6 Release Notes available from unofficial 3rd-party site: https://www.scribd.com/document/385580441/MacOS-10-14-Beta-6-Release-Notes

@hrubymar10
Copy link
Member Author

Ok, maybe we can merge this PR and create new issue for blank screen.

@hrubymar10
Copy link
Member Author

I am on right track with issue number 1

This issue is NOT cause by Xcode 10 but by macOS 10.14 SDK. Please merge this PR as all problems with Xcode 10 are fixed and I'll open new issue for tracking macOS 10.14 specific issues.

@CelticMinstrel
Copy link
Member

You should edit WIP out of the title once it's no longer the case.

@CelticMinstrel CelticMinstrel changed the title [WIP] Fix building with Xcode 10 Fix building with Xcode 10 Aug 12, 2018
@CelticMinstrel
Copy link
Member

Needs to be done on master too now, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocker: New Stable Issues that must be resolved prior to the next stable series being released. Bug Issues involving unexpected behavior. macOS OS-specific issues that apply to Apple macOS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants