Dropped extern in draw_object.
authorlimb <limb@bc5cbbab-a4ec-0310-bb52-ff3d296db539>
Sat, 18 Jul 2009 05:01:42 +0000 (05:01 +0000)
committerlimb <limb@bc5cbbab-a4ec-0310-bb52-ff3d296db539>
Sat, 18 Jul 2009 05:01:42 +0000 (05:01 +0000)
git-svn-id: svn+ssh://svn/var/repos/curfender@848 bc5cbbab-a4ec-0310-bb52-ff3d296db539

draw.cpp
main.cpp

index e8a4080..48e9c8b 100644 (file)
--- a/draw.cpp
+++ b/draw.cpp
@@ -4,51 +4,47 @@
 #include "game_object.h"
 
 int draw_object(game_object object, int drawlocation){
-  extern int pod_in;
 
-  if(object.number!=pod_in){
-    if(object.number==1){
-      if((object.y-drawlocation<35) and (object.direction==4)){
-       drawlocation=drawlocation-object.speed;
-      };
-      if((object.y-drawlocation>40) and (object.direction==6)){
-       drawlocation=drawlocation+object.speed;
-      };
+  if(object.number==1){
+    if((object.y-drawlocation<35) and (object.direction==4)){
+      drawlocation=drawlocation-object.speed;
     };
+    if((object.y-drawlocation>40) and (object.direction==6)){
+      drawlocation=drawlocation+object.speed;
+    };
+  };
     
-    int offset = 0;
+  int offset = 0;
 
-    offset = object.y-drawlocation;
+  offset = object.y-drawlocation;
 
-    if(drawlocation>=540&&object.y<620-drawlocation&&object.number!=1){
-      offset = 620-drawlocation+object.y;  //right of player wrap correction
-    };
+  if(drawlocation>=540&&object.y<620-drawlocation&&object.number!=1){
+    offset = 620-drawlocation+object.y;  //right of player wrap correction
+  };
     
-    if(drawlocation<0&&object.y>=540&&object.number!=1){
-      offset = abs(drawlocation)-abs(620-object.y);  //left of player wrap correction
-    };
+  if(drawlocation<0&&object.y>=540&&object.number!=1){
+    offset = abs(drawlocation)-abs(620-object.y);  //left of player wrap correction
+  };
     
-    if((object.active==1&&object.x>=1&&object.x<=18&&offset>=0&&offset<=79)||((object.number>=200&&object.number<=230)&&(offset>=0&&offset<=79))){
-      if(object.face==0){
-       mvprintw(object.x,offset,"%s",object.line0);
-      } else if(object.face==1){
-       mvprintw(object.x,offset,"%s",object.line1);
-      } else if(object.face==2){
-       mvprintw(object.x,offset,"%s",object.line2);
-      } else if(object.face==3){
-       mvprintw(object.x,offset,"%s",object.line3);
-      } else if(object.face==4){
-       mvprintw(object.x,offset,"%s",object.line1);
-       mvprintw(object.x-1,offset,"%s",object.line0);
-      } else if(object.face==5){
-       mvprintw(object.x,offset,"%s",object.line1);
-       mvprintw(object.x-1,offset,"%s",object.line0);
-      } else if(object.face==6){
-       mvprintw(object.x,offset,"%s",object.line3);
-       mvprintw(object.x-1,offset,"%s",object.line2);
-      };
+  if((object.active==1&&object.x>=1&&object.x<=18&&offset>=0&&offset<=79)||((object.number>=200&&object.number<=230)&&(offset>=0&&offset<=79))){
+    if(object.face==0){
+      mvprintw(object.x,offset,"%s",object.line0);
+    } else if(object.face==1){
+      mvprintw(object.x,offset,"%s",object.line1);
+    } else if(object.face==2){
+      mvprintw(object.x,offset,"%s",object.line2);
+    } else if(object.face==3){
+      mvprintw(object.x,offset,"%s",object.line3);
+    } else if(object.face==4){
+      mvprintw(object.x,offset,"%s",object.line1);
+      mvprintw(object.x-1,offset,"%s",object.line0);
+    } else if(object.face==5){
+      mvprintw(object.x,offset,"%s",object.line1);
+      mvprintw(object.x-1,offset,"%s",object.line0);
+    } else if(object.face==6){
+      mvprintw(object.x,offset,"%s",object.line3);
+      mvprintw(object.x-1,offset,"%s",object.line2);
     };
-    
   };
   return drawlocation;
 
index 6ca0a98..e1554b3 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -802,7 +802,9 @@ int main(int argc, char *argv[]){
 
     // Draw pods objects 2-9    
     for(int podloop = 0; podloop<podmax; podloop++){
-      drawlocation = draw_object(pods[podloop], drawlocation); 
+      if(pods[podloop].number!=pod_in){
+        drawlocation = draw_object(pods[podloop], drawlocation); 
+      };  
     };
 
     // Draw gate object 10