[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/input/buttons joystick_button.cxx, 1.
From: |
Ingo Ruhnke |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/input/buttons joystick_button.cxx, 1.5, 1.6 mouse_button.cxx, 1.5, 1.6 |
Date: |
Sat, 13 Dec 2003 17:23:42 +0100 |
Update of /var/lib/cvs/Games/Pingus/src/input/buttons
In directory dark:/tmp/cvs-serv13851/src/input/buttons
Modified Files:
joystick_button.cxx mouse_button.cxx
Log Message:
- editor starts now
- level startup screen also shows partly
Index: joystick_button.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/buttons/joystick_button.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- joystick_button.cxx 20 Oct 2003 13:33:44 -0000 1.5
+++ joystick_button.cxx 13 Dec 2003 16:23:40 -0000 1.6
@@ -17,7 +17,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-//#include <ClanLib/Display/input.h>
+#include <ClanLib/Display/joystick.h>
#include <ClanLib/Display/input_device.h>
//#include <ClanLib/Display/input_button.h>
#include "joystick_button.hxx"
@@ -30,13 +30,11 @@
JoystickButton::JoystickButton(int id_, int button_) : id(id_), button(button_)
{
-#ifdef CLANLIB_0_6
- if (static_cast<unsigned int>(id) >= CL_Input::joysticks.size())
+ if (id >= CL_Joystick::get_device_count())
PingusError::raise("JoystickButton: Invalid joystick id: " +
to_string(id));
- if (button > CL_Input::joysticks[id]->get_num_buttons())
+ if (button > CL_Joystick::get_device(id).get_button_count())
PingusError::raise("JoystickButton: Invalid joystick button id: " +
to_string(button));
-#endif
}
void
Index: mouse_button.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/input/buttons/mouse_button.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- mouse_button.cxx 20 Oct 2003 13:33:44 -0000 1.5
+++ mouse_button.cxx 13 Dec 2003 16:23:40 -0000 1.6
@@ -21,6 +21,7 @@
#include <ClanLib/Display/keys.h>
#include <ClanLib/Display/mouse.h>
#include "mouse_button.hxx"
+#include "../../string_converter.hxx"
#include "../../pingus_error.hxx"
namespace Pingus {
@@ -33,10 +34,10 @@
button_release_slot(CL_Mouse::sig_key_up().connect(this,
&Input::Buttons::MouseButton::release_handler)),
pressed(false)
{
-#ifdef CLANLIB_0_6
- if (button > CL_Mouse::get_num_buttons())
- PingusError::raise("MouseButton: Invalid button id");
-#endif
+ if (CL_Mouse::get_device().get_button_count() != -1
+ && button > CL_Mouse::get_device().get_button_count())
+ PingusError::raise("MouseButton: Invalid button: " + to_string(button)
+ + ", must be smaller than " +
to_string(CL_Mouse::get_device().get_button_count()));
}
void
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/input/buttons joystick_button.cxx, 1.5, 1.6 mouse_button.cxx, 1.5, 1.6,
Ingo Ruhnke <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/input/pointers mouse_pointer.cxx, 1.5, 1.6 mouse_pointer.hxx, 1.6, 1.7
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src fonts.cxx,1.7,1.8
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/input/pointers mouse_pointer.cxx, 1.5, 1.6 mouse_pointer.hxx, 1.6, 1.7
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src fonts.cxx,1.7,1.8
- Index(es):