mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
compatible with older sdl
This commit is contained in:
parent
cde22b3755
commit
a354a7f696
@ -254,9 +254,9 @@ void InputHandler::hapticFeedback()
|
||||
fingerHandler->hapticFeedback();
|
||||
}
|
||||
|
||||
uint64_t InputHandler::getTicks()
|
||||
uint32_t InputHandler::getTicks()
|
||||
{
|
||||
return SDL_GetTicks64();
|
||||
return SDL_GetTicks();
|
||||
}
|
||||
|
||||
bool InputHandler::hasTouchInputDevice() const
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
void hapticFeedback();
|
||||
|
||||
/// Get the number of milliseconds since SDL library initialization
|
||||
uint64_t getTicks();
|
||||
uint32_t getTicks();
|
||||
|
||||
/// returns true if system has active touchscreen
|
||||
bool hasTouchInputDevice() const;
|
||||
|
@ -137,7 +137,7 @@ void MapView::postSwipe(uint32_t msPassed) {
|
||||
for (auto & x : swipeHistory)
|
||||
diff += x.second;
|
||||
|
||||
uint64_t timediff = swipeHistory.rbegin()->first - swipeHistory.begin()->first;
|
||||
uint32_t timediff = swipeHistory.rbegin()->first - swipeHistory.begin()->first;
|
||||
|
||||
postSwipeAngle = diff.angle();
|
||||
postSwipeSpeed = static_cast<double>(diff.length()) / static_cast<double>(timediff); // unit: pixel/millisecond
|
||||
|
@ -49,7 +49,7 @@ class MapView : public BasicMapView
|
||||
{
|
||||
std::shared_ptr<MapViewActions> actions;
|
||||
|
||||
std::map<uint64_t, Point> swipeHistory;
|
||||
std::map<uint32_t, Point> swipeHistory;
|
||||
double postSwipeAngle;
|
||||
double postSwipeSpeed;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user