#include <joystick.hpp>

Public Member Functions | |
| joystick_manager () | |
| ~joystick_manager () | |
| bool | init () |
| bool | close () |
| bool | update_highlighted_hex (map_location &highlighted_hex) |
| Used for absolute movement of the cursor. | |
| bool | update_highlighted_hex (map_location &highlighted_hex, const map_location &selected_hex) |
| Used for relative movement of the cursor. | |
| std::pair< double, double > | get_scroll_axis_pair () |
| std::pair< double, double > | get_cursor_polar_coordinates () |
| TODO fendrin. | |
| std::pair< double, double > | get_mouse_axis_pair () |
| TODO fendrin. | |
| double | get_thrusta_axis () |
| TODO fendrin. | |
| double | get_thrustb_axis () |
| TODO fendrin. | |
| double | get_angle () |
| TODO fendrin. | |
| std::pair< double, double > | get_polar_coordinates (int joystick_xaxis, int xaxis, int joystick_yaxis, int yaxis) |
| TODO fendrin. | |
Private Types | |
| enum | DIRECTION { NORTH, NORTH_EAST, SOUTH_EAST, SOUTH, SOUTH_WEST, NORTH_WEST, NDIRECTIONS, WEST, EAST } |
Private Member Functions | |
| std::pair< int, int > | get_axis_pair (int joystick_xaxis, int xaxis, int joystick_yaxis, int yaxis) |
| int | get_axis (int joystick_axis, int axis) |
| const map_location | get_next_hex (int x_axis, int y_axis, map_location old_hex) |
| const map_location | get_direction (const map_location &loc, joystick_manager::DIRECTION direction) |
Private Attributes | |
| std::vector< SDL_Joystick * > | joysticks_ |
| int | joystick_area_ |
| int | counter_ |
Definition at line 23 of file joystick.hpp.
enum joystick_manager::DIRECTION [private] |
Definition at line 85 of file joystick.hpp.
| joystick_manager::joystick_manager | ( | ) |
Definition at line 27 of file joystick.cpp.
References init().

| joystick_manager::~joystick_manager | ( | ) |
Definition at line 35 of file joystick.cpp.
References close().

| bool joystick_manager::close | ( | ) |
Definition at line 39 of file joystick.cpp.
References ERR_JOY, joysticks_, and LOG_JOY.
Referenced by init(), and ~joystick_manager().

| double joystick_manager::get_angle | ( | ) |
TODO fendrin.
Definition at line 351 of file joystick.cpp.
References get_axis_pair(), preferences::joystick_cursor_xaxis_num(), preferences::joystick_cursor_yaxis_num(), preferences::joystick_num_cursor_xaxis(), preferences::joystick_num_cursor_yaxis(), and PI.

| int joystick_manager::get_axis | ( | int | joystick_axis, | |
| int | axis | |||
| ) | [private] |
Definition at line 237 of file joystick.cpp.
References joysticks_.
Referenced by get_thrusta_axis(), and get_thrustb_axis().

| std::pair< int, int > joystick_manager::get_axis_pair | ( | int | joystick_xaxis, | |
| int | xaxis, | |||
| int | joystick_yaxis, | |||
| int | yaxis | |||
| ) | [private] |
Definition at line 212 of file joystick.cpp.
References joysticks_.
Referenced by get_angle(), get_mouse_axis_pair(), get_polar_coordinates(), get_scroll_axis_pair(), and update_highlighted_hex().

| std::pair< double, double > joystick_manager::get_cursor_polar_coordinates | ( | ) |
TODO fendrin.
Definition at line 191 of file joystick.cpp.
References get_polar_coordinates(), preferences::joystick_cursor_xaxis_num(), preferences::joystick_cursor_yaxis_num(), preferences::joystick_num_cursor_xaxis(), and preferences::joystick_num_cursor_yaxis().

| const map_location joystick_manager::get_direction | ( | const map_location & | loc, | |
| joystick_manager::DIRECTION | direction | |||
| ) | [private] |
Definition at line 331 of file joystick.cpp.
References EAST, is_even(), is_odd(), NORTH, NORTH_EAST, NORTH_WEST, SOUTH, SOUTH_EAST, SOUTH_WEST, WEST, map_location::x, and map_location::y.
Referenced by get_next_hex().


