diff --git a/Source/controls/devices/game_controller.cpp b/Source/controls/devices/game_controller.cpp index 0cbdf34ef..dc728190d 100644 --- a/Source/controls/devices/game_controller.cpp +++ b/Source/controls/devices/game_controller.cpp @@ -81,7 +81,7 @@ ControllerButton GameController::ToControllerButton(const SDL_Event &event) return ControllerButton_NONE; } -SDL_GameControllerButton GameController::ToSdlGameControllerButton(ControllerButton button) const +SDL_GameControllerButton GameController::ToSdlGameControllerButton(ControllerButton button) { if (button == ControllerButton_AXIS_TRIGGERLEFT || button == ControllerButton_AXIS_TRIGGERRIGHT) UNIMPLEMENTED(); diff --git a/Source/controls/devices/game_controller.h b/Source/controls/devices/game_controller.h index 1d60a542f..17340fc8e 100644 --- a/Source/controls/devices/game_controller.h +++ b/Source/controls/devices/game_controller.h @@ -26,10 +26,10 @@ public: ControllerButton ToControllerButton(const SDL_Event &event); bool IsPressed(ControllerButton button) const; - bool ProcessAxisMotion(const SDL_Event &event); + static bool ProcessAxisMotion(const SDL_Event &event); private: - SDL_GameControllerButton ToSdlGameControllerButton(ControllerButton button) const; + static SDL_GameControllerButton ToSdlGameControllerButton(ControllerButton button); SDL_GameController *sdl_game_controller_ = NULL; SDL_JoystickID instance_id_ = -1; diff --git a/Source/controls/devices/joystick.cpp b/Source/controls/devices/joystick.cpp index e46918c59..e2014480a 100644 --- a/Source/controls/devices/joystick.cpp +++ b/Source/controls/devices/joystick.cpp @@ -12,7 +12,7 @@ extern bool sgbControllerActive; std::vector *const Joystick::joysticks_ = new std::vector; -ControllerButton Joystick::ToControllerButton(const SDL_Event &event) const +ControllerButton Joystick::ToControllerButton(const SDL_Event &event) { switch (event.type) { case SDL_JOYBUTTONDOWN: @@ -111,7 +111,7 @@ ControllerButton Joystick::ToControllerButton(const SDL_Event &event) const return ControllerButton_NONE; } -int Joystick::ToSdlJoyButton(ControllerButton button) const +int Joystick::ToSdlJoyButton(ControllerButton button) { if (button == ControllerButton_AXIS_TRIGGERLEFT || button == ControllerButton_AXIS_TRIGGERRIGHT) UNIMPLEMENTED(); @@ -177,7 +177,7 @@ int Joystick::ToSdlJoyButton(ControllerButton button) const } } -bool Joystick::IsHatButtonPressed(ControllerButton button) const +bool Joystick::IsHatButtonPressed(ControllerButton button) { switch (button) { #if defined(JOY_HAT_DPAD_UP_HAT) && defined(JOY_HAT_DPAD_UP) diff --git a/Source/controls/devices/joystick.h b/Source/controls/devices/joystick.h index cb6ff8471..d3d6295c2 100644 --- a/Source/controls/devices/joystick.h +++ b/Source/controls/devices/joystick.h @@ -25,9 +25,9 @@ public: static const std::vector &All(); static bool IsPressedOnAnyJoystick(ControllerButton button); - ControllerButton ToControllerButton(const SDL_Event &event) const; + static ControllerButton ToControllerButton(const SDL_Event &event); bool IsPressed(ControllerButton button) const; - bool ProcessAxisMotion(const SDL_Event &event); + static bool ProcessAxisMotion(const SDL_Event &event); SDL_JoystickID instance_id() const { @@ -35,8 +35,8 @@ public: } private: - int ToSdlJoyButton(ControllerButton button) const; - bool IsHatButtonPressed(ControllerButton button) const; + static int ToSdlJoyButton(ControllerButton button); + static bool IsHatButtonPressed(ControllerButton button); SDL_Joystick *sdl_joystick_ = NULL; SDL_JoystickID instance_id_ = -1; diff --git a/Source/dvlnet/protocol_zt.h b/Source/dvlnet/protocol_zt.h index dc4ee9c84..a848cea87 100644 --- a/Source/dvlnet/protocol_zt.h +++ b/Source/dvlnet/protocol_zt.h @@ -62,7 +62,7 @@ public: bool send_oob_mc(const buffer_t &data); bool recv(endpoint &peer, buffer_t &data); bool network_online(); - std::string make_default_gamename(); + static std::string make_default_gamename(); private: static constexpr uint32_t PKTBUF_LEN = 65536; @@ -80,12 +80,12 @@ private: int fd_tcp = -1; int fd_udp = -1; - uint64_t current_ms(); + static uint64_t current_ms(); void close_all(); - void set_nonblock(int fd); - void set_nodelay(int fd); - void set_reuseaddr(int fd); + static void set_nonblock(int fd); + static void set_nodelay(int fd); + static void set_reuseaddr(int fd); bool send_queued_peer(const endpoint &peer); bool recv_peer(const endpoint &peer);