From ea30fa9342dce9e5093935fa2b2c4d13624c62ed Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Sat, 23 Jun 2018 21:15:16 +0000 Subject: [PATCH] - Add missing depends - Fix build with clang 6 --- games/allacrost/Makefile | 4 +++- .../files/patch-src_common_gui_option.cpp | 11 ++++++++++ .../files/patch-src_engine_system.cpp | 11 ++++++++++ .../files/patch-src_engine_video_video.cpp | 20 +++++++++++++++++++ 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 games/allacrost/files/patch-src_common_gui_option.cpp create mode 100644 games/allacrost/files/patch-src_engine_system.cpp create mode 100644 games/allacrost/files/patch-src_engine_video_video.cpp diff --git a/games/allacrost/Makefile b/games/allacrost/Makefile index 4934c475d2fc..75718af25357 100644 --- a/games/allacrost/Makefile +++ b/games/allacrost/Makefile @@ -22,12 +22,14 @@ LIB_DEPENDS= libpng.so:graphics/png \ GNU_CONFIGURE= yes USES= gettext gmake iconv jpeg lua:51 openal:al USE_SDL= sdl ttf net -USE_GL= yes +USE_GL= gl glu +USE_XORG= x11 QT_NONSTANDARD= yes # used when EDITOR enabled CONFIGURE_ARGS= --datadir=${DATADIR} CPPFLAGS+= -I${LOCALBASE}/include -I${LUA_INCDIR} LDFLAGS+= -L${LOCALBASE}/lib -L${LUA_LIBDIR} +CXXFLAGS+= -Wno-c++11-narrowing LLD_UNSAFE= yes WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} diff --git a/games/allacrost/files/patch-src_common_gui_option.cpp b/games/allacrost/files/patch-src_common_gui_option.cpp new file mode 100644 index 000000000000..e6ca1db8b586 --- /dev/null +++ b/games/allacrost/files/patch-src_common_gui_option.cpp @@ -0,0 +1,11 @@ +--- src/common/gui/option.cpp.orig 2010-05-16 23:38:35 UTC ++++ src/common/gui/option.cpp +@@ -527,7 +527,7 @@ bool OptionBox::IsEnabled(uint32 index) + StillImage* OptionBox::GetEmbeddedImage(uint32 index) const { + if (index >= GetNumberOptions()) { + IF_PRINT_WARNING(VIDEO_DEBUG) << "argument index was invalid: " << index << endl; +- return false; ++ return nullptr; + } + + return _options[index].image; diff --git a/games/allacrost/files/patch-src_engine_system.cpp b/games/allacrost/files/patch-src_engine_system.cpp new file mode 100644 index 000000000000..a7e0ba2a252a --- /dev/null +++ b/games/allacrost/files/patch-src_engine_system.cpp @@ -0,0 +1,11 @@ +--- src/engine/system.cpp.orig 2010-05-16 23:38:27 UTC ++++ src/engine/system.cpp +@@ -271,7 +271,7 @@ bool SystemEngine::SingletonInitialize() + #elif (defined(__linux__) || defined(__FreeBSD__)) && !defined(RELEASE_BUILD) + // Look for translation files in LOCALEDIR only if they are not available in the + // current directory. +- if (ifstream("dat/config/settings.lua") == NULL) { ++ if (!ifstream("dat/config/settings.lua")) { + bindtextdomain(PACKAGE, LOCALEDIR); + bind_textdomain_codeset(PACKAGE, "UTF-8"); + textdomain(PACKAGE); diff --git a/games/allacrost/files/patch-src_engine_video_video.cpp b/games/allacrost/files/patch-src_engine_video_video.cpp new file mode 100644 index 000000000000..6b85a6038209 --- /dev/null +++ b/games/allacrost/files/patch-src_engine_video_video.cpp @@ -0,0 +1,20 @@ +--- src/engine/video/video.cpp.orig 2010-05-16 23:38:27 UTC ++++ src/engine/video/video.cpp +@@ -470,7 +470,7 @@ bool VideoEngine::ApplySettings() { + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4); + SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); + +- if (SDL_SetVideoMode(_temp_width, _temp_height, 0, flags) == false) { ++ if (SDL_SetVideoMode(_temp_width, _temp_height, 0, flags) == nullptr) { + // RGB values of 1 for each and 8 for depth seemed to be sufficient. + // 565 and 16 here because it works with them on this computer. + // NOTE from prophile: this ought to be changed to 5558 +@@ -483,7 +483,7 @@ bool VideoEngine::ApplySettings() { + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0); + SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); + +- if (SDL_SetVideoMode(_temp_width, _temp_height, 0, flags) == false) { ++ if (SDL_SetVideoMode(_temp_width, _temp_height, 0, flags) == nullptr) { + IF_PRINT_WARNING(VIDEO_DEBUG) << "SDL_SetVideoMode() failed with error: " << SDL_GetError() << endl; + + _temp_fullscreen = _fullscreen;