X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?a=blobdiff_plain;f=src%2FentityManager.cpp;h=68c450862949dbc1efdcd8afbde8e3b8baf1d129;hb=5e0713e5967be038b1b0cc5f0ffbd0180e3f7099;hp=64d7480701e0873eae7d27653e4e74e0543ca998;hpb=b6ef7e067de3aebc8943ac9e032f56c3b3e5b9af;p=physics.git diff --git a/src/entityManager.cpp b/src/entityManager.cpp index 64d7480..68c4508 100644 --- a/src/entityManager.cpp +++ b/src/entityManager.cpp @@ -16,14 +16,15 @@ */ #include "entityManager.h" -#include "debug.h" + +#include +#include +#include +using namespace bear; #include #include -#include "locks/Mutex.h" -#include "locks/Autolock.h" - #include "Entities/Entity.h" #include "Entities/Particle.h" #include "Entities/PhysicsEntity.h" @@ -50,8 +51,8 @@ static setPhys physics_To_Add; static setPhys active_Physics; static setPhys physics_To_Remove; -static Mutex muSetPart; -static Mutex muSetPhys; +static Lock muSetPart; +static Lock muSetPhys; /// ***** Initializers/Cleaners ***** @@ -66,8 +67,8 @@ void manager::clean() { collision::clean(); - muSetPhys.clean(); - muSetPart.clean(); + muSetPhys.fini(); + muSetPart.fini(); } /// ***** Public Methods ***** @@ -101,7 +102,7 @@ void manager::remove(Entity* pe) DASSERT(pe != NULL); { - Autolock lock( muSetPart ); + Autolock lock( &muSetPart ); Particle* p = dynamic_cast(pe); if( p != NULL ) { @@ -111,7 +112,7 @@ void manager::remove(Entity* pe) } { - Autolock lock( muSetPhys ); + Autolock lock( &muSetPhys ); PhysicsEntity* ppe = dynamic_cast(pe); if( ppe != NULL ) { @@ -137,7 +138,7 @@ void manager::update(float time_step) void manager::draw() { { - Autolock lock( muSetPart ); + Autolock lock( &muSetPart ); addOrRemoveParticles(); @@ -151,7 +152,7 @@ void manager::draw() } { - Autolock lock( muSetPhys ); + Autolock lock( &muSetPhys ); addOrRemovePhysics(); @@ -196,7 +197,7 @@ void updatePhysics(float time_step) } void addOrRemoveParticles() { - Autolock lock( muSetPart ); + Autolock lock( &muSetPart ); // add new Particle*s to Active for( setPart::iterator it = particles_To_Add.begin(); @@ -218,7 +219,7 @@ void addOrRemoveParticles() } void addOrRemovePhysics() { - Autolock lock( muSetPhys ); + Autolock lock( &muSetPhys ); // add new PhysicsEntity*s to Active for( setPhys::iterator it = physics_To_Add.begin();