KEMBAR78
BASE: Show SDL1.2/SDL2 in the About dialog by dwatteau · Pull Request #4788 · scummvm/scummvm · GitHub
Skip to content

Conversation

@dwatteau
Copy link
Contributor

@dwatteau dwatteau commented Mar 8, 2023

This tweaks the build system a bit, so that the About dialog will now show whether SDL1.2 or SDL2 (or later) is used.

The idea is to have a quick way of figuring out when an official port still uses SDL1.2, just after starting it. Knowing it from memory or from the build logs is not always convenient.

@lotharsm
Copy link
Member

lotharsm commented Mar 8, 2023

Nice idea, especially since we'll see the SDL2->SDL3 migration happening in the foreseeable future.

@digitall digitall requested a review from sev- March 8, 2023 13:46
@digitall
Copy link
Member

digitall commented Mar 8, 2023

These changes look pretty good to me, fairly clear. If @sev- is happy as well, then I would suggest merging.

@criezy
Copy link
Member

criezy commented Mar 8, 2023

Shouldn't the USE_SDL2 define be added to scummvmOSX_defines in devtools/create_project/xcode.cpp as well?

Otherwise the change looks good.

@sev-
Copy link
Member

sev- commented Mar 9, 2023

Thank you, very useful

@sev- sev- merged commit a7e2444 into scummvm:master Mar 9, 2023
@sev-
Copy link
Member

sev- commented Mar 9, 2023

Shouldn't the USE_SDL2 define be added to scummvmOSX_defines in devtools/create_project/xcode.cpp as well?

And I added it in 43d7792. Please check that it is correct

@raziel-
Copy link
Contributor

raziel- commented Mar 9, 2023

I'm too late to the party...but would it makes sense to also add the used SDL version to the version information when one triggers --version (right now all the compiled in dependancies are already displayed?

Like so:
ScummVM 2.8.0git (Mar 8 2023 08:13:58)
Features compiled in: Vorbis FLAC MP3 RGB zLib MPEG2 Theora AAC A/52 FreeType2 FriBiDi JPEG PNG GIF cloud (servers, local) ENet TinyGL OpenGL (with shaders) ... SDL2(?)

That way bug reports would also hold the information without the reporter having to add it manually (if he/she chooses to use the --version switch, that is)

@dwatteau dwatteau deleted the feat/build-show-sdl1.2-or-sdl2 branch March 9, 2023 10:20
@dwatteau
Copy link
Contributor Author

dwatteau commented Mar 9, 2023

Shouldn't the USE_SDL2 define be added to scummvmOSX_defines in devtools/create_project/xcode.cpp as well?

Otherwise the change looks good.

create_project.cpp already had:

                setup.defines.push_back("USE_SDL2");

and so the resulting scummvm.xcodeproj already has the USE_SDL2 define, and it appears to be OK as-is, from a quick Xcode build test. But having it explicitly listed in xcode.cpp too shouldn't hurt.

I'm too late to the party...but would it makes sense to also add the used SDL version to the version information when one triggers --version (right now all the compiled in dependancies are already displayed?

Like so: ScummVM 2.8.0git (Mar 8 2023 08:13:58) Features compiled in: Vorbis FLAC MP3 RGB zLib MPEG2 Theora AAC A/52 FreeType2 FriBiDi JPEG PNG GIF cloud (servers, local) ENet TinyGL OpenGL (with shaders) ... SDL2(?)

That way bug reports would also hold the information without the reporter having to add it manually (if he/she chooses to use the --version switch, that is)

Yes, I only mentioned the About dialog, but base/version.cpp is also used for the --version switch in CLI, so the SDL1.2/SDL2 value also appears there, now :)

@lotharsm
Copy link
Member

lotharsm commented Mar 9, 2023

Uh, this is interesting, I didn't even notice.

It looks like that at least on MSYS2/mingw64 and MXE, this change doesn't work properly, I see no SDL related output in the About dialog or in the command line output. However, if I apply #4793, I do get the proper version reported in the command line, so USE_SDL2 and SDL_BACKEND seem to be correctly reported.

Sadly I have no idea why this doesn't work :/

@dwatteau
Copy link
Contributor Author

dwatteau commented Mar 9, 2023

Uh, this is interesting, I didn't even notice.

It looks like that at least on MSYS2/mingw64 and MXE, this change doesn't work properly, I see no SDL related output in the About dialog or in the command line output. However, if I apply #4793, I do get the proper version reported in the command line, so USE_SDL2 and SDL_BACKEND seem to be correctly reported.

Sadly I have no idea why this doesn't work :/

Ah, thanks for spotting that, it looks like there's a strange ifdef maze in that file. I'm looking into it.

EDIT: Fixed in master, and reindented the ifdefs so that I won't get lost again. Thanks!

@lotharsm
Copy link
Member

lotharsm commented Mar 9, 2023

Yep, fix confirmed :-)

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 this pull request may close these issues.

6 participants