forked from teamnwah/openmw-tes3coop
more cleanup
This commit is contained in:
parent
f8029aaa9e
commit
0a2979caf2
7 changed files with 1 additions and 95 deletions
|
@ -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})
|
||||
|
|
|
@ -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 <components/esm/loadstat.hpp>
|
||||
|
||||
#include "player.hpp"
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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
|
|
@ -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<std::string, Ogre::Vector3> > PhysicsSystem::doPhysics (float duration,
|
||||
const std::vector<std::pair<std::string, Ogre::Vector3> >& 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);
|
||||
|
||||
|
|
|
@ -13,11 +13,8 @@
|
|||
#include "player.hpp"
|
||||
#include "class.hpp"
|
||||
|
||||
#include "doingphysics.hpp"
|
||||
#include "cellfunctors.hpp"
|
||||
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
template<typename T>
|
||||
|
@ -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();
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue