Improved control map handling
This commit is contained in:
@@ -40,16 +40,10 @@ ErrorContext *controller_handle_event(void *appstate, SDL_Event *event)
|
||||
event->key.key == curcontrol->key)
|
||||
);
|
||||
if ( event->type == curcontrol->event_on && eventButtonComboMatch) {
|
||||
SDL_Log("event %d (button %d / key %d) ACTIVATES controlmap %d control %d", event->type, event->gbutton.which, event->key.key, i, j);
|
||||
BITMASK_DEL(curmap->target->state, curcontrol->target_del_state_on);
|
||||
BITMASK_ADD(curmap->target->state, curcontrol->target_add_state_on);
|
||||
SDL_Log("new target actor state: %d", curmap->target->state);
|
||||
CATCH(errctx, curcontrol->handler_on(curmap->target, event));
|
||||
goto _controller_handle_event_success;
|
||||
} else if ( event->type == curcontrol->event_off && eventButtonComboMatch ) {
|
||||
SDL_Log("event %d (button %d / key %d) DE-ACTIVATES controlmap %d control %d", event->type, event->gbutton.which, event->key.key, i, j);
|
||||
BITMASK_DEL(curmap->target->state, curcontrol->target_del_state_off);
|
||||
BITMASK_ADD(curmap->target->state, curcontrol->target_add_state_off);
|
||||
SDL_Log("new target actor state: %d", curmap->target->state);
|
||||
CATCH(errctx, curcontrol->handler_off(curmap->target, event));
|
||||
goto _controller_handle_event_success;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user