pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src globals.cxx,1.5,1.6 globals.hxx,1.11


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src globals.cxx,1.5,1.6 globals.hxx,1.11,1.12 pingu_action_factory.cxx,1.11,1.12 pingus_main.cxx,1.45,1.46 pingus_resource.cxx,1.21,1.22
Date: 18 Feb 2003 21:38:11 -0000

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

Modified Files:
        globals.cxx globals.hxx pingu_action_factory.cxx 
        pingus_main.cxx pingus_resource.cxx 
Log Message:
removed a bunch of obsolete code


Index: globals.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/globals.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- globals.cxx 8 Nov 2002 01:38:27 -0000       1.5
+++ globals.cxx 18 Feb 2003 21:38:08 -0000      1.6
@@ -46,7 +46,6 @@
 bool        swcursor_enabled                = false;
 std::string config_file;
 bool        background_manipulation_enabled = true;
-bool        use_datafile                    = false;
 bool        max_cpu_usage                   = true;
 bool        use_opengl                      = false;
 bool        action_help                     = true;

Index: globals.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/globals.hxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- globals.hxx 8 Nov 2002 01:38:27 -0000       1.11
+++ globals.hxx 18 Feb 2003 21:38:08 -0000      1.12
@@ -57,7 +57,6 @@
 extern bool        background_manipulation_enabled; ///< 
--enable-bg-manipulation
 extern bool        debug_game_time;                 ///< --debug-game-time
 extern bool        max_cpu_usage;                   ///< --max-cpu-usage
-extern bool        use_datafile;                    ///< --use-datafile
 extern bool        use_opengl;                      ///< --use-opengl
 extern bool        action_help;                     ///< --action-help
 extern bool        show_input_debug_screen;         ///

Index: pingu_action_factory.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_action_factory.cxx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- pingu_action_factory.cxx    27 Nov 2002 20:05:42 -0000      1.11
+++ pingu_action_factory.cxx    18 Feb 2003 21:38:08 -0000      1.12
@@ -138,7 +138,8 @@
 void
 PinguActionFactory::delete_actions ()
 {
-  std::cout << "PinguActionFactory::delete_actions (): Deleting all Actions" 
<< std::endl;
+  std::cout << "PinguActionFactory::delete_actions (): Deleting all Actions: " 
+            << all_actions.size() << std::endl;
   for (std::vector<PinguAction*>::iterator i = all_actions.begin ();
        i != all_actions.end (); ++i)
     {

Index: pingus_main.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_main.cxx,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- pingus_main.cxx     18 Feb 2003 18:41:59 -0000      1.45
+++ pingus_main.cxx     18 Feb 2003 21:38:08 -0000      1.46
@@ -217,8 +217,6 @@
       {"disable-action-help",no_argument,      0, 156},
       {"enable-action-help", no_argument,      0, 157},
       {"enable-bg-manipulation", no_argument,  0, 148},
-      {"use-datafile",      no_argument,       0, 150},
-      {"use-scriptfile",    no_argument,       0, 151},
       {"min-cpu-usage",     no_argument,       0, 153},
       {"min-frame-skip",    required_argument, 0, 154},
       {"max-frame-skip",    required_argument, 0, 155},
@@ -415,14 +413,6 @@
       
     case 148:
       background_manipulation_enabled = true;
-      break;
-
-    case 150:
-      use_datafile = true;
-      break;
-
-    case 151:
-      use_datafile = false;
       break;
 
     case 152:

Index: pingus_resource.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_resource.cxx,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- pingus_resource.cxx 2 Nov 2002 19:03:40 -0000       1.21
+++ pingus_resource.cxx 18 Feb 2003 21:38:08 -0000      1.22
@@ -18,10 +18,11 @@
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #ifndef WIN32
-       #include <unistd.h>
-       #include <sys/types.h>
-       #include <sys/stat.h>
+#  include <unistd.h>
+#  include <sys/types.h>
+#  include <sys/stat.h>
 #endif
+
 #include <assert.h>
 
 #include <ClanLib/png.h>
@@ -37,43 +38,6 @@
 std::map<ResDescriptor, CL_Surface>       PingusResource::surface_map;
 std::map<ResDescriptor, CL_Font*>          PingusResource::font_map;
 
-std::string
-suffix_fixer(const std::string& filename)
-{
-  std::string wrong_suffix;
-  std::string right_suffix;
-
-  // Using compiled datafiles, they load faster, but are larger
-  if (use_datafile)
-    {
-      right_suffix = ".dat";
-      wrong_suffix = ".scr";
-    }
-  else
-    {
-      right_suffix = ".scr";
-      wrong_suffix = ".dat";
-    }
-
-  // Filename ends with ".dat", replace it with ".scr" and return.
-  if (filename.substr(filename.size() - 4, std::string::npos) == wrong_suffix)
-    {
-      //std::cout << "PingusResource: Filename with \"" << wrong_suffix << "\" 
found: " << filename << std::endl;
-      return filename.substr(0, filename.size() - 4) + right_suffix;
-    }
-
-  // Filename does not end with ".scr", than add it and return
-  if (filename.substr(filename.size() - 4, std::string::npos) != right_suffix)
-    {
-      //std::cout << "PingusResource: filename doesn't contain \"" << 
right_suffix << "\", fixing: " << filename << std::endl;
-      return (filename + right_suffix);
-    }
-
-  // Everything should be all right, just return.
-  return filename;
-}
-
-
 void 
 PingusResource::init()
 {
@@ -97,8 +61,7 @@
 CL_ResourceManager*
 PingusResource::get(const std::string& arg_filename)
 {
-  std::string filename = suffix_fixer(arg_filename);
-  //std::cout << "PingusResource: getting: " << filename << std::endl;
+  std::string filename = arg_filename + ".scr";
 
   CL_ResourceManager* res_manager;
 
@@ -116,7 +79,7 @@
 
       // FIXME: Memory hole... 
       res_manager = new CL_ResourceManager(path_manager.complete 
(res_filename.c_str()),
-                                          /* is_datafile = */ use_datafile);
+                                          /* is_datafile = */false);
       
       resource_map[filename] = res_manager;
       return res_manager;
@@ -226,12 +189,12 @@
     {
     case ResDescriptor::RD_RESOURCE:
       try {
-       return CL_Surface (res_desc.res_name.c_str(), 
get(suffix_fixer(res_desc.datafile)));
+       return CL_Surface (res_desc.res_name.c_str(), get(res_desc.datafile));
       } catch (CL_Error err) {
        pout << "PingusResource:" << res_desc
             <<  ":-404-:" << err.message << std::endl;
        try {
-         return CL_Surface ("misc/404", get(suffix_fixer("core")));
+         return CL_Surface ("misc/404", get("core"));
        } catch (CL_Error err2) {
          pout << "PingusResource: Fatal error, important gfx files (404.pcx) 
couldn't be loaded!" << std::endl;
          throw err;
@@ -286,7 +249,7 @@
        case ResDescriptor::RD_RESOURCE:
          try {
            font = CL_Font::load(res_desc.res_name.c_str(),
-                                get(suffix_fixer(res_desc.datafile)));
+                                get(res_desc.datafile));
          } catch (CL_Error err) {
            pout << "PingusResource: " << err.message << std::endl
                 << "PingusResource: Couldn't load font: " << res_desc << 
std::endl;





reply via email to

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