#include "entityManager.h"
#include <pg/debug.h>
-#include <pg/Mutex.h>
+#include <pg/Lock.h>
#include <pg/Autolock.h>
using namespace pg;
static setPhys active_Physics;
static setPhys physics_To_Remove;
-static Mutex muSetPart;
-static Mutex muSetPhys;
+static Lock muSetPart;
+static Lock muSetPhys;
/// ***** Initializers/Cleaners *****
{
collision::clean();
- muSetPhys.deinit();
- muSetPart.deinit();
+ muSetPhys.fini();
+ muSetPart.fini();
}
/// ***** Public Methods *****
DASSERT(pe != NULL);
{
- Autolock lock( muSetPart );
+ Autolock lock( &muSetPart );
Particle* p = dynamic_cast<Particle*>(pe);
if( p != NULL )
{
}
{
- Autolock lock( muSetPhys );
+ Autolock lock( &muSetPhys );
PhysicsEntity* ppe = dynamic_cast<PhysicsEntity*>(pe);
if( ppe != NULL )
{
void manager::draw()
{
{
- Autolock lock( muSetPart );
+ Autolock lock( &muSetPart );
addOrRemoveParticles();
}
{
- Autolock lock( muSetPhys );
+ Autolock lock( &muSetPhys );
addOrRemovePhysics();
}
void addOrRemoveParticles()
{
- Autolock lock( muSetPart );
+ Autolock lock( &muSetPart );
// add new Particle*s to Active
for( setPart::iterator it = particles_To_Add.begin();
}
void addOrRemovePhysics()
{
- Autolock lock( muSetPhys );
+ Autolock lock( &muSetPhys );
// add new PhysicsEntity*s to Active
for( setPhys::iterator it = physics_To_Add.begin();