From c4a62ca1e400a8660e6f779dac151dbe9bfd5fdc Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Dec 2021 12:02:57 +0100 Subject: [PATCH 1/9] ADDED: Modules info at initialization --- src/rcore.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/rcore.c b/src/rcore.c index 946ed0c0c..ba64d1db1 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -701,6 +701,35 @@ struct android_app *GetAndroidApp(void) void InitWindow(int width, int height, const char *title) { TRACELOG(LOG_INFO, "Initializing raylib %s", RAYLIB_VERSION); + + TRACELOG(LOG_INFO, "Supported raylib modules:"); + TRACELOG(LOG_INFO, " > rcore:..... loaded (mandatory)"); + TRACELOG(LOG_INFO, " > rlgl:...... loaded (mandatory)"); +#if defined(SUPPORT_MODULE_RSHAPES) + TRACELOG(LOG_INFO, " > rshapes:... loaded (optional)"); +#else + TRACELOG(LOG_INFO, " > rshapes:... not loaded (optional)"); +#endif +#if defined(SUPPORT_MODULE_RTEXTURES) + TRACELOG(LOG_INFO, " > rtextures:. loaded (optional)"); +#else + TRACELOG(LOG_INFO, " > rtextures:. not loaded (optional)"); +#endif +#if defined(SUPPORT_MODULE_RTEXT) + TRACELOG(LOG_INFO, " > rtext:..... loaded (optional)"); +#else + TRACELOG(LOG_INFO, " > rtext:..... not loaded (optional)"); +#endif +#if defined(SUPPORT_MODULE_RMODELS) + TRACELOG(LOG_INFO, " > rmodels:... loaded (optional)"); +#else + TRACELOG(LOG_INFO, " > rmodels:... not loaded (optional)"); +#endif +#if defined(SUPPORT_MODULE_RAUDIO) + TRACELOG(LOG_INFO, " > raudio:.... loaded (optional)"); +#else + TRACELOG(LOG_INFO, " > raudio:.... not loaded (optional)"); +#endif if ((title != NULL) && (title[0] != 0)) CORE.Window.title = title; @@ -3285,7 +3314,8 @@ void OpenURL(const char *url) #if defined(__APPLE__) sprintf(cmd, "open '%s'", url); #endif - system(cmd); + int result = system(cmd); + if (result == -1) TRACELOG(LOG_WARNING, "OpenURL() child process could bot be created"); RL_FREE(cmd); #endif #if defined(PLATFORM_WEB) From c5eaaed873e0888fb10ec6937cccd7b1c131a41d Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Dec 2021 12:09:44 +0100 Subject: [PATCH 2/9] Update Makefile --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 53d4e7680..6f111d3f2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -15,7 +15,7 @@ # Many thanks to Milan Nikolic (@gen2brain) for implementing Android platform pipeline. # Many thanks to Emanuele Petriglia for his contribution on GNU/Linux pipeline. # -# Copyright (c) 2014-2019 Ramon Santamaria (@raysan5) +# Copyright (c) 2014-2021 Ramon Santamaria (@raysan5) # # This software is provided "as-is", without any express or implied warranty. # In no event will the authors be held liable for any damages arising from From 93f05d851d4412504d573e7cfb15c15c31b5b5c2 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Dec 2021 18:37:44 +0100 Subject: [PATCH 3/9] Update webassembly.yml --- .github/workflows/webassembly.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/webassembly.yml b/.github/workflows/webassembly.yml index 4427d2cb6..9b15c34e9 100644 --- a/.github/workflows/webassembly.yml +++ b/.github/workflows/webassembly.yml @@ -27,9 +27,9 @@ jobs: uses: actions/checkout@master - name: Setup emsdk - uses: mymindstorm/setup-emsdk@v9 + uses: mymindstorm/setup-emsdk@v11 with: - version: 2.0.0 + version: 3.0.0 actions-cache-folder: 'emsdk-cache' - name: Setup Release Version @@ -52,7 +52,7 @@ jobs: run: | cd src emcc -v - make PLATFORM=PLATFORM_WEB EMSDK_PATH="D:/a/raylib/raylib/emsdk-cache/emsdk-master" RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B + make PLATFORM=PLATFORM_WEB EMSDK_PATH="D:/a/raylib/raylib/emsdk-cache/emsdk-main" RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B cd .. - name: Generate Artifacts From fa7337e19c952137992c9d8733856c8f3c324fa6 Mon Sep 17 00:00:00 2001 From: Steven Schveighoffer Date: Mon, 6 Dec 2021 13:05:28 -0500 Subject: [PATCH 4/9] Vector2Angle returns degrees instead of radians, but all other raymath (#2193) functions use radians, making this awkward to use. --- src/raymath.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raymath.h b/src/raymath.h index 48846a7ad..399c2f6c0 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -281,9 +281,9 @@ RMAPI float Vector2Distance(Vector2 v1, Vector2 v2) // Calculate angle from two vectors in X-axis RMAPI float Vector2Angle(Vector2 v1, Vector2 v2) { - float result = atan2f(v2.y - v1.y, v2.x - v1.x)*(180.0f/PI); + float result = atan2f(v2.y - v1.y, v2.x - v1.x); - if (result < 0) result += 360.0f; + if (result < 0) result += 2 * PI; return result; } From 3cb4ef25990d88cf5c9170cf5c571f5968204be9 Mon Sep 17 00:00:00 2001 From: HarriP Date: Mon, 6 Dec 2021 20:07:05 +0200 Subject: [PATCH 5/9] Fix inverse length in Vector2Normalize (#2189) Following the pattern in Vector3Normalize. --- src/raymath.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/raymath.h b/src/raymath.h index 399c2f6c0..898e48aed 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -328,8 +328,9 @@ RMAPI Vector2 Vector2Normalize(Vector2 v) if (length > 0) { - result.x = v.x*1.0f/length; - result.y = v.y*1.0f/length; + float ilength = 1.0f / length; + result.x = v.x * ilength; + result.y = v.y * ilength; } return result; From e7f48eb16be5fb29e5d639150edc137564f54f59 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Dec 2021 19:08:06 +0100 Subject: [PATCH 6/9] Tweaks --- src/raymath.h | 6 +++--- src/rtextures.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/raymath.h b/src/raymath.h index 898e48aed..624116d46 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -328,9 +328,9 @@ RMAPI Vector2 Vector2Normalize(Vector2 v) if (length > 0) { - float ilength = 1.0f / length; - result.x = v.x * ilength; - result.y = v.y * ilength; + float ilength = 1.0f/length; + result.x = v.x*ilength; + result.y = v.y*ilength; } return result; diff --git a/src/rtextures.c b/src/rtextures.c index cad3545cf..e5c3c100d 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -131,8 +131,8 @@ #endif #if defined(SUPPORT_FILEFORMAT_QOI) - #define QOI_MALLOC RL_MALLOC - #define QOI_FREE RL_FREE + #define QOI_MALLOC RL_MALLOC + #define QOI_FREE RL_FREE #define QOI_IMPLEMENTATION #include "external/qoi.h" From ef6959ed540cd650e13611c35ea543922ab83a98 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 6 Dec 2021 19:53:09 +0100 Subject: [PATCH 7/9] ADDED: raylibVersion symbol #2190 --- src/rcore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rcore.c b/src/rcore.c index ba64d1db1..d24529873 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -487,6 +487,8 @@ static CoreData CORE = { 0 }; // Global CORE state context static char **dirFilesPath = NULL; // Store directory files paths as strings static int dirFileCount = 0; // Count directory files strings +const char *raylibVersion = RAYLIB_VERSION; // raylib version symbol, it could be required for some bindings + #if defined(SUPPORT_SCREEN_CAPTURE) static int screenshotCounter = 0; // Screenshots counter #endif From 3d0b56045a1560ec514098ba5b29c91b3acb5bbf Mon Sep 17 00:00:00 2001 From: Steven Schveighoffer Date: Mon, 6 Dec 2021 18:09:54 -0500 Subject: [PATCH 8/9] Add raylib-d binding. Also fix some spelling/grammar (#2194) --- BINDINGS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BINDINGS.md b/BINDINGS.md index 1f09b428c..9492c2dd1 100644 --- a/BINDINGS.md +++ b/BINDINGS.md @@ -1,6 +1,6 @@ # raylib bindings and wrappers -Some people ported raylib to other languages in form of bindings or wrappers to the library. Here it is alist with all the ports available. Feel free to send a PR if you know of any binding/wrapper not in this list. +Some people ported raylib to other languages in form of bindings or wrappers to the library. Here is a list with all the ports available. Feel free to send a PR if you know of any binding/wrapper not in this list. ### Language Bindings @@ -12,6 +12,7 @@ Some people ported raylib to other languages in form of bindings or wrappers to | raylib-boo | 3.7 | [Boo](http://boo-language.github.io/)| MIT | https://github.com/Rabios/raylib-boo | | bindbc-raylib3 | **4.0** | [D](https://dlang.org/) | BSL-1.0 | https://github.com/o3o/bindbc-raylib3 | | dray | **4.0** | [D](https://dlang.org/) | Apache-2.0 | https://github.com/xdrie/dray | +| raylib-d | **4.0** | [D](https://dlang.org/) | Zlib | https://github.com/schveiguy/raylib-d | | raylib-go | **4.0** | [Go](https://golang.org/) | Zlib | https://github.com/gen2brain/raylib-go | | raylib-rs | 3.5 | [Rust](https://www.rust-lang.org/) | Zlib | https://github.com/deltaphc/raylib-rs | | raylib-lua | **4.0** | [Lua](http://www.lua.org/) | ISC | https://github.com/TSnake41/raylib-lua | From 72f3b00b00b1a1f399169be916de2b3ab8ca0d26 Mon Sep 17 00:00:00 2001 From: Jaedeok Kim Date: Tue, 7 Dec 2021 18:45:36 +0900 Subject: [PATCH 9/9] Fix Vector2Angle() not working as expected (#2196) --- src/raymath.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raymath.h b/src/raymath.h index 624116d46..401b16f44 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -281,7 +281,7 @@ RMAPI float Vector2Distance(Vector2 v1, Vector2 v2) // Calculate angle from two vectors in X-axis RMAPI float Vector2Angle(Vector2 v1, Vector2 v2) { - float result = atan2f(v2.y - v1.y, v2.x - v1.x); + float result = atan2f(v2.y, v2.x) - atan2f(v1.y, v1.x); if (result < 0) result += 2 * PI;