From f030154fe727e25a2afe1f78b3998c2d2dba95e4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 18 Aug 2009 09:24:15 +0000 Subject: astyle cleanup, corrects not loading of material textures --- src/client/joystick.cc | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'src/client/joystick.cc') 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); } } -- cgit v1.2.3