aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-09-29 08:46:47 -0400
committerClyne Sullivan <tullivan99@gmail.com>2015-09-29 08:46:47 -0400
commit9137c25a3409a67ee04042e566f3c543d61d93d5 (patch)
treeb60341552dec27b169a39040d88e01f8e22fe39f /src/world.cpp
parent764e0983c21247e325807933227b077bdc1ef6be (diff)
fixed entity lags
Diffstat (limited to 'src/world.cpp')
-rw-r--r--src/world.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/world.cpp b/src/world.cpp
index 7d27e17..1d56643 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -101,12 +101,6 @@ LOOP2: // Draw each world
cline[i].y-=(yoff-DRAW_Y_OFFSET); // Reset 'cline[i]'`s y to what it was
}
glEnd();
- for(i=0;i<entity.size()+1;i++){
- if(entity[i]->inWorld==this){
- entity[i]->draw();
- ui::putText(entity[i]->loc.x,entity[i]->loc.y,"%d",i);
- }
- }
safeSetColor(255+shade*2,0+shade,0+shade);
for(i=0;i<current->platform.size();i++){
glRectf(current->platform[i].p1.x,current->platform[i].p1.y+yoff-DRAW_Y_OFFSET,
@@ -120,6 +114,12 @@ LOOP2: // Draw each world
}else{ // Otherwise reset static values and return
yoff=DRAW_Y_OFFSET;
shade=0;
+ for(i=0;i<entity.size()+1;i++){
+ if(entity[i]->inWorld==this){
+ entity[i]->draw();
+ ui::putText(entity[i]->loc.x,entity[i]->loc.y,"%d",i);
+ }
+ }
}
}
@@ -162,8 +162,9 @@ void World::detect(Player *p){
unsigned int i;
singleDetect(p);
for(i=0;i<entity.size()+1;i++){
- if(entity[i]->inWorld==this)
+ if(entity[i]->inWorld==this){
singleDetect(entity[i]);
+ }
}
}