From cd2a586a9ec6a56082ed45d01b44dd648babe240 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Wed, 13 Apr 2016 08:21:50 +0200 Subject: [PATCH] Better #if condition, and add a warning to be better checked latter --- Sources/Engine/Base/Lists.cpp | 3 +-- Sources/Engine/Base/SDL/SDLInput.cpp | 6 +++++- Sources/Engine/Base/Stream.cpp | 2 +- Sources/GameMP/Game.cpp | 2 ++ 4 files changed, 9 insertions(+), 4 deletions(-) mode change 100644 => 100755 Sources/Engine/Base/Lists.cpp mode change 100644 => 100755 Sources/Engine/Base/Stream.cpp diff --git a/Sources/Engine/Base/Lists.cpp b/Sources/Engine/Base/Lists.cpp old mode 100644 new mode 100755 index 414fb0b..c6ff234 --- a/Sources/Engine/Base/Lists.cpp +++ b/Sources/Engine/Base/Lists.cpp @@ -234,8 +234,7 @@ void CListNode::Remove(void) ASSERT(next.IsTailMarker() || next.IsLinked()); ASSERT(prev.IsHeadMarker() || prev.IsLinked()); - if(ln_Succ) - next.ln_Pred = &prev; + next.ln_Pred = &prev; prev.ln_Succ = &next; // make a non-linked node ln_Succ = NULL; diff --git a/Sources/Engine/Base/SDL/SDLInput.cpp b/Sources/Engine/Base/SDL/SDLInput.cpp index be6b63c..d378cc1 100755 --- a/Sources/Engine/Base/SDL/SDLInput.cpp +++ b/Sources/Engine/Base/SDL/SDLInput.cpp @@ -675,11 +675,16 @@ void CInput::DisableInput( void) inp_bPollJoysticks = FALSE; } +#define USE_MOUSEWARP 1 +// Define this to use GetMouse instead of using Message to read mouse coordinates // blank any queued mousemove events...SDLInput.cpp needs this when // returning from the menus/console to game or the viewport will jump... void CInput::ClearRelativeMouseMotion(void) { + #if USE_MOUSEWARP + SDL_GetRelativeMouseState(NULL, NULL); + #endif mouse_relative_x = mouse_relative_y = 0; } @@ -744,7 +749,6 @@ void CInput::GetInput(BOOL bPreScan) _abKeysPressed[KID_MOUSEWHEELDOWN] = FALSE; // read mouse position - //#define USE_MOUSEWARP 1 #ifdef USE_MOUSEWARP int iMx, iMy; SDL_GetRelativeMouseState(&iMx, &iMy); diff --git a/Sources/Engine/Base/Stream.cpp b/Sources/Engine/Base/Stream.cpp old mode 100644 new mode 100755 index ff63451..d1ead10 --- a/Sources/Engine/Base/Stream.cpp +++ b/Sources/Engine/Base/Stream.cpp @@ -12,7 +12,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#pragma GCC optimize 0 + #include "Engine/StdH.h" #include diff --git a/Sources/GameMP/Game.cpp b/Sources/GameMP/Game.cpp index cf7b7b9..2befdbf 100755 --- a/Sources/GameMP/Game.cpp +++ b/Sources/GameMP/Game.cpp @@ -2226,6 +2226,8 @@ void CGame::GameRedrawView( CDrawPort *pdpDrawPort, ULONG ulFlags) // timer must not occur during prescanning { #if defined(PLATFORM_UNIX) && !defined(SINGLE_THREADED) + #warning "This seems to cause Race Condition, so disabled" +#else CTSingleLock csTimer(&_pTimer->tm_csHooks, TRUE); #endif // for each local player