input fix: clearBindings no borraba completamente el vector de asignaciones
This commit is contained in:
@@ -11,11 +11,13 @@ Input::Input(string file, bool verbose)
|
|||||||
keyBindings_t kb;
|
keyBindings_t kb;
|
||||||
kb.scancode = 0;
|
kb.scancode = 0;
|
||||||
kb.active = false;
|
kb.active = false;
|
||||||
|
keyBindings.clear();
|
||||||
keyBindings.resize(INPUT_TOTAL, kb);
|
keyBindings.resize(INPUT_TOTAL, kb);
|
||||||
|
|
||||||
GameControllerBindings_t gcb;
|
GameControllerBindings_t gcb;
|
||||||
gcb.button = SDL_CONTROLLER_BUTTON_INVALID;
|
gcb.button = SDL_CONTROLLER_BUTTON_INVALID;
|
||||||
gcb.active = false;
|
gcb.active = false;
|
||||||
|
gameControllerBindings.clear();
|
||||||
gameControllerBindings.resize(INPUT_TOTAL, gcb);
|
gameControllerBindings.resize(INPUT_TOTAL, gcb);
|
||||||
|
|
||||||
this->verbose = verbose;
|
this->verbose = verbose;
|
||||||
@@ -359,10 +361,12 @@ void Input::clearBindings()
|
|||||||
keyBindings_t kb;
|
keyBindings_t kb;
|
||||||
kb.scancode = 0;
|
kb.scancode = 0;
|
||||||
kb.active = false;
|
kb.active = false;
|
||||||
|
keyBindings.clear();
|
||||||
keyBindings.resize(INPUT_TOTAL, kb);
|
keyBindings.resize(INPUT_TOTAL, kb);
|
||||||
|
|
||||||
GameControllerBindings_t gcb;
|
GameControllerBindings_t gcb;
|
||||||
gcb.button = SDL_CONTROLLER_BUTTON_INVALID;
|
gcb.button = SDL_CONTROLLER_BUTTON_INVALID;
|
||||||
gcb.active = false;
|
gcb.active = false;
|
||||||
|
gameControllerBindings.clear();
|
||||||
gameControllerBindings.resize(INPUT_TOTAL, gcb);
|
gameControllerBindings.resize(INPUT_TOTAL, gcb);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user