pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src/worldmap manager.cxx,1.27,1.28 manag


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldmap manager.cxx,1.27,1.28 manager.hxx,1.19,1.20
Date: 31 Mar 2003 21:52:05 -0000

Update of /var/lib/cvs/Games/Pingus/src/worldmap
In directory dark:/tmp/cvs-serv31978/worldmap

Modified Files:
        manager.cxx manager.hxx 
Log Message:
- added --worldmap option
- cleanup 'greeting' a bit

Index: manager.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/worldmap/manager.cxx,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- manager.cxx 30 Mar 2003 16:51:43 -0000      1.27
+++ manager.cxx 31 Mar 2003 21:52:03 -0000      1.28
@@ -82,7 +82,7 @@
   exit_worldmap = false;
  
   // FIXME: The default startup map should be configurable by some file
-  worldmap = new WorldMap (path_manager.complete("worldmaps/tutorial.xml"));
+
 
   //worldmap->on_startup ();
 
@@ -96,10 +96,24 @@
 }
 
 void
+WorldMapManager::load (const std::string& filename)
+{
+  if (worldmap)
+    delete worldmap;
+    
+  worldmap = new WorldMap (filename);
+}
+
+void
 WorldMapManager::on_startup ()
 {
   exit_worldmap = false;
   PingusSound::stop_music();
+
+  if (!worldmap)
+    {
+      load(path_manager.complete("worldmaps/tutorial.xml"));
+    }
 }
 
 WorldMapManager::~WorldMapManager ()
@@ -125,6 +139,7 @@
   // Check if new worldmap is set and if so, change it
   if (new_worldmap)
     {
+      delete worldmap;
       worldmap     = new_worldmap;
       new_worldmap = 0;
     }

Index: manager.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/worldmap/manager.hxx,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- manager.hxx 7 Mar 2003 00:08:58 -0000       1.19
+++ manager.hxx 31 Mar 2003 21:52:03 -0000      1.20
@@ -78,6 +78,8 @@
 public:
   ~WorldMapManager ();
   
+  void load (const std::string& filename);
+
   /** Check if WorldMap manager still needs to run and exit if if
       not */
   void update (float);





reply via email to

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