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 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 | 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 diff --git a/src/raymath.h b/src/raymath.h index 48846a7ad..401b16f44 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, v2.x) - atan2f(v1.y, v1.x); - if (result < 0) result += 360.0f; + if (result < 0) result += 2 * PI; return result; } @@ -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; diff --git a/src/rcore.c b/src/rcore.c index 2e0895cb2..ed341028c 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 @@ -701,6 +703,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; @@ -3292,7 +3323,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) 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"