1
0
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:
Michael 2023-08-26 22:30:02 +02:00 committed by GitHub
parent cde22b3755
commit a354a7f696
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;