diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2015-09-29 08:46:47 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2015-09-29 08:46:47 -0400 |
commit | 9137c25a3409a67ee04042e566f3c543d61d93d5 (patch) | |
tree | b60341552dec27b169a39040d88e01f8e22fe39f /src/world.cpp | |
parent | 764e0983c21247e325807933227b077bdc1ef6be (diff) |
fixed entity lags
Diffstat (limited to 'src/world.cpp')
-rw-r--r-- | src/world.cpp | 15 |
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]); + } } } |