summaryrefslogtreecommitdiffhomepage
path: root/src/gestures.h
diff options
context:
space:
mode:
authorRay <[email protected]>2016-12-05 01:14:18 +0100
committerRay <[email protected]>2016-12-05 01:14:18 +0100
commit377dcb025fb6957f73263e1913dfc5f29ba21a58 (patch)
tree0a2c8faaa47a09dd49567d9487fd518f75d50b41 /src/gestures.h
parentab9f5d578025f71abd3b242170d6fb8ea6c2c297 (diff)
downloadraylib-377dcb025fb6957f73263e1913dfc5f29ba21a58.tar.gz
raylib-377dcb025fb6957f73263e1913dfc5f29ba21a58.zip
Corrected some warnings
Diffstat (limited to 'src/gestures.h')
-rw-r--r--src/gestures.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gestures.h b/src/gestures.h
index 481ef317..19b09269 100644
--- a/src/gestures.h
+++ b/src/gestures.h
@@ -179,7 +179,7 @@ static int tapCounter = 0; // TAP counter (one tap implies
// Hold gesture variables
static bool resetHold = false; // HOLD reset to get first touch point again
-static float timeHold = 0.0f; // HOLD duration in milliseconds
+static double timeHold = 0.0f; // HOLD duration in milliseconds
// Drag gesture variables
static Vector2 dragVector = { 0.0f , 0.0f }; // DRAG vector (between initial and current position)
@@ -423,11 +423,11 @@ float GetGestureHoldDuration(void)
{
// NOTE: time is calculated on current gesture HOLD
- float time = 0.0f;
+ double time = 0.0;
- if (currentGesture == GESTURE_HOLD) time = (float)GetCurrentTime() - timeHold;
+ if (currentGesture == GESTURE_HOLD) time = GetCurrentTime() - timeHold;
- return time;
+ return (float)time;
}
// Get drag vector (between initial touch point to current)
@@ -474,7 +474,7 @@ static float Vector2Angle(Vector2 initialPosition, Vector2 finalPosition)
{
float angle;
- angle = atan2(finalPosition.y - initialPosition.y, finalPosition.x - initialPosition.x)*(180.0f/PI);
+ angle = atan2f(finalPosition.y - initialPosition.y, finalPosition.x - initialPosition.x)*(180.0f/PI);
if (angle < 0) angle += 360.0f;
@@ -489,7 +489,7 @@ static float Vector2Distance(Vector2 v1, Vector2 v2)
float dx = v2.x - v1.x;
float dy = v2.y - v1.y;
- result = sqrt(dx*dx + dy*dy);
+ result = (float)sqrt(dx*dx + dy*dy);
return result;
}