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/scrollers axis_scroller.cxx, 1.


From: Ingo Ruhnke
Subject: [Pingus-CVS] CVS: Games/Pingus/src/input/scrollers axis_scroller.cxx, 1.5, 1.6 axis_scroller.hxx, 1.4, 1.5 dummy_scroller.hxx, 1.4, 1.5 inverted_scroller.cxx, 1.2, 1.3 inverted_scroller.hxx, 1.4, 1.5 joystick_scroller.cxx, 1.3, 1.4 joystick_scroller.hxx, 1.4, 1.5 mouse_scroller.cxx, 1.3, 1.4 mouse_scroller.hxx, 1.4, 1.5 multiple_scroller.cxx, 1.2, 1.3 multiple_scroller.hxx, 1.4, 1.5
Date: Mon, 20 Oct 2003 21:28:57 +0200

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

Modified Files:
        axis_scroller.cxx axis_scroller.hxx dummy_scroller.hxx 
        inverted_scroller.cxx inverted_scroller.hxx 
        joystick_scroller.cxx joystick_scroller.hxx mouse_scroller.cxx 
        mouse_scroller.hxx multiple_scroller.cxx multiple_scroller.hxx 
Log Message:
misc stuff

Index: axis_scroller.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/scrollers/axis_scroller.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- axis_scroller.cxx   19 Apr 2003 10:23:19 -0000      1.5
+++ axis_scroller.cxx   20 Oct 2003 19:28:55 -0000      1.6
@@ -23,63 +23,64 @@
 #include "../axis.hxx"
 #include "axis_scroller.hxx"
 
+namespace Pingus {
 namespace Input {
+namespace Scrollers {
 
-  namespace Scrollers {
+AxisScroller::AxisScroller (const std::vector<Axis*>& axes_, float speed_)
+  : axes(axes_),
+    speed(speed_),
+    x_delta(0),
+    y_delta(0)
+{
+  assert(axes.size() > 1);
+  assert(axes[0]->get_angle() != axes[1]->get_angle());
+}
 
-    AxisScroller::AxisScroller (const std::vector<Axis*>& axes_, float speed_)
-                              : axes(axes_),
-                               speed(speed_),
-                               x_delta(0),
-                               y_delta(0)
-    {
-      assert(axes.size() > 1);
-      assert(axes[0]->get_angle() != axes[1]->get_angle());
-    }
+AxisScroller::~AxisScroller ()
+{
+  for (unsigned int i=0; i < axes.size(); ++i)
+    delete axes[i];
+}
 
-    AxisScroller::~AxisScroller ()
-    {
-      for (unsigned int i=0; i < axes.size(); ++i)
-        delete axes[i];
-    }
+const float&
+AxisScroller::get_x_delta () const
+{
+  return x_delta;
+}
 
-    const float&
-    AxisScroller::get_x_delta () const
-    {
-      return x_delta;
-    }
+const float&
+AxisScroller::get_y_delta () const
+{
+  return y_delta;
+}
 
-    const float&
-    AxisScroller::get_y_delta () const
-    {
-      return y_delta;
-    }
+void
+AxisScroller::get_delta (float& x, float& y) const
+{
+  x = x_delta;
+  y = y_delta;
+}
 
-    void
-    AxisScroller::get_delta (float& x, float& y) const
-    {
-      x = x_delta;
-      y = y_delta;
-    }
+void
+AxisScroller::update (float delta)
+{
+  x_delta = 0;
+  y_delta = 0;
 
-    void
-    AxisScroller::update (float delta)
+  for (std::vector<Axis*>::const_iterator it = axes.begin(); it != axes.end(); 
it++)
     {
-      x_delta = 0;
-      y_delta = 0;
-
-      for (std::vector<Axis*>::const_iterator it = axes.begin(); it != 
axes.end(); it++)
-        {
-          (*it)->update(delta);
-
-          x_delta += cos((*it)->get_angle() * 3.14159265 / 180) * speed * 
delta * (*it)->get_pos();
-          y_delta += sin((*it)->get_angle() * 3.14159265 / 180) * speed * 
delta * (*it)->get_pos();
-        }
+      (*it)->update(delta);
 
+      x_delta += cos((*it)->get_angle() * 3.14159265 / 180) * speed * delta * 
(*it)->get_pos();
+      y_delta += sin((*it)->get_angle() * 3.14159265 / 180) * speed * delta * 
(*it)->get_pos();
     }
 
-  }
 }
 
+} // namespace Scrollers
+} // namespace Input
+} // namespace Pingus
+
 /* EOF */
 

Index: axis_scroller.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/scrollers/axis_scroller.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- axis_scroller.hxx   19 Apr 2003 10:23:19 -0000      1.4
+++ axis_scroller.hxx   20 Oct 2003 19:28:55 -0000      1.5
@@ -23,46 +23,48 @@
 #include <vector>
 #include "../scroller.hxx"
 
+namespace Pingus {
 namespace Input {
 
-  class Axis;
+class Axis;
 
-  namespace Scrollers {
+namespace Scrollers {
 
-    /**
-      @brief create a Scroller out of two or more axes
+/**
+   @brief create a Scroller out of two or more axes
 
-      XML definition: <axis-scroller speed="?"> <axis 1>...<axis N> 
</axis-scroller>
+   XML definition: <axis-scroller speed="?"> <axis 1>...<axis N> 
</axis-scroller>
 
-      This class requires at least two axes whereby it's enforced that the 
first
-      two have different angles.
-      */
-    class AxisScroller : public Scroller {
-      private:
-        const std::vector<Axis*> axes;
+   This class requires at least two axes whereby it's enforced that the first
+   two have different angles.
+*/
+class AxisScroller : public Scroller {
+private:
+  const std::vector<Axis*> axes;
 
-        const float speed;
-              float x_delta;
-              float y_delta;
+  const float speed;
+  float x_delta;
+  float y_delta;
 
-      public:
-        AxisScroller (const std::vector<Axis*>& axes_, float speed_);
-       ~AxisScroller ();
+public:
+  AxisScroller (const std::vector<Axis*>& axes_, float speed_);
+  ~AxisScroller ();
 
-        const float& get_x_delta () const;
-        const float& get_y_delta () const;
+  const float& get_x_delta () const;
+  const float& get_y_delta () const;
 
-        void  get_delta (float& x, float& y) const;
+  void  get_delta (float& x, float& y) const;
 
-        void  update (float delta);
+  void  update (float delta);
 
-      private:
-        AxisScroller (const AxisScroller&);
-        AxisScroller& operator= (const AxisScroller&);
-    };
+private:
+  AxisScroller (const AxisScroller&);
+  AxisScroller& operator= (const AxisScroller&);
+};
 
-  }
-}
+} // namespace Scroller
+} // namespace Input
+} // namespace Pingus
 
 #endif
 

Index: dummy_scroller.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/scrollers/dummy_scroller.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- dummy_scroller.hxx  19 Apr 2003 10:23:19 -0000      1.4
+++ dummy_scroller.hxx  20 Oct 2003 19:28:55 -0000      1.5
@@ -22,37 +22,38 @@
 
 #include "../scroller.hxx"
 
+namespace Pingus {
 namespace Input {
+namespace Scrollers {
 
-  namespace Scrollers {
-
-    /**
-      @brief dummy class to be used if an Scroller is required but none defined
+/**
+   @brief dummy class to be used if an Scroller is required but none defined
 
-      XML definition: none
-     */
-    class DummyScroller : public Scroller {
-      private:
-        const float delta;
+   XML definition: none
+*/
+class DummyScroller : public Scroller {
+private:
+  const float delta;
 
-      public:
+public:
 
-        DummyScroller () : delta(0) { }
+  DummyScroller () : delta(0) { }
 
-        const float& get_x_delta () const { return delta; }
-        const float& get_y_delta () const { return delta; }
+  const float& get_x_delta () const { return delta; }
+  const float& get_y_delta () const { return delta; }
 
-        void  get_delta (float& x_delta, float& y_delta) const { x_delta = 
delta; y_delta = delta; }
+  void  get_delta (float& x_delta, float& y_delta) const { x_delta = delta; 
y_delta = delta; }
 
-        void  update (float) { }
+  void  update (float) { }
 
-      private:
-        DummyScroller (const DummyScroller&);
-        DummyScroller& operator= (const DummyScroller&);
-    };
+private:
+  DummyScroller (const DummyScroller&);
+  DummyScroller& operator= (const DummyScroller&);
+};
 
-  }
-}
+} // namespace Scrollers
+} // namespace Input
+} // namespace Pingus
 
 #endif
 

Index: inverted_scroller.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/scrollers/inverted_scroller.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- inverted_scroller.cxx       19 Apr 2003 10:23:19 -0000      1.2
+++ inverted_scroller.cxx       20 Oct 2003 19:28:55 -0000      1.3
@@ -19,51 +19,52 @@
 
 #include "inverted_scroller.hxx"
 
+namespace Pingus {
 namespace Input {
+namespace Scrollers {
 
-  namespace Scrollers {
-
-    InvertedScroller::InvertedScroller (Scroller* scroller_, bool invert_x_, 
bool invert_y_)
-                                      : scroller(scroller_),
-                                       invert_x(invert_x_),
-                                       invert_y(invert_y_)
-    {
-    }
-
-    InvertedScroller::~InvertedScroller ()
-    {
-      delete scroller;
-    }
+InvertedScroller::InvertedScroller (Scroller* scroller_, bool invert_x_, bool 
invert_y_)
+  : scroller(scroller_),
+    invert_x(invert_x_),
+    invert_y(invert_y_)
+{
+}
 
-    const float&
-    InvertedScroller::get_x_delta () const
-    {
-      return x_pos;
-    }
+InvertedScroller::~InvertedScroller ()
+{
+  delete scroller;
+}
 
-    const float&
-    InvertedScroller::get_y_delta () const
-    {
-      return y_pos;
-    }
+const float&
+InvertedScroller::get_x_delta () const
+{
+  return x_pos;
+}
 
-    void
-    InvertedScroller::get_delta (float& x, float& y) const
-    {
-      x = x_pos;
-      y = y_pos;
-    }
+const float&
+InvertedScroller::get_y_delta () const
+{
+  return y_pos;
+}
 
-    void
-    InvertedScroller::update (float delta)
-    {
-      scroller->update(delta);
+void
+InvertedScroller::get_delta (float& x, float& y) const
+{
+  x = x_pos;
+  y = y_pos;
+}
 
-      (invert_x) ? x_pos = -(scroller->get_x_delta()) : x_pos = 
scroller->get_x_delta();
-      (invert_y) ? y_pos = -(scroller->get_y_delta()) : x_pos = 
scroller->get_y_delta();
-    }
+void
+InvertedScroller::update (float delta)
+{
+  scroller->update(delta);
 
-  }
+  (invert_x) ? x_pos = -(scroller->get_x_delta()) : x_pos = 
scroller->get_x_delta();
+  (invert_y) ? y_pos = -(scroller->get_y_delta()) : x_pos = 
scroller->get_y_delta();
 }
 
+} // namespace Scroller
+} // namespace Input
+} // namespace Pingus
+
 /* EOF */

Index: inverted_scroller.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/scrollers/inverted_scroller.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- inverted_scroller.hxx       19 Apr 2003 10:23:19 -0000      1.4
+++ inverted_scroller.hxx       20 Oct 2003 19:28:55 -0000      1.5
@@ -22,45 +22,46 @@
 
 #include "../scroller.hxx"
 
+namespace Pingus {
 namespace Input {
+namespace Scrollers {
 
-  namespace Scrollers {
-
-    /**
-      @brief inverts the results of the contained scroller
+/**
+   @brief inverts the results of the contained scroller
 
-      XML definition: <inverted-scroller invert-x="0/1" invert-y="0/1" 
speed="?"> <scroller> </inverted-scroller>
+   XML definition: <inverted-scroller invert-x="0/1" invert-y="0/1" speed="?"> 
<scroller> </inverted-scroller>
 
-      Wheter the X and/or the Y axis shall be inverted must be specified 
explizitly.
-      */
-    class InvertedScroller : public Scroller {
-      private:
-        Scroller* const scroller;
+   Wheter the X and/or the Y axis shall be inverted must be specified 
explizitly.
+*/
+class InvertedScroller : public Scroller {
+private:
+  Scroller* const scroller;
 
-        const bool invert_x;
-        const bool invert_y;
+  const bool invert_x;
+  const bool invert_y;
 
-        float x_pos;
-        float y_pos;
+  float x_pos;
+  float y_pos;
 
-      public:
-        InvertedScroller (Scroller* scroller_, bool invert_x_, bool invert_y_);
-       ~InvertedScroller ();
+public:
+  InvertedScroller (Scroller* scroller_, bool invert_x_, bool invert_y_);
+  ~InvertedScroller ();
 
-        const float& get_x_delta () const;
-        const float& get_y_delta () const;
+  const float& get_x_delta () const;
+  const float& get_y_delta () const;
 
-        void  get_delta (float& x, float& y) const;
+  void  get_delta (float& x, float& y) const;
 
-        void  update (float delta);
+  void  update (float delta);
 
-      private:
-        InvertedScroller (const InvertedScroller&);
-        InvertedScroller& operator= (const InvertedScroller&);
-    };
+private:
+  InvertedScroller (const InvertedScroller&);
+  InvertedScroller& operator= (const InvertedScroller&);
+};
 
-  }
-}
+} // namespace Scroller
+} // namespace Input
+} // namespace Pingus
 
 #endif
 

Index: joystick_scroller.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/scrollers/joystick_scroller.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- joystick_scroller.cxx       19 Apr 2003 10:23:19 -0000      1.3
+++ joystick_scroller.cxx       20 Oct 2003 19:28:55 -0000      1.4
@@ -20,56 +20,57 @@
 #include "../axes/joystick_axis.hxx"
 #include "joystick_scroller.hxx"
 
+namespace Pingus {
 namespace Input {
+namespace Scrollers {
 
-  namespace Scrollers {
-
-    JoystickScroller::JoystickScroller (int id_, float speed_)
-                                      : id(id_),
-                                       axis1(new Axes::JoystickAxis(id, 0, 0)),
-                                       axis2(new Axes::JoystickAxis(id, 1, 
90)),
-                                       speed(speed_),
-                                       x_delta(0),
-                                       y_delta(0)
-    {
-    }
-
-    JoystickScroller::~JoystickScroller ()
-    {
-      delete axis1;
-      delete axis2;
-    }
+JoystickScroller::JoystickScroller (int id_, float speed_)
+  : id(id_),
+    axis1(new Axes::JoystickAxis(id, 0, 0)),
+    axis2(new Axes::JoystickAxis(id, 1, 90)),
+    speed(speed_),
+    x_delta(0),
+    y_delta(0)
+{
+}
 
-    const float&
-    JoystickScroller::get_x_delta () const
-    {
-      return x_delta;
-    }
+JoystickScroller::~JoystickScroller ()
+{
+  delete axis1;
+  delete axis2;
+}
 
-    const float&
-    JoystickScroller::get_y_delta () const
-    {
-      return y_delta;
-    }
+const float&
+JoystickScroller::get_x_delta () const
+{
+  return x_delta;
+}
 
-    void
-    JoystickScroller::get_delta (float& x, float& y) const
-    {
-      x = x_delta;
-      y = y_delta;
-    }
+const float&
+JoystickScroller::get_y_delta () const
+{
+  return y_delta;
+}
 
-    void
-    JoystickScroller::update (float delta)
-    {
-      axis1->update(delta);
-      axis2->update(delta);
+void
+JoystickScroller::get_delta (float& x, float& y) const
+{
+  x = x_delta;
+  y = y_delta;
+}
 
-      x_delta = axis1->get_pos() * speed;
-      y_delta = axis2->get_pos() * speed;
-    }
+void
+JoystickScroller::update (float delta)
+{
+  axis1->update(delta);
+  axis2->update(delta);
 
-  }
+  x_delta = axis1->get_pos() * speed;
+  y_delta = axis2->get_pos() * speed;
 }
 
+} // namespace Scroller
+} // namespace Input
+} // namespace Pingus
+
 /* EOF */

Index: joystick_scroller.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/scrollers/joystick_scroller.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- joystick_scroller.hxx       19 Apr 2003 10:23:19 -0000      1.4
+++ joystick_scroller.hxx       20 Oct 2003 19:28:55 -0000      1.5
@@ -22,47 +22,49 @@
 
 #include "../scroller.hxx"
 
+namespace Pingus {
 namespace Input {
 
-  class Axis;
+class Axis;
 
-  namespace Scrollers {
+namespace Scrollers {
 
-    /**
-      @brief maps the first two axes of a joystick into a Scroller
+/**
+   @brief maps the first two axes of a joystick into a Scroller
 
-      XML definition: <joystick-scroller id="joystick id" speed="?"/>
-      */
-    class JoystickScroller : public Scroller {
-      private:
-        int id;
+   XML definition: <joystick-scroller id="joystick id" speed="?"/>
+*/
+class JoystickScroller : public Scroller {
+private:
+  int id;
 
-        Axis* const axis1;
-        Axis* const axis2;
+  Axis* const axis1;
+  Axis* const axis2;
 
-        const float speed;
+  const float speed;
 
-        float x_delta;
-        float y_delta;
+  float x_delta;
+  float y_delta;
 
-      public:
-        JoystickScroller (int id_, float speed_);
-       ~JoystickScroller ();
+public:
+  JoystickScroller (int id_, float speed_);
+  ~JoystickScroller ();
 
-        const float& get_x_delta () const;
-        const float& get_y_delta () const;
+  const float& get_x_delta () const;
+  const float& get_y_delta () const;
 
-        void  get_delta (float& x, float& y) const;
+  void  get_delta (float& x, float& y) const;
 
-        void  update (float delta);
+  void  update (float delta);
 
-      private:
-        JoystickScroller (const JoystickScroller&);
-        JoystickScroller& operator= (const JoystickScroller&);
-    };
+private:
+  JoystickScroller (const JoystickScroller&);
+  JoystickScroller& operator= (const JoystickScroller&);
+};
 
-  }
-}
+} // namespace Pointers
+} // namespace Input
+} // namespace Pingus
 
 #endif
 

Index: mouse_scroller.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/scrollers/mouse_scroller.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mouse_scroller.cxx  20 Oct 2003 13:33:44 -0000      1.3
+++ mouse_scroller.cxx  20 Oct 2003 19:28:55 -0000      1.4
@@ -20,6 +20,7 @@
 #include <ClanLib/Display/mouse.h>
 #include "mouse_scroller.hxx"
 
+namespace Pingus {
 namespace Input {
 namespace Scrollers {
 
@@ -56,8 +57,9 @@
   old_y = CL_Mouse::get_y();
 }
 
-}
-}
+} // namespace Scroller
+} // namespace Input
+} // namespace Pingus
 
 /* EOF */
 

Index: mouse_scroller.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/scrollers/mouse_scroller.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- mouse_scroller.hxx  19 Apr 2003 10:23:19 -0000      1.4
+++ mouse_scroller.hxx  20 Oct 2003 19:28:55 -0000      1.5
@@ -22,39 +22,40 @@
 
 #include "../scroller.hxx"
 
+namespace Pingus {
 namespace Input {
-
 namespace Scrollers {
 
 /**
-  @brief turns the mouse into a scroller
+   @brief turns the mouse into a scroller
 
-  XML definition: <mouse-scroller/>
-  */
+   XML definition: <mouse-scroller/>
+*/
 class MouseScroller : public Scroller {
-  private:
-    float old_x;
-    float old_y;
-    float x_delta;
-    float y_delta;
+private:
+  float old_x;
+  float old_y;
+  float x_delta;
+  float y_delta;
 
-  public:
-    MouseScroller ();
+public:
+  MouseScroller ();
 
-    const float& get_x_delta () const;
-    const float& get_y_delta () const;
+  const float& get_x_delta () const;
+  const float& get_y_delta () const;
 
-    void  get_delta (float& x, float& y) const;
+  void  get_delta (float& x, float& y) const;
 
-    void  update (float);
+  void  update (float);
 
-  private:
-    MouseScroller (const MouseScroller&);
-    MouseScroller& operator= (const MouseScroller&);
+private:
+  MouseScroller (const MouseScroller&);
+  MouseScroller& operator= (const MouseScroller&);
 };
 
 } // namespace Scrollers
 } // namespace Input
+} // namespace Pingus
 
 #endif
 

Index: multiple_scroller.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/scrollers/multiple_scroller.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- multiple_scroller.cxx       19 Apr 2003 10:23:19 -0000      1.2
+++ multiple_scroller.cxx       20 Oct 2003 19:28:55 -0000      1.3
@@ -17,58 +17,59 @@
 
 #include "multiple_scroller.hxx"
 
+namespace Pingus {
 namespace Input {
+namespace Scrollers {
 
-  namespace Scrollers {
+MultipleScroller::MultipleScroller (const std::vector<Scroller*>& scrollers_) 
: scrollers(scrollers_)
+{
+}
 
-    MultipleScroller::MultipleScroller (const std::vector<Scroller*>& 
scrollers_) : scrollers(scrollers_)
-    {
-    }
+MultipleScroller::~MultipleScroller ()
+{
+  for (std::vector<Scroller*>::const_iterator it = scrollers.begin(); it != 
scrollers.end(); it++)
+    delete *it;
+}
 
-    MultipleScroller::~MultipleScroller ()
-    {
-      for (std::vector<Scroller*>::const_iterator it = scrollers.begin(); it 
!= scrollers.end(); it++)
-        delete *it;
-    }
+const float&
+MultipleScroller::get_x_delta () const
+{
+  return x_pos;
+}
 
-    const float&
-    MultipleScroller::get_x_delta () const
-    {
-      return x_pos;
-    }
+const float&
+MultipleScroller::get_y_delta () const
+{
+  return y_pos;
+}
 
-    const float&
-    MultipleScroller::get_y_delta () const
-    {
-      return y_pos;
-    }
+void
+MultipleScroller::get_delta (float& x, float& y) const
+{
+  x = x_pos;
+  y = y_pos;
+}
 
-    void
-    MultipleScroller::get_delta (float& x, float& y) const
-    {
-      x = x_pos;
-      y = y_pos;
-    }
+void
+MultipleScroller::update (float delta)
+{
+  bool found_delta = false;
 
-    void
-    MultipleScroller::update (float delta)
+  for (std::vector<Scroller*>::const_iterator it = scrollers.begin(); it != 
scrollers.end(); it++)
     {
-      bool found_delta = false;
+      (*it)->update(delta);
 
-      for (std::vector<Scroller*>::const_iterator it = scrollers.begin(); it 
!= scrollers.end(); it++)
+      if (!found_delta && ((*it)->get_x_delta() || (*it)->get_y_delta()))
         {
-          (*it)->update(delta);
-
-         if (!found_delta && ((*it)->get_x_delta() || (*it)->get_y_delta()))
-           {
-             x_pos = (*it)->get_x_delta();
-             y_pos = (*it)->get_y_delta();
-             found_delta = true;
-           }
+          x_pos = (*it)->get_x_delta();
+          y_pos = (*it)->get_y_delta();
+          found_delta = true;
         }
     }
-
-  }
 }
 
+} // namespace Scroller
+} // namespace Input
+} // namespace Pingus
+
 /* EOF */

Index: multiple_scroller.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/scrollers/multiple_scroller.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- multiple_scroller.hxx       19 Apr 2003 10:23:19 -0000      1.4
+++ multiple_scroller.hxx       20 Oct 2003 19:28:55 -0000      1.5
@@ -23,40 +23,41 @@
 #include <vector>
 #include "../scroller.hxx"
 
+namespace Pingus {
 namespace Input {
+namespace Scrollers {
 
-  namespace Scrollers {
-
-    /**
-      @brief maps multiple Scrollers into one
+/**
+   @brief maps multiple Scrollers into one
 
-      XML definition: <multiple-scroller> <scroller 1>...<scroller N> 
</multiple-scroller>
-     */
-    class MultipleScroller : public Scroller {
-      private:
-        std::vector<Scroller*> scrollers;
+   XML definition: <multiple-scroller> <scroller 1>...<scroller N> 
</multiple-scroller>
+*/
+class MultipleScroller : public Scroller {
+private:
+  std::vector<Scroller*> scrollers;
 
-        float x_pos;
-        float y_pos;
+  float x_pos;
+  float y_pos;
 
-      public:
-        MultipleScroller (const std::vector<Scroller*>& scrollers_);
-       ~MultipleScroller ();
+public:
+  MultipleScroller (const std::vector<Scroller*>& scrollers_);
+  ~MultipleScroller ();
 
-        const float& get_x_delta () const;
-        const float& get_y_delta () const;
+  const float& get_x_delta () const;
+  const float& get_y_delta () const;
 
-        void  get_delta (float& x, float& y) const;
+  void  get_delta (float& x, float& y) const;
 
-        void  update (float delta);
+  void  update (float delta);
 
-      private:
-        MultipleScroller (const MultipleScroller&);
-        MultipleScroller& operator= (const MultipleScroller&);
-    };
+private:
+  MultipleScroller (const MultipleScroller&);
+  MultipleScroller& operator= (const MultipleScroller&);
+};
 
-  }
-}
+} // namespace Scroller
+} // namespace Input
+} // namespace Pingus
 
 #endif
 





reply via email to

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