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

[Bug]: blue tint with hardware acceleration on #10251

Closed
nitricware opened this issue Dec 17, 2022 · 5 comments
Closed

[Bug]: blue tint with hardware acceleration on #10251

nitricware opened this issue Dec 17, 2022 · 5 comments
Labels
needs triage This issue needs further investigation before it becomes actionable OS: MacOS This issue is related to a Mac OS problem

Comments

@nitricware
Copy link

nitricware commented Dec 17, 2022

Version of OpenTTD

12.2, macOS 13.0

Expected result

Game should be playable normally without a blue tint.

Actual result

Game starts up normally but has a blue tint.

Terminal window throws the following error: dbg: [driver] Could not change to foreground application. Error -50 (unrelated to the issue)

Running with Intel Iris Plus Graphics 655 1536 MB

Steps to reproduce

  1. install openTTD via brew
  2. run openTTD from Terminal

Solution

Turn hardware acceleration off

@michicc
Copy link
Member

michicc commented Dec 17, 2022

The debug message is expected when launching from the Terminal instead of the app bundle. This is some OS limitation that has no practical consequences.

No idea about the blue tint, except to try toggling hardware acceleration in the game options.

@nitricware
Copy link
Author

Yes, thanks that did the trick. I thought the tint and the message were related.

@nitricware nitricware changed the title [Bug]: dbg: [driver] Could not change to foreground application. Error -50 [Bug]: blue tint with hardware acceleration on Dec 17, 2022
@2TallTyler 2TallTyler added the needs triage This issue needs further investigation before it becomes actionable label Dec 20, 2022
@owen
Copy link

owen commented Feb 6, 2023

I can confirm, but for me it happens only when the game starts without hardware acceleration.

With the driver reported as cocoa the screen has the blueish tint:
OpenTTD launch page, blue tint

When the driver is reported as cocoa-opengl (Apple M1, 4.1 Metal - 83), everything looks as expected.

OpenTTD installed from Brew (OpenTTD 13.0) on a M1 MacBook Pro running MacOS 13.2

@TrueBrain TrueBrain added the OS: MacOS This issue is related to a Mac OS problem label Aug 18, 2023
@TrueBrain
Copy link
Member

Did a lot of experimental investigation into this. Turns out that for some reason the color space is not RGBA but GRAB. I never ever seen A not at the end, so something is pretty odd here. Will need further investigation.

@TrueBrain
Copy link
Member

Right, this is only noticed by people installing via Brew, as it seems this was introduced in 12+. Seems Apple changed kCGBitmapByteOrder32Host from being a define to being an enum. As we had some code to still support old old MacOS, we changed the byte-order of our buffer from the correct 32-bit LE into the incorrect 16-bit BE (which seems to be the default, from "back in the day").

Which makes me to believe this only happens when people custom build their version and forget to set the OSX SDK to 10.13 (like we do for releases). And the reports in this topic seems to confirm that. In other words: if you use the 10.13 SDK, all is fine. If you use a 12+ SDK, things break.

We will fix this shortly :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue needs further investigation before it becomes actionable OS: MacOS This issue is related to a Mac OS problem
Projects
None yet
Development

No branches or pull requests

5 participants