pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src action_button.cxx,1.17,1.18 button_pa


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src action_button.cxx,1.17,1.18 button_panel.cxx,1.16,1.17 config.cxx,1.5,1.6 force_vector.cxx,1.7,1.8 force_vector.hxx,1.6,1.7 pingu_map.cxx,1.4,1.5 pingus.hxx,1.3,1.4 pingus_main.cxx,1.24,1.25 pingus_resource.cxx,1.17,1.18 plt_parser.cxx,1.5,1.6 plt_xml.cxx,1.10,1.11 smallmap.cxx,1.23,1.24 sprite.cxx,1.9,1.10 story.cxx,1.13,1.14 surface_button.hxx,1.10,1.11 wav_provider.cxx,1.3,1.4 xml_pdf.cxx,1.4,1.5 xml_plf.cxx,1.30,1.31
Date: 14 Oct 2002 11:15:17 -0000

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

Modified Files:
        action_button.cxx button_panel.cxx config.cxx force_vector.cxx 
        force_vector.hxx pingu_map.cxx pingus.hxx pingus_main.cxx 
        pingus_resource.cxx plt_parser.cxx plt_xml.cxx smallmap.cxx 
        sprite.cxx story.cxx surface_button.hxx wav_provider.cxx 
        xml_pdf.cxx xml_plf.cxx 
Log Message:
- applied the outstanding patches from the ML
- optimized force_vector a little 


Index: action_button.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/action_button.cxx,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- action_button.cxx   12 Oct 2002 00:49:09 -0000      1.17
+++ action_button.cxx   14 Oct 2002 11:15:15 -0000      1.18
@@ -42,7 +42,7 @@
   y_pos = y;
   name = name_;
  
-  if (name == Digger || name == Bomber
+  if (   name == Digger || name == Bomber
       || name == Floater || name == Blocker)
     {
       is_multi_direct = false;
@@ -82,9 +82,10 @@
 }
 
 void
-ActionButton::update(float /*delta*/)
+ActionButton::update(float delta)
 {
   ++action_c;
+  UNUSED_ARG(delta);
 }
 
 ActionName
@@ -280,7 +281,7 @@
 bool
 ForwardButton::is_at (int x, int y)
 {
-  if (x > x_pos && x < x_pos + int(surface.get_width())
+  if (   x > x_pos && x < x_pos + int(surface.get_width())
       && y > y_pos && y < y_pos + int(surface.get_height()))
     {
       return true;
@@ -335,7 +336,7 @@
 void
 PauseButton::on_primary_button_click (int x, int y)
 {
-  server->set_pause(!server->get_pause ());
+  server->set_pause(!server->get_pause());
   
   UNUSED_ARG(x);
   UNUSED_ARG(y);

Index: button_panel.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/button_panel.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- button_panel.cxx    4 Oct 2002 16:54:03 -0000       1.16
+++ button_panel.cxx    14 Oct 2002 11:15:15 -0000      1.17
@@ -186,7 +186,8 @@
 void
 ButtonPanel::on_primary_button_release(int x, int y)
 {
-  if(x); if(y);
+  UNUSED_ARG(x);
+  UNUSED_ARG(y);
 }
 
 /// Select the next action

Index: config.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/config.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- config.cxx  4 Sep 2002 14:55:11 -0000       1.5
+++ config.cxx  14 Oct 2002 11:15:15 -0000      1.6
@@ -282,7 +282,9 @@
          set_value(valueid, value);
        }
     }
-  catch (ConfigParserEOF a) {}
+  catch (ConfigParserEOF)
+       {
+       }
 }
 
 Config::Config()

Index: force_vector.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/force_vector.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- force_vector.cxx    28 Sep 2002 11:52:21 -0000      1.7
+++ force_vector.cxx    14 Oct 2002 11:15:15 -0000      1.8
@@ -52,18 +52,18 @@
 
 // Apply the explosion force
 Vector
-ExplosionForce::apply_forces(Vector p,Vector v)
+ExplosionForce::apply_forces(const Vector& p, const Vector& v)
 {
-  Vector tmpv = v;
-  float imod,dist;
-
   // Is p within the radius of the explosion?
-  if (!((p.x - ip.x < isize && p.x - ip.x > -isize)
+  if (!(   (p.x - ip.x < isize && p.x - ip.x > -isize)
        && (p.y - ip.y < isize && p.y - ip.y > -isize)))
     {
       return v;
     }
 
+  Vector tmpv = v;
+  float imod,dist;
+
   dist = fabs(p.x - ip.x);
   imod = iinten * ((isize - dist) / isize);
 
@@ -110,17 +110,17 @@
 }
 
 Vector
-ForcesHolder::apply_forces(Vector p,Vector v)
+ForcesHolder::apply_forces(const Vector& p, const Vector& v)
 {
   Vector tv = v;
 
   // Go through all of the forces and apply them all
   for (GForceIter i = grav_array.begin(); i != grav_array.end(); ++i)
-    tv = i->apply_forces(p,v);
+    tv = i->apply_forces(p,tv);
   
   // Explosion array...
   for (EForceIter j = explo_array.begin(); j != explo_array.end(); ++j)
-    tv = j->apply_forces(p,v);
+    tv = j->apply_forces(p,tv);
   
   return tv;
 }

Index: force_vector.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/force_vector.hxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- force_vector.hxx    28 Sep 2002 11:52:21 -0000      1.6
+++ force_vector.hxx    14 Oct 2002 11:15:15 -0000      1.7
@@ -44,7 +44,7 @@
   /** Applies the force to a velocity vector, v, a position p and
       returns the new velicty vector. Just adds fv to v, p is ignored
       as gravity is universal. */
-  Vector apply_forces(Vector p,Vector v)
+  Vector apply_forces(const Vector& p, const Vector& v)
   {
     UNUSED_ARG(p);
     return v + ifv;
@@ -71,7 +71,7 @@
   Vector ip;
 
 public:
-  ExplosionForce(float inten, float size,Vector p) : iinten(inten), 
isize(size), ip(p) 
+  ExplosionForce(float inten, float size, const Vector& p) : iinten(inten), 
isize(size), ip(p) 
   {
   }
 
@@ -81,7 +81,7 @@
 
   ExplosionForce& operator= (const ExplosionForce& old);
 
-  Vector apply_forces(Vector p,Vector v);
+  Vector apply_forces(const Vector& p, const Vector& v);
 
 };
 
@@ -113,7 +113,7 @@
   static void clear_all_forces();
 
   /// Apply forces
-  static Vector apply_forces(Vector p,Vector v);
+  static Vector apply_forces(const Vector& p, const Vector& v);
   
 private:
   ForcesHolder (const ForcesHolder&);
@@ -123,7 +123,3 @@
 #endif /* FVEC_HH */
 
 /* EOF */
-
-
-
-

Index: pingu_map.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_map.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pingu_map.cxx       16 Sep 2002 20:31:09 -0000      1.4
+++ pingu_map.cxx       14 Oct 2002 11:15:15 -0000      1.5
@@ -33,7 +33,10 @@
 void 
 PinguMap::mark_dirty(int x,int y,int w,int h)
 {
-  if (x || y || w || h); // no warnings
+       UNUSED_ARG(x);
+       UNUSED_ARG(y);
+       UNUSED_ARG(w);
+       UNUSED_ARG(h);
 }
 
 // Return '0' to indicate that the colmap can not be generated

Index: pingus.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- pingus.hxx  27 Sep 2002 11:32:44 -0000      1.3
+++ pingus.hxx  14 Oct 2002 11:15:15 -0000      1.4
@@ -33,7 +33,10 @@
 
 #  define snprintf _snprintf
 
-#  pragma warning(disable:4786)
+#  pragma warning(disable:4786) //over 255 characters in debug indentifier, 
due to STL instantiation
+   //sadly this does not actually work on 6.0, but it does in .NET
+
+#  pragma warning(disable:4355) //this used in constructor base
 #endif
 
 #define UNUSED_ARG(a) do {/* null */} while (&a == 0)

Index: pingus_main.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_main.cxx,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- pingus_main.cxx     10 Oct 2002 12:25:53 -0000      1.24
+++ pingus_main.cxx     14 Oct 2002 11:15:15 -0000      1.25
@@ -930,7 +930,7 @@
     std::cout << _("Error caught from Pingus: ") << err.get_message () << 
std::endl;
   }
 
-  catch (const std::bad_alloc& a) {
+  catch (const std::bad_alloc&) {
     std::cout << _("Pingus: Out of memory!") << std::endl;
   }
 

Index: pingus_resource.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_resource.cxx,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- pingus_resource.cxx 12 Oct 2002 00:49:10 -0000      1.17
+++ pingus_resource.cxx 14 Oct 2002 11:15:15 -0000      1.18
@@ -243,7 +243,7 @@
     default:
       perr << "PingusResource: Unknown ResDescriptor::type: " << res_desc.type 
 << std::endl;
       assert (false);
-      //return CL_Surface();
+      return CL_Surface();
     }
 }
 

Index: plt_parser.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/plt_parser.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- plt_parser.cxx      4 Sep 2002 14:55:11 -0000       1.5
+++ plt_parser.cxx      14 Oct 2002 11:15:15 -0000      1.6
@@ -69,7 +69,7 @@
        }
     }
   
-  catch (PLTEOF a) 
+  catch (PLTEOF) 
     {
       // cout << "PLT: EOF found" << endl;
     }

Index: plt_xml.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/plt_xml.cxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- plt_xml.cxx 30 Sep 2002 14:20:48 -0000      1.10
+++ plt_xml.cxx 14 Oct 2002 11:15:15 -0000      1.11
@@ -80,11 +80,11 @@
        }
       else if (XMLhelper::equal_str(cur->name, "stretch-x"))
        {
-         background.stretch_x = XMLhelper::parse_float(doc, cur);
+         background.stretch_x = XMLhelper::parse_bool(doc, cur);
        }
       else if (XMLhelper::equal_str(cur->name, "stretch-y"))
        {
-         background.stretch_y = XMLhelper::parse_float(doc, cur);
+         background.stretch_y = XMLhelper::parse_bool(doc, cur);
        }
       else
        {

Index: smallmap.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/smallmap.cxx,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- smallmap.cxx        10 Oct 2002 12:25:53 -0000      1.23
+++ smallmap.cxx        14 Oct 2002 11:15:15 -0000      1.24
@@ -308,8 +308,8 @@
 SmallMap::on_primary_button_release(int x, int y)
 {
   scroll_mode = false;
-  
-  if(x); if(y);
+  UNUSED_ARG(x);
+  UNUSED_ARG(y);
 }
 
 void

Index: sprite.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/sprite.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- sprite.cxx  1 Oct 2002 21:48:32 -0000       1.9
+++ sprite.cxx  14 Oct 2002 11:15:15 -0000      1.10
@@ -204,6 +204,7 @@
       return sur.get_num_frames ()/2;
     default:
       assert (0);
+         return 0;
     }
 }
 

Index: story.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/story.cxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- story.cxx   1 Oct 2002 21:48:32 -0000       1.13
+++ story.cxx   14 Oct 2002 11:15:15 -0000      1.14
@@ -150,7 +150,8 @@
 bool
 Story::is_at (int x, int y)
 {
-  if(x); if(y);
+  UNUSED_ARG(x);
+  UNUSED_ARG(y);
 
   std::cout << "bla" << std::endl; 
   return true;

Index: surface_button.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/surface_button.hxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- surface_button.hxx  27 Sep 2002 11:26:44 -0000      1.10
+++ surface_button.hxx  14 Oct 2002 11:15:15 -0000      1.11
@@ -62,7 +62,7 @@
   void on_pointer_press ();
   void on_pointer_release ();
   
-  void on_primary_button_click (int x, int y) { on_click (); if(x); if(y); }
+  void on_primary_button_click (int x, int y) { on_click (); UNUSED_ARG(x); 
UNUSED_ARG(y); }
 
   virtual void on_click () =0;
   

Index: wav_provider.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/wav_provider.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- wav_provider.cxx    23 Aug 2002 15:49:51 -0000      1.3
+++ wav_provider.cxx    14 Oct 2002 11:15:15 -0000      1.4
@@ -65,7 +65,7 @@
        }
     }
 #endif /* HAVE_LIBSDL_MIXER */
-  if (str.size()); // suppress warning about unused argument
+  UNUSED_ARG(str); // suppress warning about unused argument
   return 0;
 }
 

Index: xml_pdf.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/xml_pdf.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- xml_pdf.cxx 6 Oct 2002 19:29:39 -0000       1.4
+++ xml_pdf.cxx 14 Oct 2002 11:15:15 -0000      1.5
@@ -25,6 +25,8 @@
 #include "path_manager.hxx"
 #include "xml_pdf.hxx"
 
+#include <algorithm>
+
 XMLPDF::XMLPDF(const std::string& filename)
   : plf(0)
 {

Index: xml_plf.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/xml_plf.cxx,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- xml_plf.cxx 3 Oct 2002 12:33:09 -0000       1.30
+++ xml_plf.cxx 14 Oct 2002 11:15:15 -0000      1.31
@@ -360,7 +360,7 @@
        }
       else if (XMLhelper::equal_str(cur->name, "playable"))
        {
-         playable = XMLhelper::parse_int(doc, cur);
+         playable = XMLhelper::parse_bool(doc, cur);
        }
       else if (XMLhelper::equal_str(cur->name, "comment"))
        {





reply via email to

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