소스 검색

Add save/load bindings to shoulder buttons

master
Nathaniel Walizer 11 달 전
부모
커밋
b838f8b41d
1개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  1. +17
    -0
      src/sdl_input.c

+ 17
- 0
src/sdl_input.c 파일 보기

@@ -68,6 +68,9 @@ static const int sdl_keycodes[nes_controller_num_buttons] = {
SDLK_RIGHT,
};

static const int sdl_save_button = SDL_CONTROLLER_BUTTON_LEFTSHOULDER;
static const int sdl_load_button = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER;

static const int sdl_buttons[nes_controller_num_buttons] = {
SDL_CONTROLLER_BUTTON_A,
SDL_CONTROLLER_BUTTON_B,
@@ -138,6 +141,20 @@ static int sdl_input_update(nes_Input_Reader* reader,
} else {
input->controllers[0].buttons &= ~mask;
}

} else if (sdl_save_button == event.cbutton.button) {
if (SDL_CONTROLLERBUTTONDOWN == event.type) {
status = input_Result_Save;
} else {
status = input_Result_Cancel;
}

} else if (sdl_load_button == event.cbutton.button) {
if (SDL_CONTROLLERBUTTONDOWN == event.type) {
status = input_Result_Load;
} else {
status = input_Result_Cancel;
}
}

} else if (SDL_CONTROLLERAXISMOTION == event.type) {


불러오는 중...
취소
저장