From c16caed5dde69eaaddeb9e86490ae7147dce3c3e Mon Sep 17 00:00:00 2001 From: jacob1 Date: Wed, 8 Oct 2014 00:15:51 -0400 Subject: [PATCH] fix level 1 msvc compiling warnings + initialize debugFlags --- src/client/GameSave.cpp | 2 +- src/gui/game/GameController.cpp | 3 ++- src/gui/game/GameModel.cpp | 2 +- src/lua/LuaScriptInterface.cpp | 1 + src/resampler/resampler.cpp | 2 ++ 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/client/GameSave.cpp b/src/client/GameSave.cpp index 33ebfa299..aa74eb7cd 100644 --- a/src/client/GameSave.cpp +++ b/src/client/GameSave.cpp @@ -1644,7 +1644,7 @@ void GameSave::readPSv(char * data, int dataLength) } if (ver < 88) //fix air blowing stickmen if ((particles[i-1].type == PT_STKM || particles[i-1].type == PT_STKM2 || particles[i-1].type == PT_FIGH) && particles[i-1].ctype == OLD_SPC_AIR) - particles[i-1].ctype == SPC_AIR; + particles[i-1].ctype = SPC_AIR; if (ver < 89) { if (particles[i-1].type == PT_FILT) diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index f4b37e3c2..42923695a 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -130,7 +130,8 @@ GameController::GameController(): localBrowser(NULL), foundSign(NULL), HasDone(false), - firstTick(true) + firstTick(true), + debugFlags(0) { gameView = new GameView(); gameModel = new GameModel(); diff --git a/src/gui/game/GameModel.cpp b/src/gui/game/GameModel.cpp index 13ae4dc4a..d13ff56e5 100644 --- a/src/gui/game/GameModel.cpp +++ b/src/gui/game/GameModel.cpp @@ -833,7 +833,7 @@ bool GameModel::GetPaused() void GameModel::SetDecoration(bool decorationState) { - if (ren->decorations_enable != decorationState) + if (ren->decorations_enable != (decorationState?1:0)) { ren->decorations_enable = decorationState?1:0; notifyDecorationChanged(); diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index bf54e65e7..85a167021 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -436,6 +436,7 @@ int LuaScriptInterface::tpt_newIndex(lua_State *l) //if not a special key, set a value in the table return lua_rawset(l, 1), 1; } + return 0; } //// Begin Interface API diff --git a/src/resampler/resampler.cpp b/src/resampler/resampler.cpp index 9c20f252d..81e707621 100644 --- a/src/resampler/resampler.cpp +++ b/src/resampler/resampler.cpp @@ -41,7 +41,9 @@ static inline int resampler_range_check(int v, int h) { (void)h; resampler_asser #define RESAMPLER_DEBUG 0 +#ifndef M_PI #define M_PI 3.14159265358979323846 +#endif // Float to int cast with truncation. static inline int cast_to_int(Resample_Real i)