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