From 81897e77715c8d59382fe9d54641081c20e163ea Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 9 Mar 2017 13:13:13 +0100 Subject: Corrected bugs on RPI compilation --- src/core.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/core.c b/src/core.c index a3b5f486..f955988a 100644 --- a/src/core.c +++ b/src/core.c @@ -583,12 +583,15 @@ void SetWindowIcon(Image image) // Set window position on screen (windowed mode) void SetWindowPosition(int x, int y) { +#if defined(PLATFORM_DESKTOP) glfwSetWindowPos(window, x, y); +#endif } // Set monitor for the current window (fullscreen mode) void SetWindowMonitor(int monitor) { +#if defined(PLATFORM_DESKTOP) int monitorCount; GLFWmonitor** monitors = glfwGetMonitors(&monitorCount); @@ -598,6 +601,7 @@ void SetWindowMonitor(int monitor) TraceLog(INFO, "Selected fullscreen monitor: [%i] %s", monitor, glfwGetMonitorName(monitors[monitor])); } else TraceLog(WARNING, "Selected monitor not found"); +#endif } // Get current screen width -- cgit v1.2.3 From 4ec65c0d25887c960583b996a7468a15712339f4 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 9 Mar 2017 16:23:36 +0100 Subject: Corrected issue with reserved words: near, far --- src/core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index f955988a..2b16d49e 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 -- cgit v1.2.3 From 7c888edba18c78e38829a752626b67c41e0c224a Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 9 Mar 2017 16:25:15 +0100 Subject: Corrected typo introduced in last commit --- src/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 2b16d49e..773bc15d 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 ButtonStatus(int button); // Returns if a mouse button has been pressed +static bool GetMouseButtonStatus(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 -- cgit v1.2.3 From 7154b42f4885cea9cc2b7ef8f917fd063ee9fc47 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 9 Mar 2017 18:52:56 +0100 Subject: Corrected naming issue --- src/core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/core.c b/src/core.c index 773bc15d..c0f5be83 100644 --- a/src/core.c +++ b/src/core.c @@ -1129,16 +1129,16 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera) MatrixInvert(&matProjView); // Calculate far and near points - Quaternion nearPoint = { deviceCoords.x, deviceCoords.y, 0.0f, 1.0f }; - Quaternion farPoint = { deviceCoords.x, deviceCoords.y, 1.0f, 1.0f }; + Quaternion qNear = { deviceCoords.x, deviceCoords.y, 0.0f, 1.0f }; + Quaternion qFar = { deviceCoords.x, deviceCoords.y, 1.0f, 1.0f }; // Multiply points by unproject matrix - QuaternionTransform(&nearPoint, matProjView); - QuaternionTransform(&farPoint, matProjView); + QuaternionTransform(&qNear, matProjView); + QuaternionTransform(&qFar, matProjView); // Calculate normalized world points in vectors - 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}; + Vector3 nearPoint = { qNear.x/qNear.w, qNear.y/qNear.w, qNear.z/qNear.w}; + Vector3 farPoint = { qFar.x/qFar.w, qFar.y/qFar.w, qFar.z/qFar.w}; #endif // Calculate normalized direction vector -- cgit v1.2.3