فهرست منبع

compatible with older sdl

Michael 2 سال پیش
والد
کامیت
a354a7f696
4فایلهای تغییر یافته به همراه5 افزوده شده و 5 حذف شده
  1. 2 2
      client/eventsSDL/InputHandler.cpp
  2. 1 1
      client/eventsSDL/InputHandler.h
  3. 1 1
      client/mapView/MapView.cpp
  4. 1 1
      client/mapView/MapView.h

+ 2 - 2
client/eventsSDL/InputHandler.cpp

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

+ 1 - 1
client/eventsSDL/InputHandler.h

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

+ 1 - 1
client/mapView/MapView.cpp

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

+ 1 - 1
client/mapView/MapView.h

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