Subversion Repositories battle

[/] [trunk/] [Battle/] [GameInput.cpp] - Diff between revs 115 and 116

Show entire file | Details | Blame | View Log

Rev 115 Rev 116
Line 69... Line 69...
        enable_keyboard(gi->keyboard_enabled);
        enable_keyboard(gi->keyboard_enabled);
        enable_joystick(gi->joystick_enabled);
        enable_joystick(gi->joystick_enabled);
        open_joystick(gi->get_joystick_idx());
        open_joystick(gi->get_joystick_idx());
 
 
        flush_keybinds();
        flush_keybinds();
        flush_joybinds();
        flush_joybuttons();
 
        flush_joyaxes();
 
        flush_joyhats();
 
 
        for(unsigned int i = 0; i < gi->keybinds->size(); i++) {
        for(unsigned int i = 0; i < gi->keybinds->size(); i++) {
                bind_key(gi->keybinds->at(i).key, gi->keybinds->at(i).action);
                bind_key(gi->keybinds->at(i).key, gi->keybinds->at(i).action);
        }
        }
 
 
Line 119... Line 121...
 
 
int GameInput::get_joystick_idx() {
int GameInput::get_joystick_idx() {
        return joystick_idx;
        return joystick_idx;
}
}
 
 
 
int GameInput::num_buttons() {
 
        return SDL_JoystickNumButtons(joystick);
 
}
 
 
 
int GameInput::num_axes() {
 
        return SDL_JoystickNumAxes(joystick);
 
}
 
 
 
int GameInput::num_hats() {
 
        return SDL_JoystickNumHats(joystick);
 
}
 
 
// Bind a keyboard key to an action
// Bind a keyboard key to an action
void GameInput::bind_key(int key, int action) {
void GameInput::bind_key(int key, int action) {
        GameInputKeyBind bind;
        GameInputKeyBind bind;
        bind.key = key;
        bind.key = key;
        bind.action = action;
        bind.action = action;
Line 531... Line 545...
 
 
void GameInput::flush_keybinds() {
void GameInput::flush_keybinds() {
        keybinds->clear();
        keybinds->clear();
}
}
 
 
void GameInput::flush_joybinds() {
void GameInput::flush_joybuttons() {
        joybuttonbinds->clear();
        joybuttonbinds->clear();
 
}
 
 
 
void GameInput::flush_joyaxes() {
        joyaxisbinds->clear();
        joyaxisbinds->clear();
 
}
 
 
 
void GameInput::flush_joyhats() {
        joyhatbinds->clear();
        joyhatbinds->clear();
}
}