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

BASE: SDL: Show SDL version in --version output #4793

Merged
merged 3 commits into from Mar 20, 2023

Conversation

lotharsm
Copy link
Member

@lotharsm lotharsm commented Mar 9, 2023

Inspired by @raziel-'s comment at #4788 (comment), this patch shows the currently running SDL2 version when using the --version command:

ScummVM 2.8.0git2438-g4b14cdd8fed (Mar  9 2023 08:31:57)
Using SDL backend with SDL 2.26.3
Features compiled in: Vorbis FLAC MP3 RGB zLib MPEG2 FluidSynth Theora VPX AAC A/52 FreeType2 FriBiDi JPEG PNG GIF taskbar TTS cloud (servers, local) ENet TinyGL OpenGL (with shaders)

Unfortunately, SDL_GetVersion is only available in SDL2+, so we can't exactly determine the version when using SDL1.

@ccawley2011
Copy link
Member

I'd recommend adding a new function to OSystem to get the platform information string, both to keep platform-specific code self-contained, and because it would allow subclasses to append additional information like the OS version that would be useful to have in log files.

Unfortunately, SDL_GetVersion is only available in SDL2+, so we can't exactly determine the version when using SDL1.

SDL_Linked_Version() appears to be the SDL 1.2 equivalent to this function, so you might want to use that. It may also help to print the version of SDL that ScummVM was compiled with if it's different from the linked version.

@sev-
Copy link
Member

sev- commented Mar 16, 2023

While this is a good idea about expanding OSystem, still, at this moment, this change is functional, and our commandLine.cpp is riddled with ifdefs, so one more, one less, IMHO doesn't matter.

Though, SDL_Linked_Version() call for 1.2. would be good to add before the merge.

@lotharsm lotharsm force-pushed the sdl-version-info-commandline branch from 3715de4 to 702b705 Compare March 20, 2023 17:39
@lotharsm lotharsm force-pushed the sdl-version-info-commandline branch from 702b705 to 377df0d Compare March 20, 2023 17:54
@sev-
Copy link
Member

sev- commented Mar 20, 2023

Thanks!

@sev- sev- merged commit 6fcfdaa into scummvm:master Mar 20, 2023
7 of 8 checks passed
@lotharsm lotharsm deleted the sdl-version-info-commandline branch March 20, 2023 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants