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 axis_factory.hxx,1.1,1.2 axis_p


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src/input axis_factory.hxx,1.1,1.2 axis_pointer.cxx,1.3,1.4 axis_pointer.hxx,1.3,1.4 button_axis.hxx,1.1,1.2 button_factory.cxx,1.1,1.2 button_factory.hxx,1.1,1.2 inverted_axis.hxx,1.2,1.3 joystick_axis.hxx,1.2,1.3 joystick_button.hxx,1.1,1.2 key_button.hxx,1.1,1.2 mouse_axis.hxx,1.1,1.2 mouse_button.hxx,1.1,1.2 mouse_pointer.hxx,1.2,1.3 multiple_button.hxx,1.2,1.3 multiple_pointer.cxx,1.1,1.2 multiple_pointer.hxx,1.1,1.2
Date: 9 Jul 2002 17:00:12 -0000

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

Modified Files:
        axis_factory.hxx axis_pointer.cxx axis_pointer.hxx 
        button_axis.hxx button_factory.cxx button_factory.hxx 
        inverted_axis.hxx joystick_axis.hxx joystick_button.hxx 
        key_button.hxx mouse_axis.hxx mouse_button.hxx 
        mouse_pointer.hxx multiple_button.hxx multiple_pointer.cxx 
        multiple_pointer.hxx 
Log Message:
minor bugfixes / clean up


Index: axis_factory.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/axis_factory.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- axis_factory.hxx    9 Jul 2002 16:03:32 -0000       1.1
+++ axis_factory.hxx    9 Jul 2002 17:00:10 -0000       1.2
@@ -17,14 +17,14 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-#ifndef HEADER_PINGUS_INPUT_POINTER_FACTORY_HXX
-#define HEADER_PINGUS_INPUT_POINTER_FACTORY_HXX
+#ifndef HEADER_PINGUS_INPUT_AXIS_FACTORY_HXX
+#define HEADER_PINGUS_INPUT_AXIS_FACTORY_HXX
 
 #include "../libxmlfwd.hxx"
 
