summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-15 05:43:59 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-15 05:43:59 +0300
commita9ef0d38fa9b1e49b3c286fb5633ae603a3aa9dc (patch)
treefb992daa329b99f84e98f3790fda82ef61573330
parenta6d79e4f323cf0d52b87be93cb193bc8b813a365 (diff)
downloadmv-a9ef0d38fa9b1e49b3c286fb5633ae603a3aa9dc.tar.gz
mv-a9ef0d38fa9b1e49b3c286fb5633ae603a3aa9dc.tar.bz2
mv-a9ef0d38fa9b1e49b3c286fb5633ae603a3aa9dc.tar.xz
mv-a9ef0d38fa9b1e49b3c286fb5633ae603a3aa9dc.zip
Fix compilation with SDL 2 < 2.0.6.
-rw-r--r--src/input/joystick.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/input/joystick.cpp b/src/input/joystick.cpp
index dce9d1922..fc4b8434d 100644
--- a/src/input/joystick.cpp
+++ b/src/input/joystick.cpp
@@ -117,10 +117,12 @@ bool Joystick::open()
for (int f = 0; f < 16; f ++)
guidStr.append(strprintf("%02x", CAST_U32(guid.data[f])));
logger->log("Guid: %s", guidStr.c_str());
+#if SDL_VERSION_ATLEAST(2, 0, 6)
logger->log("Device id: %u:%u.%u",
CAST_U32(SDL_JoystickGetVendor(mJoystick)),
CAST_U32(SDL_JoystickGetProduct(mJoystick)),
CAST_U32(SDL_JoystickGetProductVersion(mJoystick)));
+
SDL_JoystickType type = SDL_JoystickGetType(mJoystick);
std::string typeStr;
switch (type)
@@ -158,6 +160,7 @@ bool Joystick::open()
break;
}
logger->log("Type: " + typeStr);
+#endif // SDL_VERSION_ATLEAST(2, 0, 6)
// probably need aslo dump SDL_JoystickCurrentPowerLevel
#else // USE_SDL2