Skip to content

Commit a41c76c

Browse files
committed
input: console:
- fix console build, by providing missing function definition
1 parent 9f728ad commit a41c76c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/input/joystick_input.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff 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+
583587
void input::JoystickGameInput::handle_event(const SDL_Event& event) {
584588
m_event_buffer.push_back(event);
585589
}
@@ -764,7 +768,7 @@ input::ConsoleJoystickGameInput::~ConsoleJoystickGameInput() = default;
764768
helper::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

src/input/joystick_input.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)