X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fjoystick.c;h=4a1bc7d5074fcdcbdd0df41599eb72544802cc3e;hb=67f3bfab902e53e0dc24a01eb6c0e4d274030a47;hp=dfe1cca4ab1e520be35cf402393fd373135555d6;hpb=e02c111162d5d8a13715de71d93494120380ec9b;p=rocksndiamonds.git diff --git a/src/libgame/joystick.c b/src/libgame/joystick.c index dfe1cca4..4a1bc7d5 100644 --- a/src/libgame/joystick.c +++ b/src/libgame/joystick.c @@ -4,7 +4,7 @@ // (c) 1995-2014 by Artsoft Entertainment // Holger Schemel // info@artsoft.org -// http://www.artsoft.org/ +// https://www.artsoft.org/ // ---------------------------------------------------------------------------- // joystick.c // ============================================================================ @@ -17,14 +17,14 @@ #include "misc.h" -/* ========================================================================= */ -/* platform independent joystick functions */ -/* ========================================================================= */ +// ============================================================================ +// platform independent joystick functions +// ============================================================================ #define TRANSLATE_JOYSYMBOL_TO_JOYNAME 0 #define TRANSLATE_JOYNAME_TO_JOYSYMBOL 1 -void translate_joyname(int *joysymbol, char **name, int mode) +static void translate_joyname(int *joysymbol, char **name, int mode) { static struct { @@ -173,7 +173,7 @@ static int JoystickPositionPercent(int center, int border, int actual) return percent; } -void CheckJoystickData() +void CheckJoystickData(void) { int i; int distance = 100; @@ -211,10 +211,11 @@ int JoystickExt(int player_nr, boolean use_as_joystick_nr) if (!ReadJoystick(joystick_nr, &js_x, &js_y, &js_b1, &js_b2)) { - Error(ERR_WARN, "cannot read joystick device '%s'", - setup.input[player_nr].joy.device_name); + Warn("cannot read joystick device '%s'", + setup.input[player_nr].joy.device_name); joystick.status = JOYSTICK_NOT_AVAILABLE; + return JOY_NO_ACTION; } @@ -249,7 +250,7 @@ int Joystick(int player_nr) return JoystickExt(player_nr, FALSE); } -int JoystickButtonExt(int player_nr, boolean use_as_joystick_nr) +static int JoystickButtonExt(int player_nr, boolean use_as_joystick_nr) { static int last_joy_button[MAX_PLAYERS] = { 0, 0, 0, 0 }; int joy_button = (JoystickExt(player_nr, use_as_joystick_nr) & JOY_BUTTON); @@ -279,7 +280,7 @@ int JoystickButton(int player_nr) return JoystickButtonExt(player_nr, FALSE); } -int AnyJoystick() +int AnyJoystick(void) { int i; int result = 0; @@ -290,7 +291,7 @@ int AnyJoystick() return result; } -int AnyJoystickButton() +int AnyJoystickButton(void) { int i; int result = JOY_BUTTON_NOT_PRESSED; @@ -305,7 +306,7 @@ int AnyJoystickButton() return result; } -void DeactivateJoystick() +void DeactivateJoystick(void) { /* Temporarily deactivate joystick. This is needed for calibration screens, where the player has to select a joystick device that @@ -318,9 +319,9 @@ void DeactivateJoystick() joystick.status &= ~JOYSTICK_ACTIVE; } -void ActivateJoystick() +void ActivateJoystick(void) { - /* reactivate temporarily deactivated joystick */ + // reactivate temporarily deactivated joystick if (joystick.status & JOYSTICK_AVAILABLE) joystick.status |= JOYSTICK_ACTIVE;