pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r3683 - trunk/pingus/src


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3683 - trunk/pingus/src
Date: Sat, 5 Jul 2008 05:34:24 +0200

Author: grumbel
Date: 2008-07-05 05:34:22 +0200 (Sat, 05 Jul 2008)
New Revision: 3683

Modified:
   trunk/pingus/src/col_map.cpp
   trunk/pingus/src/col_map.hpp
   trunk/pingus/src/ground_map.cpp
   trunk/pingus/src/ground_map.hpp
   trunk/pingus/src/smallmap_image.cpp
   trunk/pingus/src/world.cpp
   trunk/pingus/src/world.hpp
Log:
Renamed ColMap to CollisionMap

Modified: trunk/pingus/src/col_map.cpp
===================================================================
--- trunk/pingus/src/col_map.cpp        2008-07-05 02:54:10 UTC (rev 3682)
+++ trunk/pingus/src/col_map.cpp        2008-07-05 03:34:22 UTC (rev 3683)
@@ -24,9 +24,8 @@
 #include "math.hpp"
 #include "gettext.h"
 #include "sprite.hpp"
-
-// Obtain the colmap from a memory area
-ColMap::ColMap(int w, int h)
+
+CollisionMap::CollisionMap(int w, int h)
   : serial(0),
     width(w),
     height(h),
@@ -36,14 +35,13 @@
   memset(colmap, Groundtype::GP_NOTHING, sizeof(unsigned char) * width * 
height);
 }
 
-ColMap::~ColMap()
+CollisionMap::~CollisionMap()
 {
-  //std::cout << "ColMap:~ColMap" << std::endl;
   delete[] colmap;
 }
 
 int
-ColMap::getpixel(int x, int y)
+CollisionMap::getpixel(int x, int y)
 {
   if (x >= 0 && x < width && y >= 0 && y < height) {
     return colmap[x+y*width];
@@ -53,31 +51,31 @@
 }
 
 int
-ColMap::getpixel_fast(int x, int y)
+CollisionMap::getpixel_fast(int x, int y)
 {
   return colmap[x+y*width];  
 }
 
 unsigned char*
-ColMap::get_data()
+CollisionMap::get_data()
 {
   return colmap;
 }
 
 int
-ColMap::get_height()
+CollisionMap::get_height()
 {
   return height;
 }
 
 int
-ColMap::get_width()
+CollisionMap::get_width()
 {
   return width;
 }
 
 void
-ColMap::remove(const CollisionMask& mask, int x_pos, int y_pos)
+CollisionMap::remove(const CollisionMask& mask, int x_pos, int y_pos)
 {
   ++serial;
 
@@ -105,7 +103,7 @@
 }
 
 void
-ColMap::put(int x, int y, Groundtype::GPType p)
+CollisionMap::put(int x, int y, Groundtype::GPType p)
 {
   ++serial; // FIXME: Shouldn't be here but at a more heigher level function
 
@@ -117,12 +115,12 @@
   else
     {
       if (verbose > 2)
-        std::cout << "ColMap: remove: Out of map" << std::endl;
+        std::cout << "CollisionMap: remove: Out of map" << std::endl;
     }
 }
 
 bool
-ColMap::blit_allowed (int x, int y,  Groundtype::GPType gtype)
+CollisionMap::blit_allowed (int x, int y,  Groundtype::GPType gtype)
 {
   // FIXME: Inline me
   if (gtype == Groundtype::GP_BRIDGE)
@@ -138,7 +136,7 @@
 
 // Puts a surface on the colmap
 void
-ColMap::put(const CollisionMask& mask, int sur_x, int sur_y, 
Groundtype::GPType pixel)
+CollisionMap::put(const CollisionMask& mask, int sur_x, int sur_y, 
Groundtype::GPType pixel)
 {
   // transparent groundpieces are only drawn on the gfx map, not on the colmap
   if (pixel == Groundtype::GP_TRANSPARENT)
@@ -148,7 +146,7 @@
     {
       if (verbose > 3)
        {
-         std::cout << "Warning: ColMap: Spot out of screen" << std::endl;
+         std::cout << "Warning: CollisionMap: Spot out of screen" << std::endl;
          std::cout << "sur_x: " << sur_x << " sur_y: " << sur_y << std::endl;
        }
       return;
@@ -166,7 +164,7 @@
 }
 
 void
-ColMap::draw(DrawingContext& gc)
+CollisionMap::draw(DrawingContext& gc)
 {
   Surface canvas(width, height);
   unsigned char* buffer;
@@ -229,9 +227,9 @@
 }
 
 unsigned
-ColMap::get_serial()
+CollisionMap::get_serial()
 {
   return serial;
 }
-
+
 /* EOF */

Modified: trunk/pingus/src/col_map.hpp
===================================================================
--- trunk/pingus/src/col_map.hpp        2008-07-05 02:54:10 UTC (rev 3682)
+++ trunk/pingus/src/col_map.hpp        2008-07-05 03:34:22 UTC (rev 3683)
@@ -25,12 +25,11 @@
 class DrawingContext;
 class ResDescriptor;
 class PixelStatus;
-
-// Collsion Map
-/** The collision map is used to represent the enviroment where the
+
+/** The CollisionMap is used to represent the enviroment where the
     Pingus walk around. The ground can have different properties, it
     can contain lava or water, it can be solid and many more. */
-class ColMap
+class CollisionMap
 {
 private:
   /** The serial number indicates the state of the colmap, on every
@@ -49,10 +48,10 @@
 public:
   /** Init the colmap from a given area of memory.
       The memory will be deleted in the destructor. */
-  ColMap(int w, int h);
+  CollisionMap(int w, int h);
 
   /** delete[] the uchar array used for the colmap */
-  ~ColMap();
+  ~CollisionMap();
 
   /** Returns the raw uchar array used for the inner representation of
       the colmap. This is used by the smallmap to create the radar  */
@@ -85,11 +84,10 @@
   void draw(DrawingContext& gc);
 
 private:
-  ColMap (const ColMap&);
-  ColMap& operator= (const ColMap&);
+  CollisionMap (const CollisionMap&);
+  CollisionMap& operator= (const CollisionMap&);
 };
+
+#endif
 
-
-#endif /* COLMAP_HH */
-
 /* EOF */

Modified: trunk/pingus/src/ground_map.cpp
===================================================================
--- trunk/pingus/src/ground_map.cpp     2008-07-05 02:54:10 UTC (rev 3682)
+++ trunk/pingus/src/ground_map.cpp     2008-07-05 03:34:22 UTC (rev 3683)
@@ -68,7 +68,7 @@
   width  = plf.get_size().width;
   height = plf.get_size().height;
 
-  colmap = new ColMap(width, height);
+  colmap = new CollisionMap(width, height);
 
   // Checking that the map has the correct size, only multiples of
   // tile_size are allowed, anything else wouldn't fit very well on
@@ -281,7 +281,7 @@
       }
 }
 
-ColMap*
+CollisionMap*
 GroundMap::get_colmap(void)
 {
   return colmap;

Modified: trunk/pingus/src/ground_map.hpp
===================================================================
--- trunk/pingus/src/ground_map.hpp     2008-07-05 02:54:10 UTC (rev 3682)
+++ trunk/pingus/src/ground_map.hpp     2008-07-05 03:34:22 UTC (rev 3683)
@@ -25,7 +25,7 @@
 
 class SceneContext;
 class PingusLevel;
-class ColMap;
+class CollisionMap;
 class GroundMap;
 
 class MapTile
@@ -52,7 +52,7 @@
 class GroundMap : public WorldObj
 {
 private:
-  ColMap* colmap;
+  CollisionMap* colmap;
 
   /** The tiles out of which the map is constructed */
   std::vector<std::vector<MapTile> > tile;
@@ -71,7 +71,7 @@
 
   void draw(SceneContext& gc);
 
-  ColMap* get_colmap();
+  CollisionMap* get_colmap();
 
   int  get_height();
   int  get_width();

Modified: trunk/pingus/src/smallmap_image.cpp
===================================================================
--- trunk/pingus/src/smallmap_image.cpp 2008-07-05 02:54:10 UTC (rev 3682)
+++ trunk/pingus/src/smallmap_image.cpp 2008-07-05 03:34:22 UTC (rev 3683)
@@ -39,7 +39,7 @@
   if (update_count > smallmap_update_time)
     {
       update_count = 0.0f;
-      ColMap* colmap = server->get_world()->get_colmap();
+      CollisionMap* colmap = server->get_world()->get_colmap();
 
       if (colmap_serial != colmap->get_serial())
         {
@@ -67,7 +67,7 @@
 {
   unsigned char* cbuffer;
 
-  ColMap* colmap = server->get_world()->get_colmap();
+  CollisionMap* colmap = server->get_world()->get_colmap();
 
   colmap_serial = colmap->get_serial();
 

Modified: trunk/pingus/src/world.cpp
===================================================================
--- trunk/pingus/src/world.cpp  2008-07-05 02:54:10 UTC (rev 3682)
+++ trunk/pingus/src/world.cpp  2008-07-05 03:34:22 UTC (rev 3683)
@@ -209,7 +209,7 @@
   armageddon_count = 0;
 }
 
-ColMap*
+CollisionMap*
 World::get_colmap()
 {
   return colmap;

Modified: trunk/pingus/src/world.hpp
===================================================================
--- trunk/pingus/src/world.hpp  2008-07-05 02:54:10 UTC (rev 3682)
+++ trunk/pingus/src/world.hpp  2008-07-05 03:34:22 UTC (rev 3683)
@@ -39,7 +39,7 @@
 class Pingu;
 class Trap;
 class View;
-class ColMap;
+class CollisionMap;
 class WorldObj;
 class GameTime;
 class SmallMap;
@@ -85,7 +85,7 @@
   PinguHolder*                    pingus;
 
   // Pointers which are references to objects from other classes
-  ColMap*         colmap;
+  CollisionMap*         colmap;
 
   void    init_worldobjs (const PingusLevel& plf);
 
@@ -121,7 +121,7 @@
   int get_time();
 
   /** @return A pointer to the collision map used in this world */
-  ColMap* get_colmap();
+  CollisionMap* get_colmap();
 
   /** @return A pointer to the gfx map used in this world */
   GroundMap* get_gfx_map();





reply via email to

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