pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src game_session.cxx,1.9,1.10 hotspot.cxx


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src game_session.cxx,1.9,1.10 hotspot.cxx,1.4,1.5 hotspot.hxx,1.4,1.5 spot_map.cxx,1.17,1.18
Date: 17 Sep 2002 21:45:58 -0000

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

Modified Files:
        game_session.cxx hotspot.cxx hotspot.hxx spot_map.cxx 
Log Message:
- some small bugfixes
- removed the useless limitation to multiple of tile_size mapsize

Index: game_session.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/game_session.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- game_session.cxx    14 Sep 2002 19:06:33 -0000      1.9
+++ game_session.cxx    17 Sep 2002 21:45:56 -0000      1.10
@@ -21,14 +21,25 @@
 #include "true_server.hxx"
 #include "game_session.hxx"
 #include "game_session_result.hxx"
+#include "timer.hxx"
 #include "plf.hxx"
 
 PingusGameSession::PingusGameSession (std::string arg_filename)
-  : filename (arg_filename),
-    plf(PLF::create (filename)),
-    server (new TrueServer (plf)),
-    client (new Client(server))
+  : filename (arg_filename)
 {
+  Timer timer;
+  
+  timer.start();
+  plf    = PLF::create (filename);
+  std::cout << "Timer: Level loading took: " << timer.stop() << std::endl;
+
+  timer.start();
+  server = new TrueServer (plf);
+  std::cout << "Timer: TrueServer creation took: " << timer.stop() << 
std::endl;
+
+  timer.start();
+  client = new Client(server);
+  std::cout << "Timer: Client creation took: " << timer.stop() << std::endl;
 }
 
 PingusGameSession::~PingusGameSession ()

Index: hotspot.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/hotspot.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- hotspot.cxx 4 Sep 2002 20:30:28 -0000       1.4
+++ hotspot.cxx 17 Sep 2002 21:45:56 -0000      1.5
@@ -23,30 +23,23 @@
 #include "pingus_resource.hxx"
 
 Hotspot::Hotspot(const HotspotData& spot)
+  : HotspotData(spot)
 {
+  sprite = Sprite(desc);
+  //sprite.set_align_center();
+  
   if (verbose > 2)
     std::cout << "Creating Hotspot" << std::endl;
 
   pos   = spot.pos;
   para  = spot.para;
-  speed = spot.speed;
-
-  surface = PingusResource::load_surface(spot.desc);
-  
-  if (speed != -1)
-    {
-      count.set_size(surface.get_num_frames());
-      count.set_speed(speed);
-      count = 0;
-    }
 }
 
 void 
 Hotspot::draw (GraphicContext& gc)
 {
   // FIXME: para support doesnn't work correctly
-  gc.draw (surface, pos * para, static_cast<int>(count));
-  ++count;
+  gc.draw (sprite, pos * para);
 }
 
 /* EOF */

Index: hotspot.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/hotspot.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- hotspot.hxx 4 Sep 2002 19:40:19 -0000       1.4
+++ hotspot.hxx 17 Sep 2002 21:45:56 -0000      1.5
@@ -25,15 +25,15 @@
 #include "worldobj.hxx"
 #include "anim_counter.hxx"
 #include "hotspot_data.hxx"
+#include "sprite.hxx"
 
 class Hotspot : public HotspotData, 
                public WorldObj
 {
 private:
-  CL_Surface surface;
-  int speed;
+  Sprite sprite;
   float para;
-  AnimCounter count;
+
 public:
   Hotspot(const HotspotData& spot);
   

Index: spot_map.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/spot_map.cxx,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- spot_map.cxx        17 Sep 2002 16:23:30 -0000      1.17
+++ spot_map.cxx        17 Sep 2002 21:45:56 -0000      1.18
@@ -113,26 +113,24 @@
   // tile_size are allowed, anything else wouldn't fit very well on
   // the colmap
 
-  // FIXME: This is dirty cruft, the engine should be able to handle
-  // FIXME: all world_sizes and simply display the tiles partly
   if ((width % tile_size) != 0) 
     {
-      std::cout << "Warrning: Width is not a multible of " << tile_size << 
std::endl;
       width += (tile_size - (width % tile_size));
-      std::cout << "Warning: Fixing height to: " << width << std::endl;
     }
   
   if ((height % tile_size) != 0) 
     {
-      std::cout << "Warning: Width is not a multible of " << tile_size << 
std::endl;
       height += (tile_size - (height % tile_size));
-      std::cout << "Warning: Fixing height to: " << height << std::endl;
     } 
 
   // Allocating tile map
   tile.resize(width/tile_size);
   for(TileIter i=0; i < tile.size(); ++i) 
     tile[i].resize(height/tile_size);
+
+  // fix the height back to the correct values
+  width  = plf->get_width();
+  height = plf->get_height();
 }
 
 PingusSpotMap::~PingusSpotMap(void)





reply via email to

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