pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src pingus_main.cxx, 1.97, 1.98 plf.cxx,


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src pingus_main.cxx, 1.97, 1.98 plf.cxx, 1.16, 1.17 plf_res_mgr.cxx, 1.6, 1.7 plf_res_mgr.hxx, 1.4, 1.5 theme.cxx, 1.18, 1.19 xml_pdf.cxx, 1.8, 1.9
Date: 19 Aug 2003 19:56:57 -0000

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

Modified Files:
        pingus_main.cxx plf.cxx plf_res_mgr.cxx plf_res_mgr.hxx 
        theme.cxx xml_pdf.cxx 
Log Message:
changes to cope with new level endings


Index: pingus_main.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_main.cxx,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -d -r1.97 -r1.98
--- pingus_main.cxx     18 Aug 2003 11:47:40 -0000      1.97
+++ pingus_main.cxx     19 Aug 2003 19:56:55 -0000      1.98
@@ -164,7 +164,6 @@
 
       //constructor of config must be run
       Config config(rcfile);
-      
//ConfigXML("/home/ingo/projects/pingus/cvs/data/levels/stone3-grumbel.xml");
     }
 }
 
@@ -804,9 +803,9 @@
       if (!System::exist(levelfile))
         {
           if (System::exist(levelfile + ".xml"))
-            levelfile += ".xml";
-          else if (System::exist("levels/" + levelfile + ".xml"))
-            levelfile = "levels/" + levelfile + ".xml";
+            levelfile += ".plf";
+          else if (System::exist("levels/" + levelfile + ".plf"))
+            levelfile = "levels/" + levelfile + ".plf";
           else
             {
               pout << _("PingusMain: Levelfile not found, ignoring: ") << 
levelfile << std::endl;

Index: plf.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/plf.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- plf.cxx     19 Apr 2003 10:23:17 -0000      1.16
+++ plf.cxx     19 Aug 2003 19:56:55 -0000      1.17
@@ -172,17 +172,7 @@
 PLF*
 PLF::create (const std::string& pathname)
 {
-  std::string extension = System::extension (pathname);
-
-  if (extension == "xml")
-    return new XMLPLF (pathname);
-  else if (extension == "plf")
-    {
-      PingusError::raise ("Loading of plf's no longer supported");
-      return 0;
-    }
-  else // filename does not have an extension, default to xml
-    return new XMLPLF (pathname);
+  return new XMLPLF (pathname);
 }
 
 /* EOF */

Index: plf_res_mgr.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/plf_res_mgr.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- plf_res_mgr.cxx     4 Jun 2003 17:22:33 -0000       1.6
+++ plf_res_mgr.cxx     19 Aug 2003 19:56:55 -0000      1.7
@@ -98,8 +98,7 @@
 PLFHandle
 PLFResMgr::load_plf(const std::string& res_name)
 {
-  return load_plf_raw(res_name,
-                      path_manager.complete("levels/" + res_name + ".xml"));
+  return load_plf_raw(res_name, path_manager.complete("levels/" + res_name + 
".plf"));
 }
 
 void PLFResMgr::free_plf_map()

Index: plf_res_mgr.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/plf_res_mgr.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- plf_res_mgr.hxx     4 Jun 2003 17:22:33 -0000       1.4
+++ plf_res_mgr.hxx     19 Aug 2003 19:56:55 -0000      1.5
@@ -47,7 +47,7 @@
   /** @return a handle to the PLF, instead of loading it from a
       res_name, load it from a system dependend filename
 
-      @param filename The filename of the plf, aka 
"../data/levels/snow11-grumbel.xml" */
+      @param filename The filename of the plf, aka 
"../data/levels/snow11-grumbel.plf" */
   static PLFHandle load_plf_from_filename(const std::string& filename);
   static  void free_plf_map();
 };

Index: theme.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/theme.cxx,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- theme.cxx   22 Apr 2003 16:40:41 -0000      1.18
+++ theme.cxx   19 Aug 2003 19:56:55 -0000      1.19
@@ -322,7 +322,8 @@
 {
   std::string filename;
 
-  if (verbose) std::cout << "Theme opening levels... " << std::flush;
+  if (verbose)
+    std::cout << "Theme opening levels... " << std::flush;
 
   for(std::vector<std::string>::iterator i = level_filenames.begin();
       i != level_filenames.end(); ++i)
@@ -330,24 +331,17 @@
       filename = path_manager.complete("levels/" + *i);
 
       try
-       {
-         if (filename.substr(filename.size() - 4) == ".plf")
-           {
-             PingusError::raise ("Loading of plf's no longer supported");
-           }
-         else
-           {
-             //std::cout << "Theme: Loading level: " << filename << std::endl;
-             XMLPLF plf(filename);
-             levelnames.push_back(System::translate(plf.get_levelname()));
-           }
-       }
-      catch (PingusError& err)
-       {
-         std::cout << "Theme: PingusError: " << err.get_message () << 
std::endl;
-       }
+             {
+          XMLPLF plf(filename);
+               levelnames.push_back(System::translate(plf.get_levelname()));
+             }
+           catch (PingusError& err)
+             {
+               std::cout << "Theme: PingusError: " << err.get_message () << 
std::endl;
+             }
     }
-  if (verbose) std::cout << "done." << std::endl;
+  if (verbose)
+    std::cout << "done." << std::endl;
 
   std::cout << "Levelnames: " << levelnames.size () << std::endl;
 }

Index: xml_pdf.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/xml_pdf.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- xml_pdf.cxx 19 Apr 2003 10:23:17 -0000      1.8
+++ xml_pdf.cxx 19 Aug 2003 19:56:55 -0000      1.9
@@ -83,7 +83,7 @@
   if (levelname.empty())
     PingusError::raise("XMLPDF: No level given");
 
-  plf = PLF::create(path_manager.complete("levels/" + levelname + ".xml"));
+  plf = PLF::create(path_manager.complete("levels/" + levelname + ".plf"));
 
   std::cout << "XXXXXXXXX Read Demo file: " << std::endl;
   write_xml(std::cout);





reply via email to

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