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.4,1.5 climber.cx


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/actions basher.cxx,1.4,1.5 climber.cxx,1.2,1.3 digger.cxx,1.2,1.3 faller.cxx,1.6,1.7 miner.cxx,1.2,1.3 walker.cxx,1.5,1.6
Date: 25 Jun 2002 17:05:27 -0000

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

Modified Files:
        basher.cxx climber.cxx digger.cxx faller.cxx miner.cxx 
        walker.cxx 
Log Message:
- preparation to join PixelStatus and GroundType
- changed the colmap in a collection of enum's instead of a bitfield
- changed some actions for handling the new pixelstatus treatment (can somebody 
test this?)
- changed the colmap blitter so that overwriting ground with a bridge is not 
possible, this fixes a few stuckyness bugs
[This patch changes a few things where I am not 100% sure what they will cause, 
so testers are welcome to test a lot]

Index: basher.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/basher.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- basher.cxx  23 Jun 2002 19:16:41 -0000      1.4
+++ basher.cxx  25 Jun 2002 17:05:25 -0000      1.5
@@ -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) == ColMap::WALL)
            {
              pout(PINGUS_DEBUG_ACTIONS) << "Basher: Found something to dig..." 
<< std::endl;
              return true;

Index: climber.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/climber.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- climber.cxx 13 Jun 2002 14:25:12 -0000      1.2
+++ climber.cxx 25 Jun 2002 17:05:25 -0000      1.3
@@ -58,10 +58,10 @@
 
   // If above is free
   if (rel_getpixel(0, 1) == ColMap::NOTHING
-      || rel_getpixel (0, 1) & ColMap::BRIDGE)
+      || rel_getpixel (0, 1) == ColMap::BRIDGE)
     {
       // and there is still ground to walk on
-      if (rel_getpixel(1, 1) & ColMap::WALL) 
+      if (rel_getpixel(1, 1) != ColMap::NOTHING) 
        {
          --pingu->pos.y;
          return;

Index: digger.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/digger.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- digger.cxx  19 Jun 2002 15:19:26 -0000      1.2
+++ digger.cxx  25 Jun 2002 17:05:25 -0000      1.3
@@ -67,7 +67,7 @@
 {
   if (rel_getpixel(0, -1) != ColMap::NOTHING)
     {
-      if (rel_getpixel(0, -1) & ColMap::SOLID)
+      if (rel_getpixel(0, -1) == ColMap::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.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- faller.cxx  25 Jun 2002 14:54:01 -0000      1.6
+++ faller.cxx  25 Jun 2002 17:05:25 -0000      1.7
@@ -124,7 +124,7 @@
     }
   else // Ping is on ground/water/something
     {
-      if (rel_getpixel(0, 0) & ColMap::WATER)
+      if (rel_getpixel(0, 0) == ColMap::WATER)
        {
          pingu->set_paction("drown");
          return;

Index: miner.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/miner.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- miner.cxx   13 Jun 2002 14:25:12 -0000      1.2
+++ miner.cxx   25 Jun 2002 17:05:25 -0000      1.3
@@ -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) == ColMap::SOLID)
     {
       PingusSound::play_sound("sounds/chink.wav");
       pingu->get_world()->get_colmap()->remove(miner_radius, pingu->get_x () - 
16 + pingu->direction, 

Index: walker.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/actions/walker.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- walker.cxx  24 Jun 2002 14:25:03 -0000      1.5
+++ walker.cxx  25 Jun 2002 17:05:25 -0000      1.6
@@ -47,8 +47,9 @@
   /* How should this code work?
      
   1) Check that the Pingu stands still on ground, if not turn it into
-  a faller. The reason we do so, is that we catch situations where a
-  digger or a similar action removed the ground under the walker.
+  a faller or drown. The reason we do so, is that we catch situations
+  where a digger or a similar action removed the ground under the
+  walker.
   
   2) If pingu is still on ground, we can preprare the next step
 
@@ -62,6 +63,12 @@
   // FIXME: pingu environment needs to get reviewed
   pingu->environment = ENV_LAND;
 
+  if (rel_getpixel(0, -1) == ColMap::WATER)
+    {
+      pingu->set_paction ("drown");
+      return;
+    }
+
   // 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)
@@ -85,14 +92,14 @@
        }
       else
        {
-         pingu->set_action ("faller");
+         pingu->set_paction ("faller");
          return;
        }
     }
 
   
-  if (rel_getpixel(1, 0) & ColMap::BRIDGE
-          && !head_collision_on_walk(1, 1))  // bridge
+  if (rel_getpixel(1, 0) == ColMap::BRIDGE
+      && !head_collision_on_walk(1, 1))  // bridge
     {
       // simple, stupid, but working bridge code
       // FIXME: We don't check if we 'drift' into a solid ground block




reply via email to

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