pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src pingu_action.hxx,1.6,1.7 pingus_resou


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src pingu_action.hxx,1.6,1.7 pingus_resource.cxx,1.13,1.14 res_descriptor.cxx,1.6,1.7 xml_helper.cxx,1.7,1.8
Date: 28 Jun 2002 17:48:44 -0000

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

Modified Files:
        pingu_action.hxx pingus_resource.cxx res_descriptor.cxx 
        xml_helper.cxx 
Log Message:
some cleanup in the resource loading, speed should be back to normal

Index: pingu_action.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_action.hxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- pingu_action.hxx    28 Jun 2002 15:12:22 -0000      1.6
+++ pingu_action.hxx    28 Jun 2002 17:48:42 -0000      1.7
@@ -84,7 +84,8 @@
   /// Returns the activation mode
   virtual ActionType get_activation_mode(void) const;
 
-  /// The name of the action
+  /** The name of the action, this is used in the CaputreRectangle, so
+      it can contain more than just the name */
   virtual std::string get_name(void) const =0;
   
   /// The type of the action

Index: pingus_resource.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_resource.cxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- pingus_resource.cxx 28 Jun 2002 17:02:25 -0000      1.13
+++ pingus_resource.cxx 28 Jun 2002 17:48:42 -0000      1.14
@@ -123,7 +123,6 @@
 CL_Surface
 PingusResource::load_surface(const ResDescriptor& res_desc)
 {
-  pout(PINGUS_DEBUG_RESOURCES) << "PingusResource: Loading surface: " << 
res_desc << std::endl;
 
   // try to load from cache
   CL_Surface surf = load_from_cache(res_desc);
@@ -138,6 +137,7 @@
 
       if (surf) // found unmodified version in cache
        {
+         pout(PINGUS_DEBUG_RESOURCES) << "PingusResource: Loading surface from 
cache 1/2: " << res_desc << std::endl;
          surf = apply_modifier (surf, res_desc);
       
          // add to cache (FIXME: doesn't work)
@@ -148,6 +148,7 @@
          ResDescriptor desc = res_desc;
          desc.modifier = ROT0;
 
+         pout(PINGUS_DEBUG_RESOURCES) << "PingusResource: Loading surface from 
source: " << res_desc << std::endl;
          surf = load_from_source (desc);
          surface_map[desc] = surf; // add to cache
 
@@ -155,6 +156,10 @@
          surface_map[res_desc] = surf; // add modified version to cache
        }
     }
+  else
+    {
+      pout(PINGUS_DEBUG_RESOURCES) << "PingusResource: Loading surface from 
cache: " << res_desc << std::endl;
+    }
 
   return surf;
 }
@@ -258,7 +263,7 @@
 CL_Font* 
 PingusResource::load_font(const ResDescriptor& res_desc)
 {
-  pout(PINGUS_DEBUG_LOADING) << "PingusResource: Loading font: " << res_desc 
<< std::endl;
+  pout(PINGUS_DEBUG_RESOURCES) << "PingusResource: Loading font: " << res_desc 
<< std::endl;
 
   CL_Font* font = font_map[res_desc];
   

Index: res_descriptor.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/res_descriptor.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- res_descriptor.cxx  28 Jun 2002 17:06:40 -0000      1.6
+++ res_descriptor.cxx  28 Jun 2002 17:48:42 -0000      1.7
@@ -107,8 +107,36 @@
 ResDescriptor::operator<(const ResDescriptor& res_desc) const
 {
   // FIXME: This is ugly and slow
-  return (datafile + res_name + to_string (type) + to_string (modifier)) 
-    < (res_desc.datafile + res_desc.res_name + to_string (res_desc.type) + 
to_string (res_desc.modifier));
+  //return (datafile + res_name + to_string (type) + to_string (modifier)) 
+  //  < (res_desc.datafile + res_desc.res_name + to_string (res_desc.type) + 
to_string (res_desc.modifier));
+
+  if (datafile < res_desc.datafile)
+    return true;
+  else if (datafile > res_desc.datafile)
+    return false;
+  else
+    {
+      if (res_name < res_desc.res_name)
+       return true;
+      else if (res_name > res_desc.res_name)
+       return false;
+      else
+       {
+         if (modifier < res_desc.modifier)
+           return true;
+         else if (modifier > res_desc.modifier)
+           return false;
+         else
+           {
+             if (type < res_desc.type)
+               return true;
+             else if (type > res_desc.type)
+               return false;
+             else
+               return false;  
+           }
+       }
+    }
 }
 
 std::ostream& operator<<(std::ostream& s, const ResDescriptor& desc)

Index: xml_helper.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/xml_helper.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- xml_helper.cxx      26 Jun 2002 16:49:33 -0000      1.7
+++ xml_helper.cxx      28 Jun 2002 17:48:42 -0000      1.8
@@ -225,9 +225,9 @@
              desc.type = ResDescriptor::RD_RESOURCE;
              while (ccur != NULL)
                {
-                 if (xmlIsBlankNode(cur)) 
+                 if (xmlIsBlankNode(ccur)) 
                    {
-                     cur = cur->next;
+                     ccur = ccur->next;
                      continue;
                    }
 




reply via email to

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