-class Axis;
-
 namespace Input {
+
+  class Axis;
 
   class AxisFactory 
   {

Index: axis_pointer.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/axis_pointer.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- axis_pointer.cxx    8 Jul 2002 14:52:04 -0000       1.3
+++ axis_pointer.cxx    9 Jul 2002 17:00:10 -0000       1.4
@@ -23,14 +23,7 @@
 
 namespace Input
 {
-  AxisPointer::AxisPointer(float speed_, Axis* axis1, Axis* axis2) : 
speed(speed_), axes(2)
-  {
-    assert(axis1 && axis2);
-    axes[0] = axis1;
-    axes[1] = axis2;
-  }
-
-  AxisPointer::AxisPointer(float speed_, std::vector<Axis*> axes_) : 
speed(speed_), axes(axes_)
+  AxisPointer::AxisPointer(float speed_, const std::vector<Axis*>& axes_) : 
speed(speed_), axes(axes_)
   {
     assert(axes.size() >= 2);
   }

Index: axis_pointer.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/axis_pointer.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- axis_pointer.hxx    8 Jul 2002 14:52:04 -0000       1.3
+++ axis_pointer.hxx    9 Jul 2002 17:00:10 -0000       1.4
@@ -23,11 +23,12 @@
 #include <vector>
 #include "pointer.hxx"
 
-class Axis;
 
-namespace Input
-{
-  class AxisPointer : Pointer {
+namespace Input {
+
+  class Axis;
+
+  class AxisPointer : public Pointer {
   
     private:
 
@@ -39,8 +40,7 @@
       
     public:
 
-      AxisPointer(float speed, Axis* axis1, Axis* axis2);
-      AxisPointer(float speed, std::vector<Axis*> axes_);
+      AxisPointer(float speed, const std::vector<Axis*>& axes_);
 
       virtual float get_x_pos ();
       virtual float get_y_pos ();

Index: button_axis.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/button_axis.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- button_axis.hxx     4 Jul 2002 13:11:57 -0000       1.1
+++ button_axis.hxx     9 Jul 2002 17:00:10 -0000       1.2
@@ -22,11 +22,12 @@
 
 #include "axis.hxx"
 
-class Button;
 
-namespace Input
-{
-  class ButtonAxis : Axis {
+namespace Input {
+
+  class Button;
+
+  class ButtonAxis : public Axis {
 
   private:
     float   pos;

Index: button_factory.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/button_factory.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- button_factory.cxx  9 Jul 2002 15:26:55 -0000       1.1
+++ button_factory.cxx  9 Jul 2002 17:00:10 -0000       1.2
@@ -31,8 +31,6 @@
 
   Button* ButtonFactory::create(xmlNodePtr cur)
   {
-    cur = cur->children;
-    
     if (xmlIsBlankNode(cur)) 
       cur = cur->next;
 

Index: button_factory.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/button_factory.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- button_factory.hxx  9 Jul 2002 15:26:55 -0000       1.1
+++ button_factory.hxx  9 Jul 2002 17:00:10 -0000       1.2
@@ -22,9 +22,9 @@
 
 #include "../libxmlfwd.hxx"
 
-class Button;
-
 namespace Input {
+
+  class Button;
 
   class ButtonFactory 
   {

Index: inverted_axis.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/inverted_axis.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- inverted_axis.hxx   5 Jul 2002 10:06:20 -0000       1.2
+++ inverted_axis.hxx   9 Jul 2002 17:00:10 -0000       1.3
@@ -24,7 +24,7 @@
 
 namespace Input
 {
-  class InvertedAxis : Axis {
+  class InvertedAxis : public Axis {
 
   private:
     Axis* axis;

Index: joystick_axis.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/joystick_axis.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- joystick_axis.hxx   8 Jul 2002 14:49:08 -0000       1.2
+++ joystick_axis.hxx   9 Jul 2002 17:00:10 -0000       1.3
@@ -24,7 +24,7 @@
 
 namespace Input
 {
-  class JoystickAxis : Axis {
+  class JoystickAxis : public Axis {
 
   private:
     int     id;

Index: joystick_button.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/joystick_button.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- joystick_button.hxx 4 Jul 2002 12:03:47 -0000       1.1
+++ joystick_button.hxx 9 Jul 2002 17:00:10 -0000       1.2
@@ -24,7 +24,7 @@
 
 namespace Input {
 
-  class JoystickButton : Button {
+  class JoystickButton : public Button {
   
     private:
       int id;

Index: key_button.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/key_button.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- key_button.hxx      4 Jul 2002 11:32:18 -0000       1.1
+++ key_button.hxx      9 Jul 2002 17:00:10 -0000       1.2
@@ -24,7 +24,7 @@
 
 namespace Input {
 
-  class KeyButton : Button {
+  class KeyButton : public Button {
   
     private:
       int button;

Index: mouse_axis.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/mouse_axis.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- mouse_axis.hxx      8 Jul 2002 14:47:35 -0000       1.1
+++ mouse_axis.hxx      9 Jul 2002 17:00:10 -0000       1.2
@@ -24,7 +24,7 @@
 
 namespace Input
 {
-  class MouseAxis : Axis {
+  class MouseAxis : public Axis {
 
   private:
     int     axis;

Index: mouse_button.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/mouse_button.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- mouse_button.hxx    4 Jul 2002 11:54:57 -0000       1.1
+++ mouse_button.hxx    9 Jul 2002 17:00:10 -0000       1.2
@@ -24,7 +24,7 @@
 
 namespace Input {
 
-  class MouseButton : Button {
+  class MouseButton : public Button {
   
     private:
       int button;

Index: mouse_pointer.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/mouse_pointer.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mouse_pointer.hxx   5 Jul 2002 11:02:47 -0000       1.2
+++ mouse_pointer.hxx   9 Jul 2002 17:00:10 -0000       1.3
@@ -24,7 +24,7 @@
 
 namespace Input
 {
-  class MousePointer : Pointer {
+  class MousePointer : public Pointer {
 
     private:
       //float x_angle;

Index: multiple_button.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/multiple_button.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- multiple_button.hxx 9 Jul 2002 15:03:20 -0000       1.2
+++ multiple_button.hxx 9 Jul 2002 17:00:10 -0000       1.3
@@ -25,7 +25,7 @@
 
 namespace Input {
 
-  class MultipleButton : Button {
+  class MultipleButton : public Button {
   
     private:
       std::vector<Button*> buttons;

Index: multiple_pointer.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/multiple_pointer.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- multiple_pointer.cxx        5 Jul 2002 11:02:28 -0000       1.1
+++ multiple_pointer.cxx        9 Jul 2002 17:00:10 -0000       1.2
@@ -21,7 +21,7 @@
 
 namespace Input
 {
-  MultiplePointer::MultiplePointer(std::vector<Pointer*> pointers_) : 
+  MultiplePointer::MultiplePointer(const std::vector<Pointer*>& pointers_) : 
                                    pointers(pointers_), 
x_pos_list(pointers.size()), y_pos_list(pointers.size())
   {
   }
@@ -37,6 +37,13 @@
   {
     return y_pos;
   }
+
+  void
+  MultiplePointer::set_pos (float x_pos, float y_pos)
+  {
+    for (unsigned int i = 0; i < pointers.size(); i++)
+      pointers[i]->set_pos(x_pos, y_pos);
+  }    
 
   void
   MultiplePointer::update(float delta)

Index: multiple_pointer.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/multiple_pointer.hxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- multiple_pointer.hxx        5 Jul 2002 11:02:28 -0000       1.1
+++ multiple_pointer.hxx        9 Jul 2002 17:00:10 -0000       1.2
@@ -25,23 +25,26 @@
 
 namespace Input
 {
-  class MultiplePointer : Pointer
-  {
-  private:
-    std::vector<Pointer*> pointers;
-    std::vector<float> x_pos_list;
-    std::vector<float> y_pos_list;
+  class MultiplePointer : public Pointer {
+  
+    private:
+      std::vector<Pointer*> pointers;
+      std::vector<float> x_pos_list;
+      std::vector<float> y_pos_list;
 
-    float x_pos;
-    float y_pos;
+      float x_pos;
+      float y_pos;
 
-  public:
+    public:
 
-    MultiplePointer (std::vector<Pointer*> pointers_);
+      MultiplePointer (const std::vector<Pointer*>& pointers_);
     
-    virtual float get_x_pos ();
-    virtual float get_y_pos ();
-    virtual void  update (float delta);
+      virtual float get_x_pos ();
+      virtual float get_y_pos ();
+    
+      virtual void  set_pos (float x_pos, float y_pos);
+    
+      virtual void  update (float delta);
   };
 }
 




reply via email to

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