Skip to content

Commit

Permalink
fix compilation when ecx_debug is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-dave committed Mar 7, 2019
1 parent 7b2fbf3 commit e23b54a
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/ecx/World.hx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import ecx.ds.CInt32RingBuffer;
import ecx.managers.WorldConstructor;
import ecx.types.EntityVector;
import ecx.types.FamilyData;
import haxe.macro.Expr.ExprOf;

#if ecx_debug
using ecx.managers.WorldDebug;
import ecx.managers.WorldDebug.*;
#end

/**
Expand Down Expand Up @@ -133,7 +132,7 @@ class World {
**/
public function destroy(entity:Entity) {
#if ecx_debug
guardEntity(entity);
guardEntity(this, entity);
#end
if(_removedMask.enableIfNot(entity.id)) {
_removedVector.place(entity);
Expand All @@ -145,7 +144,7 @@ class World {
**/
public function invalidate() {
#if ecx_debug
makeFamiliesMutable();
makeFamiliesMutable(this);
#end

if(_removedVector.length > 0 || _changedVector.length > 0) {
Expand All @@ -155,8 +154,8 @@ class World {
}

#if ecx_debug
guardFamilies();
makeFamiliesImmutable();
guardFamilies(this);
makeFamiliesImmutable(this);
#end
}

Expand All @@ -165,7 +164,7 @@ class World {
**/
public function activate(entity:Entity) {
#if ecx_debug
guardEntity(entity);
guardEntity(this, entity);
if(_activeMask.get(entity.id)) throw 'This entity is already active';
#end
_activeMask.enable(entity.id);
Expand All @@ -177,7 +176,7 @@ class World {
**/
public function deactivate(entity:Entity) {
#if ecx_debug
guardEntity(entity);
guardEntity(this, entity);
if(!_activeMask.get(entity.id)) throw "This entity is already inactive";
#end
_activeMask.disable(entity.id);
Expand Down Expand Up @@ -359,7 +358,7 @@ class World {

function markEntityAsChanged(entity:Entity) {
#if ecx_debug
guardEntity(entity);
guardEntity(this, entity);
#end
if(_changedMask.enableIfNot(entity.id)) {
_changedVector.place(entity);
Expand Down

0 comments on commit e23b54a

Please sign in to comment.