From 0a2979caf215e987da6d06bec484680f26e1e7f8 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 27 Aug 2011 10:45:09 +0200 Subject: [PATCH] more cleanup --- apps/openmw/CMakeLists.txt | 2 -- apps/openmw/mwrender/mwscene.cpp | 1 - apps/openmw/mwworld/doingphysics.cpp | 33 ------------------- apps/openmw/mwworld/doingphysics.hpp | 46 --------------------------- apps/openmw/mwworld/physicssystem.cpp | 4 --- apps/openmw/mwworld/scene.cpp | 6 ---- apps/openmw/mwworld/world.cpp | 4 +-- 7 files changed, 1 insertion(+), 95 deletions(-) delete mode 100644 apps/openmw/mwworld/doingphysics.cpp delete mode 100644 apps/openmw/mwworld/doingphysics.hpp diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 675c377a0..8b8fd9823 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -148,7 +148,6 @@ set(GAMEWORLD mwworld/actiontake.cpp mwworld/containerutil.cpp mwworld/player.cpp - mwworld/doingphysics.cpp ) set(GAMEWORLD_HEADER mwworld/refdata.hpp @@ -168,7 +167,6 @@ set(GAMEWORLD_HEADER mwworld/manualref.hpp mwworld/containerutil.hpp mwworld/player.hpp - mwworld/doingphysics.hpp mwworld/cellfunctors.hpp ) source_group(apps\\openmw\\mwworld FILES ${GAMEWORLD} ${GAMEWORLD_HEADER}) diff --git a/apps/openmw/mwrender/mwscene.cpp b/apps/openmw/mwrender/mwscene.cpp index ebcfefe6a..a4ebff94d 100644 --- a/apps/openmw/mwrender/mwscene.cpp +++ b/apps/openmw/mwrender/mwscene.cpp @@ -11,7 +11,6 @@ #include "../mwworld/world.hpp" // these includes can be removed once the static-hack is gone #include "../mwworld/ptr.hpp" -#include "../mwworld/doingphysics.hpp" #include #include "player.hpp" diff --git a/apps/openmw/mwworld/doingphysics.cpp b/apps/openmw/mwworld/doingphysics.cpp deleted file mode 100644 index 84fb4e2ab..000000000 --- a/apps/openmw/mwworld/doingphysics.cpp +++ /dev/null @@ -1,33 +0,0 @@ - -#include "doingphysics.hpp" - -namespace MWWorld -{ - int DoingPhysics::sCounter = 0; - int DoingPhysics::sSuppress = 0; - - DoingPhysics::DoingPhysics() - { - ++sCounter; - } - - DoingPhysics::~DoingPhysics() - { - --sCounter; - } - - bool DoingPhysics::isDoingPhysics() - { - return sCounter>0 && sSuppress==0; - } - - SuppressDoingPhysics::SuppressDoingPhysics() - { - ++DoingPhysics::sSuppress; - } - - SuppressDoingPhysics::~SuppressDoingPhysics() - { - --DoingPhysics::sSuppress; - } -} diff --git a/apps/openmw/mwworld/doingphysics.hpp b/apps/openmw/mwworld/doingphysics.hpp deleted file mode 100644 index d38e4bb15..000000000 --- a/apps/openmw/mwworld/doingphysics.hpp +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef GAME_MWWORLD_DOINGPHYSICS_H -#define GAME_MWWORLD_DOINGPHYSICS_H - -namespace MWWorld -{ - class SuppressDoingPhysics; - - /// Scope guard for blocking physics updates during physics simulation. - class DoingPhysics - { - static int sCounter; - static int sSuppress; - - private: - - DoingPhysics (const DoingPhysics&); - DoingPhysics& operator= (const DoingPhysics&); - - public: - - DoingPhysics(); - - ~DoingPhysics(); - - static bool isDoingPhysics(); - - friend class SuppressDoingPhysics; - }; - - /// Scope guard for temporarily lifting the block issues by DoingPhysics - class SuppressDoingPhysics - { - private: - - SuppressDoingPhysics (const SuppressDoingPhysics&); - SuppressDoingPhysics& operator= (const SuppressDoingPhysics&); - - public: - - SuppressDoingPhysics(); - - ~SuppressDoingPhysics(); - }; -} - -#endif diff --git a/apps/openmw/mwworld/physicssystem.cpp b/apps/openmw/mwworld/physicssystem.cpp index 36b962f08..dae79ccb1 100644 --- a/apps/openmw/mwworld/physicssystem.cpp +++ b/apps/openmw/mwworld/physicssystem.cpp @@ -1,5 +1,4 @@ #include "physicssystem.hpp" -#include "../mwworld/doingphysics.hpp" #include "../mwworld/ptr.hpp" #include "../mwworld/world.hpp" // FIXME @@ -28,9 +27,6 @@ namespace MWWorld std::vector< std::pair > PhysicsSystem::doPhysics (float duration, const std::vector >& actors) { - // stop changes to world from being reported back to the physics system - MWWorld::DoingPhysics scopeGuard; - //set the DebugRenderingMode. To disable it,set it to 0 //eng->setDebugRenderingMode(1); diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 9566ac7a0..f7ad72cdd 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -13,11 +13,8 @@ #include "player.hpp" #include "class.hpp" -#include "doingphysics.hpp" #include "cellfunctors.hpp" - - namespace { template @@ -98,7 +95,6 @@ namespace MWWorld void Scene::changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos) { - SuppressDoingPhysics scopeGuard; // remove active mEnvironment.mMechanicsManager->removeActor (mWorld->getPlayer().getPlayer()); @@ -198,8 +194,6 @@ namespace MWWorld void Scene::changeToInteriorCell (const std::string& cellName, const ESM::Position& position) { - SuppressDoingPhysics scopeGuard; - // remove active CellRenderCollection::iterator active = mActiveCells.begin(); diff --git a/apps/openmw/mwworld/world.cpp b/apps/openmw/mwworld/world.cpp index bf2ac9212..71b37e1ff 100644 --- a/apps/openmw/mwworld/world.cpp +++ b/apps/openmw/mwworld/world.cpp @@ -21,7 +21,6 @@ #include "refdata.hpp" #include "globals.hpp" -#include "doingphysics.hpp" #include "cellfunctors.hpp" namespace @@ -636,8 +635,7 @@ namespace MWWorld Class::get (ptr).disable (ptr, mEnvironment); mEnvironment.mSoundManager->stopSound3D (ptr); - if (!DoingPhysics::isDoingPhysics()) - mPhysics->removeObject (ptr.getRefData().getHandle()); + mPhysics->removeObject (ptr.getRefData().getHandle()); } render->deleteObject (ptr.getRefData().getHandle());