pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src/actions basher.cxx,1.5,1.6 blocker.cx


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/actions basher.cxx,1.5,1.6 blocker.cxx,1.1,1.2 bridger.cxx,1.3,1.4 climber.cxx,1.3,1.4 digger.cxx,1.3,1.4 faller.cxx,1.7,1.8 miner.cxx,1.3,1.4 slider.cxx,1.1,1.2 walker.cxx,1.6,1.7
Date: 25 Jun 2002 18:15:20 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/actions
In directory dark:/tmp/cvs-serv1377/actions

Modified Files:
        basher.cxx blocker.cxx bridger.cxx climber.cxx digger.cxx 
        faller.cxx miner.cxx slider.cxx walker.cxx 
Log Message:
- final merge of PixelStatus and GroundpieceData::GPType, might need some more 
testing

Index: basher.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/basher.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- basher.cxx  25 Jun 2002 17:05:25 -0000      1.5
+++ basher.cxx  25 Jun 2002 18:15:18 -0000      1.6
@@ -90,7 +90,7 @@
 void
 Basher::walk_forward()
 {
-  if (rel_getpixel(0, -1) == ColMap::NOTHING) {
+  if (rel_getpixel(0, -1) ==  GroundpieceData::GP_NOTHING) {
     // We ar e in the air... lets fall...
     is_finished = true;
   } else {
@@ -115,7 +115,7 @@
       // up to head collision height.
       for (int j = bash_height + 1; j <= 26; j++)
         {
-          if (rel_getpixel(i,j) == ColMap::WALL)
+          if (rel_getpixel(i,j) == GroundpieceData::GP_GROUND)
            {
              pout(PINGUS_DEBUG_ACTIONS) << "Basher: Found something to dig..." 
<< std::endl;
              return true;

Index: blocker.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/blocker.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- blocker.cxx 12 Jun 2002 19:01:42 -0000      1.1
+++ blocker.cxx 25 Jun 2002 18:15:18 -0000      1.2
@@ -40,12 +40,14 @@
 
   is_finished = false;
 
-  if (rel_getpixel(0,-1) == ColMap::NOTHING && rel_getpixel(0, -2) == 
ColMap::WALL) 
+  if (rel_getpixel(0,-1)     ==  GroundpieceData::GP_NOTHING
+      && rel_getpixel(0, -2) ==  GroundpieceData::GP_GROUND)
     {
       ++pingu->pos.x;
     } 
-  else if (rel_getpixel(0,-1) == ColMap::NOTHING && rel_getpixel(0, -2) == 
ColMap::NOTHING
-          && rel_getpixel(0,-3) == ColMap::WALL) 
+  else if (rel_getpixel(0,-1) ==  GroundpieceData::GP_NOTHING
+          && rel_getpixel(0, -2) ==  GroundpieceData::GP_NOTHING
+          && rel_getpixel(0,-3) ==  GroundpieceData::GP_GROUND)
     {
       ++pingu->pos.y;
       ++pingu->pos.y;
@@ -70,7 +72,7 @@
 bool
 Blocker::standing_on_ground()
 {
-  return (rel_getpixel(0,-1) != ColMap::NOTHING);
+  return (rel_getpixel(0,-1) !=  GroundpieceData::GP_NOTHING);
 }
 
 bool

Index: bridger.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/bridger.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- bridger.cxx 24 Jun 2002 09:40:59 -0000      1.3
+++ bridger.cxx 25 Jun 2002 18:15:18 -0000      1.4
@@ -164,7 +164,7 @@
 bool
 Bridger::way_is_free()
 {
-  return (rel_getpixel(4,2) == ColMap::NOTHING)
+  return (rel_getpixel(4,2) ==  GroundpieceData::GP_NOTHING)
     && !head_collision_on_walk(4, 2)
     && !head_collision_on_walk(8, 4);
 }

Index: climber.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/climber.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- climber.cxx 25 Jun 2002 17:05:25 -0000      1.3
+++ climber.cxx 25 Jun 2002 18:15:18 -0000      1.4
@@ -57,16 +57,16 @@
   sprite.update(delta);
 
   // If above is free
-  if (rel_getpixel(0, 1) == ColMap::NOTHING
-      || rel_getpixel (0, 1) == ColMap::BRIDGE)
+  if (rel_getpixel(0, 1) ==  GroundpieceData::GP_NOTHING
+      || rel_getpixel (0, 1) ==  GroundpieceData::GP_BRIDGE)
     {
       // and there is still ground to walk on
-      if (rel_getpixel(1, 1) != ColMap::NOTHING) 
+      if (rel_getpixel(1, 1) !=  GroundpieceData::GP_NOTHING) 
        {
          --pingu->pos.y;
          return;
        }
-      else if (rel_getpixel(1, 1) == ColMap::NOTHING) 
+      else if (rel_getpixel(1, 1) ==  GroundpieceData::GP_NOTHING) 
        {
          //  std::cout << "Climber failed, no more wall" << std::endl;
 

Index: digger.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/digger.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- digger.cxx  25 Jun 2002 17:05:25 -0000      1.3
+++ digger.cxx  25 Jun 2002 18:15:18 -0000      1.4
@@ -65,9 +65,9 @@
 bool   
 Digger::have_something_to_dig()
 {
-  if (rel_getpixel(0, -1) != ColMap::NOTHING)
+  if (rel_getpixel(0, -1) !=  GroundpieceData::GP_NOTHING)
     {
-      if (rel_getpixel(0, -1) == ColMap::SOLID)
+      if (rel_getpixel(0, -1) ==  GroundpieceData::GP_SOLID)
        {
          PingusSound::play_sound("sounds/chink.wav");
          return false;  

Index: faller.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/faller.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- faller.cxx  25 Jun 2002 17:05:25 -0000      1.7
+++ faller.cxx  25 Jun 2002 18:15:18 -0000      1.8
@@ -64,7 +64,7 @@
   }
 
   // Pingu stands on ground
-  if (rel_getpixel(0, -1) != ColMap::NOTHING)
+  if (rel_getpixel(0, -1) !=  GroundpieceData::GP_NOTHING)
     { 
       pingu->set_paction ("walker");
       return;
@@ -78,7 +78,7 @@
   
   // Update x and y by moving the penguin to it's target *slowly*
   // and checking if the penguin has hit the bottom at each loop
-  while(rel_getpixel(0, 0) == ColMap::NOTHING
+  while(rel_getpixel(0, 0) == GroundpieceData::GP_NOTHING
        && (fabs(newp.x) >= 1 || fabs(newp.y) >= 1))
     {
       last_pos = pingu->pos;
@@ -115,7 +115,7 @@
     }
 
   // Now that the Pingu is moved, check if he hits the ground.
-  if (rel_getpixel(0, 0) == ColMap::NOTHING)
+  if (rel_getpixel(0, 0) == GroundpieceData::GP_NOTHING)
     { // if pingu is not on ground
       ++falling;
          
@@ -124,7 +124,7 @@
     }
   else // Ping is on ground/water/something
     {
-      if (rel_getpixel(0, 0) == ColMap::WATER)
+      if (rel_getpixel(0, 0) == GroundpieceData::GP_WATER)
        {
          pingu->set_paction("drown");
          return;

Index: miner.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/miner.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- miner.cxx   25 Jun 2002 17:05:25 -0000      1.3
+++ miner.cxx   25 Jun 2002 18:15:18 -0000      1.4
@@ -67,7 +67,7 @@
       pingu->pos.y += 1;
     }
   
-  if (rel_getpixel(0, -1) == ColMap::NOTHING)
+  if (rel_getpixel(0, -1) ==  GroundpieceData::GP_NOTHING)
     {
       pingu->get_world()->get_colmap()->remove(miner_radius, 
                                               pingu->get_x () - 16 + 
pingu->direction, 
@@ -77,7 +77,7 @@
                                                pingu->get_y () - 29);
       is_finished = true;
     }
-  else if (rel_getpixel(0, -1) == ColMap::SOLID)
+  else if (rel_getpixel(0, -1) ==  GroundpieceData::GP_SOLID)
     {
       PingusSound::play_sound("sounds/chink.wav");
       pingu->get_world()->get_colmap()->remove(miner_radius, pingu->get_x () - 
16 + pingu->direction, 

Index: slider.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/slider.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- slider.cxx  12 Jun 2002 19:01:42 -0000      1.1
+++ slider.cxx  25 Jun 2002 18:15:18 -0000      1.2
@@ -49,7 +49,7 @@
     {
       pingu->pos.x += pingu->direction;
       
-      if (rel_getpixel(0, -1) == ColMap::NOTHING)
+      if (rel_getpixel(0, -1) ==  GroundpieceData::GP_NOTHING)
        {
          speed = (speed > 5 ? 5 : speed);
 

Index: walker.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/walker.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- walker.cxx  25 Jun 2002 17:05:25 -0000      1.6
+++ walker.cxx  25 Jun 2002 18:15:18 -0000      1.7
@@ -63,7 +63,7 @@
   // FIXME: pingu environment needs to get reviewed
   pingu->environment = ENV_LAND;
 
-  if (rel_getpixel(0, -1) == ColMap::WATER)
+  if (rel_getpixel(0, -1) ==  GroundpieceData::GP_WATER)
     {
       pingu->set_paction ("drown");
       return;
@@ -71,7 +71,7 @@
 
   // The Pingu stands no longer on ground, the cause for this could be
   // a digger, miner or a bomber
-  if (rel_getpixel(0, -1) == ColMap::NOTHING)
+  if (rel_getpixel(0, -1) ==  GroundpieceData::GP_NOTHING)
     { 
       // We search for the nearest ground below the pingu, if we can't
       // find anything within a few pixels, we will turn into a faller
@@ -79,7 +79,7 @@
       int i;
       for (i = -2; i > -5; --i)
        {
-         if (!(rel_getpixel(0, i) == ColMap::NOTHING))
+         if (!(rel_getpixel(0, i) == GroundpieceData::GP_NOTHING))
            {
              found_ground = true;
              break;
@@ -98,7 +98,7 @@
     }
 
   
-  if (rel_getpixel(1, 0) == ColMap::BRIDGE
+  if (rel_getpixel(1, 0) == GroundpieceData::GP_BRIDGE
       && !head_collision_on_walk(1, 1))  // bridge
     {
       // simple, stupid, but working bridge code
@@ -122,8 +122,8 @@
       int y_inc = 0;
       bool found_next_step = false;
        for(y_inc=-max_steps; y_inc <= max_steps; y_inc++) // up-hill
-       if (rel_getpixel(1, y_inc) == ColMap::NOTHING
-           && rel_getpixel(1, y_inc - 1) != ColMap::NOTHING)
+       if (rel_getpixel(1, y_inc) ==  GroundpieceData::GP_NOTHING
+           && rel_getpixel(1, y_inc - 1) !=  GroundpieceData::GP_NOTHING)
          {
            found_next_step = true;
            break;
@@ -136,7 +136,7 @@
        }
       else
        {
-         if (rel_getpixel(1, 0) != ColMap::NOTHING)
+         if (rel_getpixel(1, 0) !=  GroundpieceData::GP_NOTHING)
            {
              // We reached a wall
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]