From 4ec65c0d25887c960583b996a7468a15712339f4 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 9 Mar 2017 16:23:36 +0100 Subject: [PATCH] Corrected issue with reserved words: near, far --- src/core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core.c b/src/core.c index f955988ae..2b16d49e7 100644 --- a/src/core.c +++ b/src/core.c @@ -291,7 +291,7 @@ static void InitTimer(void); // Initialize timer static double GetTime(void); // Returns time since InitTimer() was run static void Wait(float ms); // Wait for some milliseconds (stop program execution) static bool GetKeyStatus(int key); // Returns if a key has been pressed -static bool GetMouseButtonStatus(int button); // Returns if a mouse button has been pressed +static bool ButtonStatus(int button); // Returns if a mouse button has been pressed static void PollInputEvents(void); // Register user events static void SwapBuffers(void); // Copy back buffer to front buffers static void LogoAnimation(void); // Plays raylib logo appearing animation @@ -1129,16 +1129,16 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera) MatrixInvert(&matProjView); // Calculate far and near points - Quaternion near = { deviceCoords.x, deviceCoords.y, 0.0f, 1.0f }; - Quaternion far = { deviceCoords.x, deviceCoords.y, 1.0f, 1.0f }; + Quaternion nearPoint = { deviceCoords.x, deviceCoords.y, 0.0f, 1.0f }; + Quaternion farPoint = { deviceCoords.x, deviceCoords.y, 1.0f, 1.0f }; // Multiply points by unproject matrix - QuaternionTransform(&near, matProjView); - QuaternionTransform(&far, matProjView); + QuaternionTransform(&nearPoint, matProjView); + QuaternionTransform(&farPoint, matProjView); // Calculate normalized world points in vectors - Vector3 nearPoint = { near.x/near.w, near.y/near.w, near.z/near.w}; - Vector3 farPoint = { far.x/far.w, far.y/far.w, far.z/far.w}; + Vector3 nearPoint = { nearPoint.x/nearPoint.w, nearPoint.y/nearPoint.w, nearPoint.z/nearPoint.w}; + Vector3 farPoint = { farPoint.x/farPoint.w, farPoint.y/farPoint.w, farPoint.z/farPoint.w}; #endif // Calculate normalized direction vector