more cleanup
parent
f8029aaa9e
commit
0a2979caf2
@ -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
|
Loading…
Reference in New Issue