aboutsummaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorAndy Belle-Isle <abelleisle@roadrunner.com>2015-09-16 11:55:17 -0400
committerAndy Belle-Isle <abelleisle@roadrunner.com>2015-09-16 11:55:17 -0400
commit76ae330e93cfdc09826beee41970772cbd0486ea (patch)
tree575136faa33e36f897f95c824df7a63993e802e9 /src/World.cpp
parent82d5e77a3fa4f3f9cc3145969d99ba8326af9892 (diff)
parentd034b1e36b49336b9a927aee395930e446110de2 (diff)
hi
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 4237d42..49bdf0d 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -24,7 +24,7 @@ World::World(const float width,World *l,World *r){
toRight=r;
behind=infront=NULL;
entCount=0;
- entity=(void**)calloc(MAX_ENTITIES,sizeof(void**));
+ entity=(void **)calloc(MAX_ENTITIES,sizeof(void *));
if(toLeft){ // Make sure linked worlds link back
if(toLeft->toRight){
std::cout<<"There's already a world to the left!"<<std::endl;
@@ -101,7 +101,8 @@ LOOP2: // Should be in furthest back layer once this is first rea
}else{
drawOffsetX=drawOffsetY=0; // Reset for next draw() call
for(i=0;i<entCount;i++){ // Draw any bound entities
- ((Entity **)entity)[i]->draw();
+ if(entity[i])
+ ((Entity **)entity)[i]->draw();
}
}
}
@@ -135,6 +136,6 @@ void World::addLayer(const float width){
behind->infront=this;
}
}
-void World::addEntity(void *e){
- entity[entCount++]=e; // duh
+void World::addEntity(void *addr){
+ entity[entCount++]=addr;
}