Skip to content

Commit

Permalink
Change OpenTTD#6173: Update SDL driver to use SDL 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolas committed Jun 14, 2019
1 parent 00000ef commit 125fd9c
Show file tree
Hide file tree
Showing 7 changed files with 176 additions and 158 deletions.
2 changes: 1 addition & 1 deletion config.lib
Expand Up @@ -2436,7 +2436,7 @@ detect_sdl() {
sleep 5
fi

detect_pkg_config "$with_sdl" "sdl" "sdl_config" "1.2"
detect_pkg_config "$with_sdl" "sdl2" "sdl_config" "2.0"
}

detect_osx_sdk() {
Expand Down
2 changes: 1 addition & 1 deletion os/debian/control
Expand Up @@ -3,7 +3,7 @@ Section: games
Priority: optional
Maintainer: Matthijs Kooijman <matthijs@stdin.nl>
Uploaders: Jordi Mallach <jordi@debian.org>
Build-Depends: debhelper (>= 7.0.50), libsdl-dev, zlib1g-dev, libpng-dev, libfreetype6-dev, libfontconfig-dev, libicu-dev, liblzma-dev, liblzo2-dev
Build-Depends: debhelper (>= 7.0.50), libsdl2-dev, zlib1g-dev, libpng-dev, libfreetype6-dev, libfontconfig-dev, libicu-dev, liblzma-dev, liblzo2-dev
Standards-Version: 3.8.4
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/openttd.git
Vcs-Git: git://anonscm.debian.org/collab-maint/openttd.git
Expand Down
2 changes: 1 addition & 1 deletion os/rpm/openttd.spec
Expand Up @@ -91,7 +91,7 @@ Group: Amusements/Games/Strategy/Other
Requires: %{name}
Conflicts: %{name}-dedicated

BuildRequires: SDL-devel
BuildRequires: SDL2-devel
BuildRequires: fontconfig-devel

%if 0%{?rhel_version} != 600
Expand Down
5 changes: 3 additions & 2 deletions src/crashlog.cpp
Expand Up @@ -267,8 +267,9 @@ char *CrashLog::LogLibraries(char *buffer, const char *last) const
#endif /* WITH_PNG */

#ifdef WITH_SDL
const SDL_version *v = SDL_Linked_Version();
buffer += seprintf(buffer, last, " SDL: %d.%d.%d\n", v->major, v->minor, v->patch);
SDL_version v;
SDL_GetVersion(&v);
buffer += seprintf(buffer, last, " SDL: %d.%d.%d\n", v.major, v.minor, v.patch);
#endif /* WITH_SDL */

#ifdef WITH_ZLIB
Expand Down
2 changes: 1 addition & 1 deletion src/sound/sdl_s.cpp
Expand Up @@ -40,7 +40,7 @@ const char *SoundDriver_SDL::Start(const char * const *parm)
/* Only initialise SDL if the video driver hasn't done it already */
int ret_code = 0;
if (SDL_WasInit(SDL_INIT_EVERYTHING) == 0) {
ret_code = SDL_Init(SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE);
ret_code = SDL_Init(SDL_INIT_AUDIO);
} else if (SDL_WasInit(SDL_INIT_AUDIO) == 0) {
ret_code = SDL_InitSubSystem(SDL_INIT_AUDIO);
}
Expand Down

0 comments on commit 125fd9c

Please sign in to comment.