From 099595ae17377028ae5164c4db4fb2ef014956fc Mon Sep 17 00:00:00 2001 From: TSnake41 Date: Sat, 8 Aug 2020 17:32:04 +0200 Subject: [PATCH] Update raylib, reimplement deprecated LoadImageEx LoadImageEx is deprecated in this raylib version, for backward compatibility, it is reimplemented in Lua. --- raygui | 2 +- raylib | 2 +- src/compat.lua | 10 ++++++++++ tools/api.h | 3 ++- tools/rlgl.h | 1 + 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/raygui b/raygui index 3e61557..07b30c3 160000 --- a/raygui +++ b/raygui @@ -1 +1 @@ -Subproject commit 3e61557f251c5c64ed002081870434e9dbaa7ba7 +Subproject commit 07b30c30af7309b396cfa458d30f54b38ef78808 diff --git a/raylib b/raylib index 8fa5c90..ccdd8b5 160000 --- a/raylib +++ b/raylib @@ -1 +1 @@ -Subproject commit 8fa5c902f991e1ed6916d6f3d2a428117ef73857 +Subproject commit ccdd8b5f28f4aaffda2b637e9cb7602ca167ba5f diff --git a/src/compat.lua b/src/compat.lua index 2958a30..457e902 100644 --- a/src/compat.lua +++ b/src/compat.lua @@ -14,6 +14,16 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ]] +-- LoadImageEx removed function +rawset(rl, "LoadImageEx", function (pixels, width, height) + local image = rl.new "Image" + image.width = width + image.height = height + image.data = pixels + image.format = rl.UNCOMPRESSED_R8G8B8A8 + return image +end) + -- math metamethods local new = ffi.new diff --git a/tools/api.h b/tools/api.h index 146acf6..546afcb 100644 --- a/tools/api.h +++ b/tools/api.h @@ -184,8 +184,8 @@ bool CheckCollisionPointRec(Vector2 point, Rectangle rec) bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius) bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3) Image LoadImage(const char *fileName) -Image LoadImageEx(Color *pixels, int width, int height) Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize) +Image LoadImageAnim(const char *fileName, int *frames) void ExportImage(Image image, const char *fileName) void ExportImageAsCode(Image image, const char *fileName) Texture2D LoadTexture(const char *fileName) @@ -343,6 +343,7 @@ Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize) BoundingBox MeshBoundingBox(Mesh mesh) void MeshTangents(Mesh *mesh) void MeshBinormals(Mesh *mesh) +void MeshNormalsSmooth(Mesh *mesh) void DrawModel(Model model, Vector3 position, float scale, Color tint) void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) void DrawModelWires(Model model, Vector3 position, float scale, Color tint) diff --git a/tools/rlgl.h b/tools/rlgl.h index f301f89..96420ca 100644 --- a/tools/rlgl.h +++ b/tools/rlgl.h @@ -45,6 +45,7 @@ unsigned int rlLoadAttribBuffer(unsigned int vaoId, int shaderLoc, void *buffer, void rlglInit(int width, int height) void rlglClose(void) void rlglDraw(void) +void rlCheckErrors(void) int rlGetVersion(void) bool rlCheckBufferLimit(int vCount) void rlSetDebugMarker(const char *text)