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

SDL2: Version 2.0.5 is required, but configure script only checks for 2.0 #7785

Closed
JGRennison opened this issue Oct 20, 2019 · 2 comments · Fixed by #7793
Closed

SDL2: Version 2.0.5 is required, but configure script only checks for 2.0 #7785

JGRennison opened this issue Oct 20, 2019 · 2 comments · Fixed by #7793

Comments

@JGRennison
Copy link
Contributor

Version of OpenTTD

Since 2d27e8e

Expected result

Running ./configure detects whether sdl2 is present and usable.
If found, compiling subsequently works.

Actual result

Attempting to configure and build with sdl2 < 2.0.5 fails, due to use of the SDL_CreateRGBSurfaceWithFormat function.

Steps to reproduce

Build on Ubuntu 16.04

A possible fix could be along the lines of: JGRennison/OpenTTD-patches@c45d963 JGRennison/OpenTTD-patches@93dffed

@nikolas
Copy link
Member

nikolas commented Oct 22, 2019

Thank you for pointing this out, and yes, the solution you've come up with looks good.

@nikolas
Copy link
Member

nikolas commented Oct 22, 2019

Ideally, OpenTTD wouldn't rely on SDL 2.0.5, if it's not available by default in ubuntu 16. I'm looking into whether we can use SDL_CreateRGBSurface here instead.

nikolas added a commit to nikolas/OpenTTD that referenced this issue Oct 22, 2019
This function requires libSDL 2.0.5 or higher. It looks like we don't
need to use it, and can just use the original SDL_CreateRGBSurface(),
with the masks set to 0, to trigger the default 8-bit format, which is
SDL_PIXELFORMAT_INDEX8.

Closes OpenTTD#7785

Note: this code path is activated by using an 8-bit blitter, like:

    ./bin/openttd -b 8bpp-simple
LordAro pushed a commit that referenced this issue Oct 25, 2019
This function requires libSDL 2.0.5 or higher. It looks like we don't
need to use it, and can just use the original SDL_CreateRGBSurface(),
with the masks set to 0, to trigger the default 8-bit format, which is
SDL_PIXELFORMAT_INDEX8.

Closes #7785

Note: this code path is activated by using an 8-bit blitter, like:

    ./bin/openttd -b 8bpp-simple
douiwby pushed a commit to douiwby/OpenTTD that referenced this issue Apr 16, 2020
This function requires libSDL 2.0.5 or higher. It looks like we don't
need to use it, and can just use the original SDL_CreateRGBSurface(),
with the masks set to 0, to trigger the default 8-bit format, which is
SDL_PIXELFORMAT_INDEX8.

Closes OpenTTD#7785

Note: this code path is activated by using an 8-bit blitter, like:

    ./bin/openttd -b 8bpp-simple
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

Successfully merging a pull request may close this issue.

2 participants