summaryrefslogtreecommitdiffhomepage
path: root/src/gestures.h
diff options
context:
space:
mode:
authorvictorfisac <[email protected]>2017-04-16 14:03:39 +0200
committervictorfisac <[email protected]>2017-04-16 14:03:39 +0200
commit8849a4c7526ee6a321df9393dd69d0b29820311a (patch)
treedc7d70f10ecdb971d51de03fb1ea995a68e3d1eb /src/gestures.h
parent82577ededc43f2673c46d3356cfa3e0746e012a5 (diff)
parentf5894278b74df34d7850438c36f9d7202ea08091 (diff)
downloadraylib-8849a4c7526ee6a321df9393dd69d0b29820311a.tar.gz
raylib-8849a4c7526ee6a321df9393dd69d0b29820311a.zip
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
Diffstat (limited to 'src/gestures.h')
-rw-r--r--src/gestures.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gestures.h b/src/gestures.h
index c97871e5..f04bf091 100644
--- a/src/gestures.h
+++ b/src/gestures.h
@@ -213,8 +213,11 @@ static unsigned int enabledGestures = 0b0000001111111111;
//----------------------------------------------------------------------------------
// Module specific Functions Declaration
//----------------------------------------------------------------------------------
+#if defined(GESTURES_STANDALONE)
+// Some required math functions provided by raymath.h
static float Vector2Angle(Vector2 initialPosition, Vector2 finalPosition);
static float Vector2Distance(Vector2 v1, Vector2 v2);
+#endif
static double GetCurrentTime(void);
//----------------------------------------------------------------------------------
@@ -477,13 +480,11 @@ float GetGesturePinchAngle(void)
//----------------------------------------------------------------------------------
// Module specific Functions Definition
//----------------------------------------------------------------------------------
-
+#if defined(GESTURES_STANDALONE)
// Returns angle from two-points vector with X-axis
-static float Vector2Angle(Vector2 initialPosition, Vector2 finalPosition)
+static float Vector2Angle(Vector2 v1, Vector2 v2)
{
- float angle;
-
- angle = atan2f(finalPosition.y - initialPosition.y, finalPosition.x - initialPosition.x)*(180.0f/PI);
+ float angle = angle = atan2f(v2.y - v1.y, v2.x - v1.x)*(180.0f/PI);
if (angle < 0) angle += 360.0f;
@@ -502,6 +503,7 @@ static float Vector2Distance(Vector2 v1, Vector2 v2)
return result;
}
+#endif
// Time measure returned are milliseconds
static double GetCurrentTime(void)