[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/input/axes button_axis.cxx,1.3,1.4 bu
From: |
torangan |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/input/axes button_axis.cxx,1.3,1.4 button_axis.hxx,1.3,1.4 |
Date: |
29 Oct 2002 17:47:18 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src/input/axes
In directory dark:/tmp/cvs-serv15528/src/input/axes
Modified Files:
button_axis.cxx button_axis.hxx
Log Message:
- replaced ActionAxis with two buttons
- added a delay of one second before a ButtonAxis will reach maximum value
Index: button_axis.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/axes/button_axis.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- button_axis.cxx 14 Oct 2002 11:15:15 -0000 1.3
+++ button_axis.cxx 29 Oct 2002 17:47:15 -0000 1.4
@@ -19,6 +19,7 @@
#include "button_axis.hxx"
#include "../button.hxx"
+#include "../../debug.hxx"
namespace Input {
@@ -62,12 +63,19 @@
pos = 0;
return;
}
-
- if (button1->is_pressed())
+
+ if (button1->is_pressed() && pos > -1.0f)
+ pos -= delta;
+ else if (pos < 1.0f)
+ pos += delta;
+
+ if (pos < -1.0f)
pos = -1.0f;
- else
+ else if (pos > 1.0f)
pos = 1.0f;
-
+
+ if (pos)
+ pwarn << "Pos: " << pos << std::endl;
}
}
Index: button_axis.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/input/axes/button_axis.hxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- button_axis.hxx 27 Sep 2002 11:26:47 -0000 1.3
+++ button_axis.hxx 29 Oct 2002 17:47:15 -0000 1.4
@@ -36,9 +36,9 @@
class ButtonAxis : public Axis {
private:
- float pos;
- float angle;
-
+ float pos;
+ float angle;
+
Button* const button1;
Button* const button2;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/input/axes button_axis.cxx,1.3,1.4 button_axis.hxx,1.3,1.4,
torangan <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/data/controller default.xml,1.7,1.8
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src/input axis_factory.cxx,1.12,1.13 button_event.hxx,1.4,1.5 controller.cxx,1.23,1.24 controller.hxx,1.14,1.15
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/data/controller default.xml,1.7,1.8
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src/input axis_factory.cxx,1.12,1.13 button_event.hxx,1.4,1.5 controller.cxx,1.23,1.24 controller.hxx,1.14,1.15
- Index(es):