diff options
author | Sebastian Pipping <sping@gentoo.org> | 2010-01-12 16:32:57 +0000 |
---|---|---|
committer | Sebastian Pipping <sping@gentoo.org> | 2010-01-12 16:32:57 +0000 |
commit | 233a20184ef987d3558c84098fb6198d2354e5f9 (patch) | |
tree | 3e03c95a610d732db1b8e1dadd55ad38fdea5df1 /games-action/openlierox | |
parent | And install generators as well. (diff) | |
download | gentoo-2-233a20184ef987d3558c84098fb6198d2354e5f9.tar.gz gentoo-2-233a20184ef987d3558c84098fb6198d2354e5f9.tar.bz2 gentoo-2-233a20184ef987d3558c84098fb6198d2354e5f9.zip |
Integrate patches (fixes #300640)
(Portage version: 2.2_rc61/cvs/Linux i686)
Diffstat (limited to 'games-action/openlierox')
4 files changed, 245 insertions, 4 deletions
diff --git a/games-action/openlierox/ChangeLog b/games-action/openlierox/ChangeLog index fd6d829297cf..d14550afad67 100644 --- a/games-action/openlierox/ChangeLog +++ b/games-action/openlierox/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for games-action/openlierox # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-action/openlierox/ChangeLog,v 1.1 2010/01/10 00:52:11 sping Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-action/openlierox/ChangeLog,v 1.2 2010/01/12 16:32:57 sping Exp $ + + 12 Jan 2010; Sebastian Pipping <sping@gentoo.org> + openlierox-0.58_beta9-r1.ebuild, + +files/openlierox-0.58-beta9-joystick-cmake.patch, + +files/openlierox-0.58-beta9-joystick-cpp.patch: + Integrate joystick patches from upstream (fixes #300640) *openlierox-0.58_beta9-r1 (10 Jan 2010) diff --git a/games-action/openlierox/files/openlierox-0.58-beta9-joystick-cmake.patch b/games-action/openlierox/files/openlierox-0.58-beta9-joystick-cmake.patch new file mode 100644 index 000000000000..75ca1d366fbe --- /dev/null +++ b/games-action/openlierox/files/openlierox-0.58-beta9-joystick-cmake.patch @@ -0,0 +1,35 @@ +From 6b4e0a3ebcc2f43e1918ff84ddb25f87accbcd78 Mon Sep 17 00:00:00 2001 +From: Albert Zeyer <albert.zeyer@rwth-aachen.de> +Date: Tue, 12 Jan 2010 16:49:35 +0100 +Subject: [PATCH] option in CMake to disable joystick support + +--- + CMakeOlxCommon.cmake | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/CMakeOlxCommon.cmake b/CMakeOlxCommon.cmake +index e4279ca..815d310 100644 +--- a/CMakeOlxCommon.cmake ++++ b/CMakeOlxCommon.cmake +@@ -33,6 +33,7 @@ OPTION(PYTHON_DED_EMBEDDED "Python embedded in dedicated server" No) + OPTION(OPTIM_PROJECTILES "Enable optimisations for projectiles" Yes) + OPTION(MEMSTATS "Enable memory statistics and debugging" No) + OPTION(BREAKPAD "Google Breakpad support" Yes) ++OPTION(DISABLE_JOYSTICK "Disable joystick support" No) + + IF (DEBUG) + SET(CMAKE_BUILD_TYPE Debug) +@@ -161,6 +162,10 @@ ELSE (BREAKPAD) + ADD_DEFINITIONS(-DNBREAKPAD) + ENDIF (BREAKPAD) + ++IF (DISABLE_JOYSTICK) ++ ADD_DEFINITIONS(-DDISABLE_JOYSTICK) ++ENDIF (DISABLE_JOYSTICK) ++ + IF (GCOREDUMPER) + INCLUDE_DIRECTORIES(${OLXROOTDIR}/libs/coredumper/src) + ADD_DEFINITIONS(-DGCOREDUMPER) +-- +1.6.3 + diff --git a/games-action/openlierox/files/openlierox-0.58-beta9-joystick-cpp.patch b/games-action/openlierox/files/openlierox-0.58-beta9-joystick-cpp.patch new file mode 100644 index 000000000000..cc72dbf339a0 --- /dev/null +++ b/games-action/openlierox/files/openlierox-0.58-beta9-joystick-cpp.patch @@ -0,0 +1,192 @@ +From cb6fec84b098472fb3a132f892de1be0080ad576 Mon Sep 17 00:00:00 2001 +From: Albert Zeyer <albert.zeyer@rwth-aachen.de> +Date: Tue, 12 Jan 2010 02:59:49 +0100 +Subject: [PATCH 1/1] option to disable joystick support completly (DISABLE_JOYSTICK) + +--- + src/client/AuxLib.cpp | 2 ++ + src/client/CInput.cpp | 26 ++++++++++++++------------ + src/client/InputEvents.cpp | 4 ++++ + src/main.cpp | 4 ++++ + 4 files changed, 24 insertions(+), 12 deletions(-) + +diff --git a/src/client/AuxLib.cpp b/src/client/AuxLib.cpp +index 251ead3..438ff4f 100644 +--- a/src/client/AuxLib.cpp ++++ b/src/client/AuxLib.cpp +@@ -149,12 +149,14 @@ int InitializeAuxLib(const std::string& config, int bpp, int vidflags) + return false; + } + ++#ifndef DISABLE_JOYSTICK + if(bJoystickSupport) { + if(SDL_InitSubSystem(SDL_INIT_JOYSTICK) != 0) { + warnings << "WARNING: couldn't init joystick subystem: " << SDL_GetError() << endl; + bJoystickSupport = false; + } + } ++#endif + + if(!bDedicated && !SetVideoMode()) + return false; +diff --git a/src/client/CInput.cpp b/src/client/CInput.cpp +index 76b330f..d1e11c6 100644 +--- a/src/client/CInput.cpp ++++ b/src/client/CInput.cpp +@@ -153,14 +153,16 @@ int keys_t::keySymFromName(const std::string & name) + + + +-#ifdef DEDICATED_ONLY ++#if defined(DEDICATED_ONLY) || defined(DISABLE_JOYSTICK) + + void updateAxisStates() {} + void CInput::InitJoysticksTemp() {} + void CInput::UnInitJoysticksTemp() {} + + #else +- ++ ++#define HAVE_JOYSTICK ++ + // Joystick axes + // TODO: these are set up according to my joystick, are they general enough? + enum { +@@ -458,7 +460,7 @@ int CInput::Wait(std::string& strText) + } + } + +-#ifndef DEDICATED_ONLY ++#ifdef HAVE_JOYSTICK + // joystick + // TODO: more joysticks + for(uint n = 0; n < sizeof(Joysticks) / sizeof(joystick_t); n++) { +@@ -494,7 +496,7 @@ int CInput::Setup(const std::string& string) + return true; + } + +-#ifndef DEDICATED_ONLY ++#ifdef HAVE_JOYSTICK + // Check if it's a joystick #1 + // TODO: allow more joysticks + if(string.substr(0,5) == "joy1_") { +@@ -541,7 +543,7 @@ int CInput::Setup(const std::string& string) + } + } + } +-#endif // !DEDICATED_ONLY ++#endif // HAVE_JOYSTICK + + + // Must be a keyboard character +@@ -571,7 +573,7 @@ int CInput::Setup(const std::string& string) + // Returns the "force" value for a joystick axis + int CInput::getJoystickValue() + { +-#ifndef DEDICATED_ONLY ++#ifdef HAVE_JOYSTICK + switch (Type) { + case INP_JOYSTICK1: + return getJoystickControlValue(Data, Extra, joys[0]); +@@ -588,7 +590,7 @@ int CInput::getJoystickValue() + // Returns true if this input is a joystick axis + bool CInput::isJoystickAxis() + { +-#ifndef DEDICATED_ONLY ++#ifdef HAVE_JOYSTICK + if (Type == INP_JOYSTICK1 || Type == INP_JOYSTICK2) + return Data != JOY_BUTTON; + #endif +@@ -599,7 +601,7 @@ bool CInput::isJoystickAxis() + // Returns true if this joystick is a throttle + bool CInput::isJoystickThrottle() + { +-#ifndef DEDICATED_ONLY ++#ifdef HAVE_JOYSTICK + if (Type == INP_JOYSTICK1 || Type == INP_JOYSTICK2) + return (Data == JOY_THROTTLE_LEFT) || (Data == JOY_THROTTLE_RIGHT); + #endif +@@ -627,7 +629,7 @@ bool CInput::isUp() + return true; + break; + +-#ifndef DEDICATED_ONLY ++#ifdef HAVE_JOYSTICK + // Joystick + case INP_JOYSTICK1: + case INP_JOYSTICK2: +@@ -656,7 +658,7 @@ bool CInput::isDown() const + return true; + break; + +-#ifndef DEDICATED_ONLY ++#ifdef HAVE_JOYSTICK + // Joystick + case INP_JOYSTICK1: + return checkJoystickState(Data, Extra, 0); +@@ -694,7 +696,7 @@ int CInput::wasDown() const { + counter = nDownOnce; // no other way at the moment + break; + +-#ifndef DEDICATED_ONLY ++#ifdef HAVE_JOYSTICK + case INP_JOYSTICK1: + case INP_JOYSTICK2: + counter = nDownOnce; // no other way at the moment +@@ -719,7 +721,7 @@ int CInput::wasUp() { + counter = 0; // no other way at the moment + break; + +-#ifndef DEDICATED_ONLY ++#ifdef HAVE_JOYSTICK + case INP_JOYSTICK1: + case INP_JOYSTICK2: + counter = 0; // no other way at the moment +diff --git a/src/client/InputEvents.cpp b/src/client/InputEvents.cpp +index b011297..c6fc4a0 100644 +--- a/src/client/InputEvents.cpp ++++ b/src/client/InputEvents.cpp +@@ -522,8 +522,10 @@ bool WaitForNextEvent() { + HandleMouseState(); + HandleKeyboardState(); + #ifndef DEDICATED_ONLY ++#ifndef DISABLE_JOYSTICK + if(bJoystickSupport) SDL_JoystickUpdate(); + #endif ++#endif + HandleCInputs_UpdateUpForNonKeyboard(); + HandleCInputs_UpdateDownOnceForNonKeyboard(); + +@@ -583,11 +585,13 @@ bool ProcessEvents() + HandleMouseState(); + HandleKeyboardState(); + #ifndef DEDICATED_ONLY ++#ifndef DISABLE_JOYSTICK + if(bJoystickSupport) { + SDL_JoystickUpdate(); + updateAxisStates(); + } + #endif ++#endif + HandleCInputs_UpdateUpForNonKeyboard(); + HandleCInputs_UpdateDownOnceForNonKeyboard(); + +diff --git a/src/main.cpp b/src/main.cpp +index 76e1fa6..95e4e85 100644 +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -75,7 +75,11 @@ bool bDedicated = true; + bool bJoystickSupport = false; + #else //DEDICATED_ONLY + bool bDedicated = false; ++#ifdef DISABLE_JOYSTICK ++bool bJoystickSupport = false; ++#else + bool bJoystickSupport = true; ++#endif + #endif //DEDICATED_ONLY + bool bRestartGameAfterQuit = false; + TStartFunction startFunction = NULL; +-- +1.6.3 + diff --git a/games-action/openlierox/openlierox-0.58_beta9-r1.ebuild b/games-action/openlierox/openlierox-0.58_beta9-r1.ebuild index d3793e825349..cd8b8c0605a7 100644 --- a/games-action/openlierox/openlierox-0.58_beta9-r1.ebuild +++ b/games-action/openlierox/openlierox-0.58_beta9-r1.ebuild @@ -1,10 +1,10 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/games-action/openlierox/openlierox-0.58_beta9-r1.ebuild,v 1.1 2010/01/10 00:52:11 sping Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-action/openlierox/openlierox-0.58_beta9-r1.ebuild,v 1.2 2010/01/12 16:32:57 sping Exp $ EAPI="2" -inherit cmake-utils games +inherit eutils cmake-utils games MY_PN="OpenLieroX" MY_P="${MY_PN}_${PV}" @@ -15,7 +15,7 @@ SRC_URI="mirror://sourceforge/openlierox/${MY_P}.src.tar.bz2" LICENSE="LGPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="X breakpad debug" +IUSE="X breakpad debug joystick" RDEPEND="media-libs/sdl-mixer media-libs/sdl-image @@ -23,6 +23,8 @@ RDEPEND="media-libs/sdl-mixer dev-libs/libxml2 dev-libs/libzip net-misc/curl + joystick? ( media-libs/libsdl[joystick] ) + !joystick? ( media-libs/libsdl ) X? ( x11-libs/libX11 media-libs/libsdl[X] ) !X? ( media-libs/libsdl )" @@ -30,11 +32,17 @@ DEPEND="${RDEPEND}" S="${WORKDIR}/${MY_PN}" +src_prepare() { + epatch "${FILESDIR}"/${PN}-0.58-beta9-joystick-cpp.patch \ + "${FILESDIR}"/${PN}-0.58-beta9-joystick-cmake.patch +} + src_configure() { local mycmakeargs=" $(cmake-utils_use debug DEBUG) $(cmake-utils_use X X11) -D BREAKPAD=$(use breakpad && echo "Yes" || echo "No") + -D DISABLE_JOYSTICK=$(use joystick && echo "No" || echo "Yes") -D SYSTEM_DATA_DIR=${GAMES_DATADIR} -D VERSION=${PV}" |