Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-08-18 09:24:15 +0000
committerStijn Buys <ingar@osirion.org>2009-08-18 09:24:15 +0000
commitf030154fe727e25a2afe1f78b3998c2d2dba95e4 (patch)
treecd92baf9e4fa8a136523b9eb570e9811846c9250 /src/client/joystick.cc
parent5636fad174f0bcff857c357c394c4cc8d424b302 (diff)
astyle cleanup, corrects not loading of material textures
Diffstat (limited to 'src/client/joystick.cc')
-rw-r--r--src/client/joystick.cc33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/client/joystick.cc b/src/client/joystick.cc
index 486542e..c8f7f9d 100644
--- a/src/client/joystick.cc
+++ b/src/client/joystick.cc
@@ -24,13 +24,13 @@ void Joystick::init()
int nbjoysticks = SDL_NumJoysticks();
if (nbjoysticks) {
- for (int i=0; i < nbjoysticks; i++) {
+ for (int i = 0; i < nbjoysticks; i++) {
SDL_Joystick *joystick = SDL_JoystickOpen(i);
if (joystick) {
- con_print << " joystick " << i+1 << ": " <<
- SDL_JoystickName(i) << " " <<
- SDL_JoystickNumAxes(joystick) << " axes " <<
- SDL_JoystickNumButtons(joystick) << " buttons " << std::endl;
+ con_print << " joystick " << i + 1 << ": " <<
+ SDL_JoystickName(i) << " " <<
+ SDL_JoystickNumAxes(joystick) << " axes " <<
+ SDL_JoystickNumButtons(joystick) << " buttons " << std::endl;
SDL_JoystickClose(joystick);
}
@@ -69,13 +69,13 @@ void Joystick::list()
*/
int nbjoysticks = SDL_NumJoysticks();
if (nbjoysticks) {
- for (int i=0; i < nbjoysticks; i++) {
+ for (int i = 0; i < nbjoysticks; i++) {
SDL_Joystick *joystick = SDL_JoystickOpen(i);
if (joystick) {
- con_print << " joystick " << i+1 << ": " <<
- SDL_JoystickName(i) << " " <<
- SDL_JoystickNumAxes(joystick) << " axes " <<
- SDL_JoystickNumButtons(joystick) << " buttons " << std::endl;
+ con_print << " joystick " << i + 1 << ": " <<
+ SDL_JoystickName(i) << " " <<
+ SDL_JoystickNumAxes(joystick) << " axes " <<
+ SDL_JoystickNumButtons(joystick) << " buttons " << std::endl;
SDL_JoystickClose(joystick);
}
@@ -89,11 +89,11 @@ void Joystick::list()
(*input_joystick) = (float) current_joystick_number;
if (current_joystick_number) {
- current_joystick = SDL_JoystickOpen(current_joystick_number -1);
+ current_joystick = SDL_JoystickOpen(current_joystick_number - 1);
}
if (current_joystick) {
- con_debug << " using joystick " << SDL_JoystickName(current_joystick_number -1) << std::endl;
+ con_debug << " using joystick " << SDL_JoystickName(current_joystick_number - 1) << std::endl;
SDL_JoystickEventState(SDL_ENABLE);
}
}
@@ -105,14 +105,13 @@ bool Joystick::is_enabled()
void Joystick::frame()
{
- if (current_joystick_number != (int) input_joystick->value())
- {
+ if (current_joystick_number != (int) input_joystick->value()) {
if (current_joystick) {
SDL_JoystickEventState(SDL_IGNORE);
SDL_JoystickClose(current_joystick);
current_joystick = 0;
}
-
+
current_joystick_number = (int) input_joystick->value();
if ((current_joystick_number < 1) || (current_joystick_number > SDL_NumJoysticks())) {
current_joystick_number = 0;
@@ -120,11 +119,11 @@ void Joystick::frame()
(*input_joystick) = (float) current_joystick_number;
if (current_joystick_number) {
- current_joystick = SDL_JoystickOpen(current_joystick_number -1);
+ current_joystick = SDL_JoystickOpen(current_joystick_number - 1);
}
if (current_joystick) {
- con_debug << " using joystick " << SDL_JoystickName(current_joystick_number -1) << std::endl;
+ con_debug << " using joystick " << SDL_JoystickName(current_joystick_number - 1) << std::endl;
SDL_JoystickEventState(SDL_ENABLE);
}
}