[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/input button_axis.cxx,1.5,1.6 control
From: |
torangan |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/input button_axis.cxx,1.5,1.6 controller.cxx,1.9,1.10 joystick_axis.cxx,1.5,1.6 mouse_axis.cxx,1.3,1.4 |
Date: |
15 Aug 2002 10:57:18 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src/input
In directory dark:/tmp/cvs-serv22936
Modified Files:
button_axis.cxx controller.cxx joystick_axis.cxx
mouse_axis.cxx
Log Message:
- fixed a bug
- initialized some members to usefull defaults
Index: button_axis.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/button_axis.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- button_axis.cxx 14 Aug 2002 12:41:22 -0000 1.5
+++ button_axis.cxx 15 Aug 2002 10:57:15 -0000 1.6
@@ -23,7 +23,7 @@
namespace Input
{
ButtonAxis::ButtonAxis (float angle_, Button* button1_, Button* button2_) :
- angle(angle_), button1(button1_), button2(button2_)
+ pos(0), angle(angle_), button1(button1_),
button2(button2_)
{
if (angle < 0)
angle = (static_cast<int>(angle) % 360) + 360;
@@ -56,7 +56,10 @@
button2->update(delta);
if (button1->is_pressed() == button2->is_pressed())
- pos = 0.0f;
+ {
+ pos = 0;
+ return;
+ }
if (button1->is_pressed())
pos = -1.0f;
Index: controller.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/controller.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- controller.cxx 14 Aug 2002 12:41:22 -0000 1.9
+++ controller.cxx 15 Aug 2002 10:57:15 -0000 1.10
@@ -189,9 +189,8 @@
if (action_axis->get_pos())
if (action_axis->get_pos() > 0)
events.push_back(new AxisEvent(up));
- else
+ else
events.push_back(new AxisEvent(down));
-
}
}
Index: joystick_axis.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/joystick_axis.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- joystick_axis.cxx 14 Aug 2002 12:41:22 -0000 1.5
+++ joystick_axis.cxx 15 Aug 2002 10:57:16 -0000 1.6
@@ -25,7 +25,7 @@
namespace Input
{
- JoystickAxis::JoystickAxis(int id_, int axis_, float angle_) : id(id_),
axis(axis_), angle(angle_)
+ JoystickAxis::JoystickAxis(int id_, int axis_, float angle_) : id(id_),
axis(axis_), pos(0), angle(angle_)
{
if (static_cast<unsigned int> (id) >= CL_Input::joysticks.size())
throw PingusError("JoystickAxis: Invalid joystick id");
Index: mouse_axis.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/mouse_axis.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- mouse_axis.cxx 14 Aug 2002 12:41:22 -0000 1.3
+++ mouse_axis.cxx 15 Aug 2002 10:57:16 -0000 1.4
@@ -24,7 +24,7 @@
namespace Input
{
- MouseAxis::MouseAxis(int axis_, float angle_) : axis(axis_), angle(angle_),
pos(0)
+ MouseAxis::MouseAxis(int axis_, float angle_) : axis(axis_), angle(angle_),
pos(0), old_pos(0)
{
if (angle < 0)
angle = (static_cast<int>(angle) % 360) + 360;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/input button_axis.cxx,1.5,1.6 controller.cxx,1.9,1.10 joystick_axis.cxx,1.5,1.6 mouse_axis.cxx,1.3,1.4,
torangan <=