File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -580,6 +580,10 @@ input::JoystickGameInput::JoystickGameInput(JoystickGameInput&& input) noexcept
580580[[nodiscard]] input::JoystickGameInput& input::JoystickGameInput::operator =(JoystickGameInput&& input
581581) noexcept = default ;
582582
583+ [[nodiscard]] const input::JoystickInput* input::JoystickGameInput::underlying_input () const {
584+ return m_underlying_input;
585+ }
586+
583587void input::JoystickGameInput::handle_event (const SDL_Event& event) {
584588 m_event_buffer.push_back (event);
585589}
@@ -764,7 +768,7 @@ input::ConsoleJoystickGameInput::~ConsoleJoystickGameInput() = default;
764768helper::optional<InputEvent> input::ConsoleJoystickGameInput::sdl_event_to_input_event (const SDL_Event& event) const {
765769 if (event.type == SDL_JOYBUTTONDOWN) {
766770
767- if (event.jbutton .which != m_underlying_input ->instance_id ()) {
771+ if (event.jbutton .which != underlying_input () ->instance_id ()) {
768772 return helper::nullopt ;
769773 }
770774
@@ -793,7 +797,7 @@ helper::optional<InputEvent> input::ConsoleJoystickGameInput::sdl_event_to_input
793797 }
794798 } else if (event.type == SDL_JOYBUTTONUP) {
795799
796- if (event.jbutton .which != m_underlying_input ->instance_id ()) {
800+ if (event.jbutton .which != underlying_input () ->instance_id ()) {
797801 return helper::nullopt ;
798802 }
799803
@@ -828,7 +832,7 @@ helper::optional<InputEvent> input::ConsoleJoystickGameInput::sdl_event_to_input
828832
829833 if (event.type == SDL_JOYBUTTONDOWN) {
830834
831- if (event.jbutton .which != m_underlying_input ->instance_id ()) {
835+ if (event.jbutton .which != underlying_input () ->instance_id ()) {
832836 return helper::nullopt ;
833837 }
834838
Original file line number Diff line number Diff line change @@ -239,7 +239,6 @@ namespace input {
239239 protected:
240240 [[nodiscard]] const JoystickInput* underlying_input () const ;
241241
242-
243242 public:
244243 JoystickGameInput (EventDispatcher* event_dispatcher, JoystickInput* underlying_input);
245244
You can’t perform that action at this time.
0 commit comments