pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src/input/axes dummy_axis.hxx, 1.4, 1.5 i


From: Ingo Ruhnke
Subject: [Pingus-CVS] CVS: Games/Pingus/src/input/axes dummy_axis.hxx, 1.4, 1.5 inverted_axis.cxx, 1.3, 1.4 inverted_axis.hxx, 1.4, 1.5 joystick_axis.cxx, 1.4, 1.5 multiple_axis.cxx, 1.2, 1.3 multiple_axis.hxx, 1.4, 1.5
Date: Mon, 20 Oct 2003 21:28:57 +0200

Update of /var/lib/cvs/Games/Pingus/src/input/axes
In directory dark:/tmp/cvs-serv7605/input/axes

Modified Files:
        dummy_axis.hxx inverted_axis.cxx inverted_axis.hxx 
        joystick_axis.cxx multiple_axis.cxx multiple_axis.hxx 
Log Message:
misc stuff

Index: dummy_axis.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/axes/dummy_axis.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- dummy_axis.hxx      19 Apr 2003 10:23:19 -0000      1.4
+++ dummy_axis.hxx      20 Oct 2003 19:28:55 -0000      1.5
@@ -22,37 +22,38 @@
 
 #include "../axis.hxx"
 
+namespace Pingus {
 namespace Input {
+namespace Axes {
 
-  namespace Axes {
-
-    /**
-      @brief Dummy Axis to be used if an axis is required but none defined
+/**
+   @brief Dummy Axis to be used if an axis is required but none defined
 
-      XML definition: none
-     */
-    class DummyAxis : public Axis {
+   XML definition: none
+*/
+class DummyAxis : public Axis {
 
-      private:
-        float pos;
-        float angle;
+private:
+  float pos;
+  float angle;
 
-      public:
+public:
 
-        DummyAxis () : pos(0.0f), angle(0.0f) { }
+  DummyAxis () : pos(0.0f), angle(0.0f) { }
 
-        virtual const float& get_pos ()   const { return pos; }
-        virtual const float& get_angle () const { return angle; }
+  virtual const float& get_pos ()   const { return pos; }
+  virtual const float& get_angle () const { return angle; }
 
-        virtual void  update(float) { }
+  virtual void  update(float) { }
 
-      private:
-        DummyAxis (const DummyAxis&);
-        DummyAxis& operator= (const DummyAxis&);
-    };
+private:
+  DummyAxis (const DummyAxis&);
+  DummyAxis& operator= (const DummyAxis&);
+};
 
-  }
-}
+} // namespace Axis
+} // namespace Input
+} // namespace Pingus
 
 #endif
 

Index: inverted_axis.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/axes/inverted_axis.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- inverted_axis.cxx   19 Apr 2003 10:23:19 -0000      1.3
+++ inverted_axis.cxx   20 Oct 2003 19:28:55 -0000      1.4
@@ -19,39 +19,40 @@
 
 #include "inverted_axis.hxx"
 
+namespace Pingus {
 namespace Input {
+namespace Axes {
 
-  namespace Axes {
-
-    InvertedAxis::InvertedAxis (Axis* axis_) : axis(axis_)
-    {
-      angle = static_cast<float>((static_cast<int>(axis->get_angle()) + 180) % 
360);
-    }
-
-    InvertedAxis::~InvertedAxis ()
-    {
-      delete axis;
-    }
+InvertedAxis::InvertedAxis (Axis* axis_) : axis(axis_)
+{
+  angle = static_cast<float>((static_cast<int>(axis->get_angle()) + 180) % 
360);
+}
 
-    const float&
-    InvertedAxis::get_pos () const
-    {
-      return axis->get_pos();
-    }
+InvertedAxis::~InvertedAxis ()
+{
+  delete axis;
+}
 
-    const float&
-    InvertedAxis::get_angle () const
-    {
-      return angle;
-    }
+const float&
+InvertedAxis::get_pos () const
+{
+  return axis->get_pos();
+}
 
-    void
-    InvertedAxis::update (float delta)
-    {
-      axis->update(delta);
-    }
+const float&
+InvertedAxis::get_angle () const
+{
+  return angle;
+}
 
-  }
+void
+InvertedAxis::update (float delta)
+{
+  axis->update(delta);
 }
 
+} // namespace Axes
+} // namespace Input
+} // namespace Pingus
+
 /* EOF */

Index: inverted_axis.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/axes/inverted_axis.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- inverted_axis.hxx   19 Apr 2003 10:23:19 -0000      1.4
+++ inverted_axis.hxx   20 Oct 2003 19:28:55 -0000      1.5
@@ -22,37 +22,38 @@
 
 #include "../axis.hxx"
 
+namespace Pingus {
 namespace Input {
+namespace Axes {
 
-  namespace Axes {
-
-    /**
-      @brief decorator class inverting the angle of an axis
+/**
+   @brief decorator class inverting the angle of an axis
 
-      XML definition: <inverted-axis> <axis> </inverted-axis>
-      */
-    class InvertedAxis : public Axis {
+   XML definition: <inverted-axis> <axis> </inverted-axis>
+*/
+class InvertedAxis : public Axis {
 
-    private:
-      Axis* const axis;
-      float       angle;
+private:
+  Axis* const axis;
+  float       angle;
 
-    public:
-      InvertedAxis (Axis* axis_);
-     ~InvertedAxis ();
+public:
+  InvertedAxis (Axis* axis_);
+  ~InvertedAxis ();
 
-      virtual const float& get_pos   () const;
-      virtual const float& get_angle () const;
+  virtual const float& get_pos   () const;
+  virtual const float& get_angle () const;
 
-      virtual void  update (float delta);
+  virtual void  update (float delta);
 
-    private:
-      InvertedAxis (const InvertedAxis&);
-      InvertedAxis& operator= (const InvertedAxis&);
-    };
+private:
+  InvertedAxis (const InvertedAxis&);
+  InvertedAxis& operator= (const InvertedAxis&);
+};
 
-  }
-}
+} // namespace Axes
+} // namespace Input
+} // namespace Pingus
 
 #endif
 

Index: joystick_axis.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/axes/joystick_axis.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- joystick_axis.cxx   20 Oct 2003 13:33:44 -0000      1.4
+++ joystick_axis.cxx   20 Oct 2003 19:28:55 -0000      1.5
@@ -30,6 +30,7 @@
 JoystickAxis::JoystickAxis(int id_, int axis_, float angle_) 
   : id(id_), axis(axis_), pos(0), angle(angle_)
 {
+#ifdef CLANLIB_0_6
   if (static_cast<unsigned int> (id) >= CL_Input::joysticks.size())
     PingusError::raise("JoystickAxis: Invalid joystick id");
 
@@ -40,6 +41,7 @@
     angle = (static_cast<int>(angle) % 360) + 360;
   else if (angle > 360)
     angle = static_cast<int>(angle) % 360;
+#endif
 }
 
 const float&

Index: multiple_axis.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/axes/multiple_axis.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- multiple_axis.cxx   19 Apr 2003 10:23:19 -0000      1.2
+++ multiple_axis.cxx   20 Oct 2003 19:28:55 -0000      1.3
@@ -19,50 +19,51 @@
 
 #include "multiple_axis.hxx"
 
+namespace Pingus {
 namespace Input {
+namespace Axes {
 
-  namespace Axes {
-
-    MultipleAxis::MultipleAxis (const std::vector<Axis*>& axes_) : axes(axes_),
-                                                                   pos(0), 
angle(0)
-    {
-    }
+MultipleAxis::MultipleAxis (const std::vector<Axis*>& axes_) : axes(axes_),
+                                                               pos(0), angle(0)
+{
+}
 
-    MultipleAxis::~MultipleAxis ()
-    {
-      for (std::vector<Axis*>::const_iterator it = axes.begin(); it != 
axes.end(); it++)
-        delete *it;
-    }
+MultipleAxis::~MultipleAxis ()
+{
+  for (std::vector<Axis*>::const_iterator it = axes.begin(); it != axes.end(); 
it++)
+    delete *it;
+}
 
-    const float&
-    MultipleAxis::get_pos () const
-    {
-      return pos;
-    }
+const float&
+MultipleAxis::get_pos () const
+{
+  return pos;
+}
 
-    const float&
-    MultipleAxis::get_angle () const
-    {
-      return angle;
-    }
+const float&
+MultipleAxis::get_angle () const
+{
+  return angle;
+}
 
-    void
-    MultipleAxis::update (float delta)
+void
+MultipleAxis::update (float delta)
+{
+  for (std::vector<Axis*>::const_iterator it = axes.begin(); it != axes.end(); 
it++)
     {
-      for (std::vector<Axis*>::const_iterator it = axes.begin(); it != 
axes.end(); it++)
+      (*it)->update(delta);
+      const float & temp = (*it)->get_pos();
+      if (temp)
         {
-          (*it)->update(delta);
-          const float & temp = (*it)->get_pos();
-          if (temp)
-            {
-             pos   = temp;
-             angle = (*it)->get_angle();
-           }
-
+          pos   = temp;
+          angle = (*it)->get_angle();
         }
-    }
 
-  }
+    }
 }
 
+} // namespace Axes
+} // namespace Input
+} // namespace Pingus
+
 /* EOF */

Index: multiple_axis.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/axes/multiple_axis.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- multiple_axis.hxx   19 Apr 2003 10:23:19 -0000      1.4
+++ multiple_axis.hxx   20 Oct 2003 19:28:55 -0000      1.5
@@ -23,42 +23,43 @@
 #include <vector>
 #include "../axis.hxx"
 
+namespace Pingus {
 namespace Input {
+namespace Axes {
 
-  namespace Axes {
-
-    /**
-      @brief wrapper class, mapping multiple axes to one
+/**
+   @brief wrapper class, mapping multiple axes to one
 
-      XML definition: <multiple-axis> <axis 1>...<axis n></multiple-axis>
-      <br><br>
-      angle and pos returned by this class will be the values returned by the 
first class
-      yielding a pos that is not null or of the first axis if none is found
-      */
-    class MultipleAxis : public Axis {
+   XML definition: <multiple-axis> <axis 1>...<axis n></multiple-axis>
+   <br><br>
+   angle and pos returned by this class will be the values returned by the 
first class
+   yielding a pos that is not null or of the first axis if none is found
+*/
+class MultipleAxis : public Axis {
 
-    private:
-      std::vector<Axis*> axes;
-      float              pos;
-      float              angle;
+private:
+  std::vector<Axis*> axes;
+  float              pos;
+  float              angle;
 
-    public:
+public:
 
-      MultipleAxis (const std::vector<Axis*>& axes_);
-     ~MultipleAxis ();
+  MultipleAxis (const std::vector<Axis*>& axes_);
+  ~MultipleAxis ();
 
-      virtual const float& get_pos   () const;
-      virtual const float& get_angle () const;
+  virtual const float& get_pos   () const;
+  virtual const float& get_angle () const;
 
-      virtual void  update (float delta);
+  virtual void  update (float delta);
 
-    private:
-      MultipleAxis (const MultipleAxis&);
-      MultipleAxis& operator= (const MultipleAxis&);
-    };
+private:
+  MultipleAxis (const MultipleAxis&);
+  MultipleAxis& operator= (const MultipleAxis&);
+};
 
-  }
-}
+} // namespace Axes
+} // namespace Input
+} // namespace Pingus
 
 #endif
 





reply via email to

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