From 8d6ccb8d8365f71513cd0756a3302527a77bb8c4 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Tue, 29 Jan 2013 14:35:20 -0200 Subject: [PATCH] Fixes to compile with clang --- modules/game_interface/gameinterface.lua | 5 +++-- src/client/lightview.h | 1 - src/client/mapio.cpp | 1 - src/client/mapview.cpp | 2 -- src/framework/CMakeLists.txt | 2 +- src/framework/core/adaptativeframecounter.h | 1 - src/framework/luaengine/luavaluecasts.h | 4 ++++ src/framework/sound/soundsource.h | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/game_interface/gameinterface.lua b/modules/game_interface/gameinterface.lua index c0d452eb..70563451 100644 --- a/modules/game_interface/gameinterface.lua +++ b/modules/game_interface/gameinterface.lua @@ -16,6 +16,7 @@ limitZoom = false currentViewMode = 0 smartWalkDirs = {} smartWalkDir = nil +walkFunction = g_game.walk function init() g_ui.importStyle('styles/countwindow') @@ -262,9 +263,9 @@ end function smartWalk(dir) if g_keyboard.getModifiers() == KeyboardNoModifier then if smartWalkDir then - g_game.walk(smartWalkDir) + walkFunction(smartWalkDir) else - g_game.walk(dir) + walkFunction(dir) end return true end diff --git a/src/client/lightview.h b/src/client/lightview.h index 7f3d4564..8612d4f8 100644 --- a/src/client/lightview.h +++ b/src/client/lightview.h @@ -51,7 +51,6 @@ private: TexturePtr m_lightTexture; FrameBufferPtr m_lightbuffer; - MapView* m_mapView; Light m_globalLight; std::vector m_lightMap; }; diff --git a/src/client/mapio.cpp b/src/client/mapio.cpp index 460ea921..ee35ecbf 100644 --- a/src/client/mapio.cpp +++ b/src/client/mapio.cpp @@ -95,7 +95,6 @@ void Map::loadOtbm(const std::string& fileName, const UIWidgetPtr& pbar) uint8 mapDataType = nodeMapData->getU8(); if(mapDataType == OTBM_TILE_AREA) { Position basePos = nodeMapData->getPosition(); - unsigned int pbarvalue=0; for(const BinaryTreePtr &nodeTile : nodeMapData->getChildren()) { uint8 type = nodeTile->getU8(); diff --git a/src/client/mapview.cpp b/src/client/mapview.cpp index e044e716..1c09e928 100644 --- a/src/client/mapview.cpp +++ b/src/client/mapview.cpp @@ -92,8 +92,6 @@ void MapView::draw(const Rect& rect) else drawFlags = Otc::DrawGround | Otc::DrawGroundBorders | Otc::DrawWalls | Otc::DrawItems; - Size tileSize = Size(1,1) * m_tileSize; - if(m_mustDrawVisibleTilesCache || (drawFlags & Otc::DrawAnimations)) { m_framebuffer->bind(); diff --git a/src/framework/CMakeLists.txt b/src/framework/CMakeLists.txt index ed0b0d00..5a9428d4 100644 --- a/src/framework/CMakeLists.txt +++ b/src/framework/CMakeLists.txt @@ -147,7 +147,7 @@ else() endif() # gcc compile flags -set(WARNS_FLAGS "-Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-result") +set(WARNS_FLAGS "-Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-variable -Wno-unused-result") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNS_FLAGS} ${ARCH_FLAGS} ${CPP2011_FLAGS} -pipe") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O1 -g -fno-omit-frame-pointer") diff --git a/src/framework/core/adaptativeframecounter.h b/src/framework/core/adaptativeframecounter.h index ce410406..eab231a2 100644 --- a/src/framework/core/adaptativeframecounter.h +++ b/src/framework/core/adaptativeframecounter.h @@ -58,7 +58,6 @@ public: private: int m_frames; int m_partialFrames; - ticks_t m_partialFpsDelta; float m_partialFps; float m_maxPartialFps; ticks_t m_frameDelaySum; diff --git a/src/framework/luaengine/luavaluecasts.h b/src/framework/luaengine/luavaluecasts.h index b5ff81f2..a8bfe74a 100644 --- a/src/framework/luaengine/luavaluecasts.h +++ b/src/framework/luaengine/luavaluecasts.h @@ -98,6 +98,10 @@ int push_luavalue(const OTMLNodePtr& node); bool luavalue_cast(int index, OTMLNodePtr& node); // enum +template +typename std::enable_if::value, int>::type +push_luavalue(T e) { return push_luavalue((int)e); } + template typename std::enable_if::value, bool>::type luavalue_cast(int index, T& myenum); diff --git a/src/framework/sound/soundsource.h b/src/framework/sound/soundsource.h index 56bed5ad..539bf726 100644 --- a/src/framework/sound/soundsource.h +++ b/src/framework/sound/soundsource.h @@ -44,7 +44,7 @@ public: virtual bool isBuffering(); virtual bool isPlaying() { return isBuffering(); } - void setName(const std::string& name) { m_name == name; } + void setName(const std::string& name) { m_name = name; } virtual void setLooping(bool looping); virtual void setRelative(bool relative); virtual void setReferenceDistance(float distance);