pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r3369 - in trunk/pingus/src: . actions


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3369 - in trunk/pingus/src: . actions
Date: Mon, 29 Oct 2007 02:14:24 +0100

Author: grumbel
Date: 2007-10-29 02:14:23 +0100 (Mon, 29 Oct 2007)
New Revision: 3369

Modified:
   trunk/pingus/src/actions/faller.cpp
   trunk/pingus/src/smallmap_image.cpp
Log:
- added note on colmap bug

Modified: trunk/pingus/src/actions/faller.cpp
===================================================================
--- trunk/pingus/src/actions/faller.cpp 2007-10-29 00:59:56 UTC (rev 3368)
+++ trunk/pingus/src/actions/faller.cpp 2007-10-29 01:14:23 UTC (rev 3369)
@@ -44,6 +44,8 @@
                                                        pingu->get_owner_str() 
+ "/tumbler/left"));
   tumbler.load(Direction::RIGHT, Resource::load_sprite("pingus/player" + 
                                                        pingu->get_owner_str() 
+ "/tumbler/right"));
+
+  // FIXME: add sprites for jumping here: if x_vel > y_vel, use them
 }
 
 Faller::~Faller () { }
@@ -96,8 +98,8 @@
               && rel_getpixel(0, -2) != Groundtype::GP_NOTHING)
             {
               // Ping is on ground/water/something
-              if (   rel_getpixel(0, -1) == Groundtype::GP_WATER
-                     || rel_getpixel(0, -1) == Groundtype::GP_LAVA)
+              if (rel_getpixel(0, -1) == Groundtype::GP_WATER
+                  || rel_getpixel(0, -1) == Groundtype::GP_LAVA)
                 {
                   pingu->set_action(Actions::Drown);
                 }

Modified: trunk/pingus/src/smallmap_image.cpp
===================================================================
--- trunk/pingus/src/smallmap_image.cpp 2007-10-29 00:59:56 UTC (rev 3368)
+++ trunk/pingus/src/smallmap_image.cpp 2007-10-29 01:14:23 UTC (rev 3369)
@@ -87,6 +87,18 @@
 
   assert(width < cmap_width && height < cmap_height);
 
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+  const int red   = 3;
+  const int green = 2;
+  const int blue  = 1;
+  const int alpha = 0;
+#else
+  const int red   = 0;
+  const int green = 1;
+  const int blue  = 2;
+  const int alpha = 3;
+#endif 
+
   for(int y = 0; y < height; ++y)
     {
       for (int x = 0; x < width; ++x)
@@ -94,18 +106,6 @@
           // Index on the smallmap canvas
           int i = y * pitch + 4 * x;
 
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-          const int red   = 3;
-          const int green = 2;
-          const int blue  = 1;
-          const int alpha = 0;
-#else
-          const int red   = 0;
-          const int green = 1;
-          const int blue  = 2;
-          const int alpha = 3;
-#endif 
-
           switch (colmap->getpixel_fast(x * cmap_width  / width,
                                         y * cmap_height / height))
             {
@@ -123,6 +123,13 @@
                 cbuffer[i + alpha] = 255;
                 break;
 
+              case Groundtype::GP_SOLID:
+                cbuffer[i + red]   = 100;
+                cbuffer[i + green] = 100;
+                cbuffer[i + blue]  = 125;
+                cbuffer[i + alpha] = 255;
+                break;
+
               case Groundtype::GP_WATER:
               case Groundtype::GP_LAVA:
                 cbuffer[i + red]   = 0;
@@ -131,23 +138,6 @@
                 cbuffer[i + alpha] = 255;
                 break;
 
-#if 0
-                // FIXME: temporaty disabled for 0.6.0 release, since all 
liquids are currently lava
-              case Groundtype::GP_LAVA:
-                cbuffer[i + 3] = 255; // alpha
-                cbuffer[i + 2] = 255; // blue
-                cbuffer[i + 1] = 128;   // green
-                cbuffer[i + 0] = 128;   // red
-                break;
-#endif
-
-              case Groundtype::GP_SOLID:
-                cbuffer[i + red]   = 100;
-                cbuffer[i + green] = 100;
-                cbuffer[i + blue]  = 100;
-                cbuffer[i + alpha] = 255;
-                break;
-
               default:
                 cbuffer[i + red]   = 200;
                 cbuffer[i + green] = 200;
@@ -157,9 +147,11 @@
             }
        }
     }
+
   canvas.unlock();
+  // FIXME: Should do: sur = Sprite(canvas.clone());
+  // but doesn't work, gives transparent surface as result
   sur = Sprite(canvas);
 }
 
-
 /* EOF */





reply via email to

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