| std::pair< double, double > joystick_manager::get_mouse_axis_pair | ( | ) |
TODO fendrin.
Definition at line 104 of file joystick.cpp.
References get_axis_pair(), get_thrusta_axis(), preferences::joystick_mouse_deadzone(), preferences::joystick_mouse_xaxis_num(), preferences::joystick_mouse_yaxis_num(), preferences::joystick_num_mouse_xaxis(), preferences::joystick_num_mouse_yaxis(), and round_double().

| const map_location joystick_manager::get_next_hex | ( | int | x_axis, | |
| int | y_axis, | |||
| map_location | old_hex | |||
| ) | [private] |
Definition at line 372 of file joystick.cpp.
References EAST, get_direction(), NORTH, NORTH_EAST, NORTH_WEST, map_location::null_location, PI, SOUTH, SOUTH_EAST, SOUTH_WEST, and WEST.
Referenced by update_highlighted_hex().


| std::pair< double, double > joystick_manager::get_polar_coordinates | ( | int | joystick_xaxis, | |
| int | xaxis, | |||
| int | joystick_yaxis, | |||
| int | yaxis | |||
| ) |
TODO fendrin.
Definition at line 201 of file joystick.cpp.
References get_axis_pair(), and PI.
Referenced by get_cursor_polar_coordinates().


| std::pair< double, double > joystick_manager::get_scroll_axis_pair | ( | ) |
Definition at line 138 of file joystick.cpp.
References get_axis_pair(), get_thrusta_axis(), preferences::joystick_num_scroll_xaxis(), preferences::joystick_num_scroll_yaxis(), preferences::joystick_scroll_deadzone(), preferences::joystick_scroll_xaxis_num(), preferences::joystick_scroll_yaxis_num(), preferences::joystick_support_enabled(), and round_double().
Referenced by controller_base::play_slice().


| double joystick_manager::get_thrusta_axis | ( | ) |
TODO fendrin.
Definition at line 167 of file joystick.cpp.
References get_axis(), preferences::joystick_num_thrusta_axis(), preferences::joystick_support_enabled(), preferences::joystick_thrusta_axis_num(), and preferences::joystick_thrusta_deadzone().
Referenced by get_mouse_axis_pair(), and get_scroll_axis_pair().


| double joystick_manager::get_thrustb_axis | ( | ) |
TODO fendrin.
Definition at line 179 of file joystick.cpp.
References get_axis(), preferences::joystick_num_thrustb_axis(), preferences::joystick_support_enabled(), preferences::joystick_thrustb_axis_num(), and preferences::joystick_thrustb_deadzone().

| bool joystick_manager::init | ( | ) |
Definition at line 61 of file joystick.cpp.
References close(), ERR_JOY, preferences::joystick_support_enabled(), joysticks_, and LOG_JOY.
Referenced by joystick_manager().


| bool joystick_manager::update_highlighted_hex | ( | map_location & | highlighted_hex | ) |
Used for absolute movement of the cursor.
| highlighted_hex | will change if the cursor moved. |
Definition at line 284 of file joystick.cpp.
References counter_, get_axis_pair(), get_next_hex(), joystick_area_, preferences::joystick_cursor_deadzone(), preferences::joystick_cursor_threshold(), preferences::joystick_cursor_xaxis_num(), preferences::joystick_cursor_yaxis_num(), preferences::joystick_num_cursor_xaxis(), preferences::joystick_num_cursor_yaxis(), and round_double().
Referenced by controller_base::play_slice().


| bool joystick_manager::update_highlighted_hex | ( | map_location & | highlighted_hex, | |
| const map_location & | selected_hex | |||
| ) |
Used for relative movement of the cursor.
| highlighted_hex | will change if the cursor moved. |
Definition at line 248 of file joystick.cpp.
References get_axis_pair(), preferences::joystick_cursor_xaxis_num(), preferences::joystick_cursor_yaxis_num(), preferences::joystick_num_cursor_xaxis(), preferences::joystick_num_cursor_yaxis(), round_double(), map_location::x, and map_location::y.

int joystick_manager::counter_ [private] |
Definition at line 98 of file joystick.hpp.
Referenced by update_highlighted_hex().
int joystick_manager::joystick_area_ [private] |
Definition at line 97 of file joystick.hpp.
Referenced by update_highlighted_hex().
std::vector<SDL_Joystick*> joystick_manager::joysticks_ [private] |
Definition at line 96 of file joystick.hpp.
Referenced by close(), get_axis(), get_axis_pair(), and init().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:14:20 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |