From 88b7d0f17e9aa78416438af6c9ced6aff5104088 Mon Sep 17 00:00:00 2001 From: TSnake41 Date: Thu, 28 Jan 2021 23:42:11 +0100 Subject: [PATCH] Update raylib and raygui binding. --- raygui | 2 +- raylib | 2 +- src/raylib.lua | 24 +++++++++++++++++------- src/raylua.c | 1 - tools/api.h | 4 ++++ tools/physac.h | 13 ++++++------- 6 files changed, 29 insertions(+), 17 deletions(-) diff --git a/raygui b/raygui index f5bd6c0..28d7584 160000 --- a/raygui +++ b/raygui @@ -1 +1 @@ -Subproject commit f5bd6c08f8d761b625890e4256339ff93c770ac1 +Subproject commit 28d7584fc1ad11aff3bb59de130ffca45b4dd7b3 diff --git a/raylib b/raylib index e25e380..bc33201 160000 --- a/raylib +++ b/raylib @@ -1 +1 @@ -Subproject commit e25e380e80a117f2404d65b37700fb620dc1f990 +Subproject commit bc332018f67fc6dcefd9f236b9147f20f17f86ab diff --git a/src/raylib.lua b/src/raylib.lua index 3ebcea9..1c12e42 100644 --- a/src/raylib.lua +++ b/src/raylib.lua @@ -660,11 +660,8 @@ ffi.cdef [[ -- Physac cdef ffi.cdef [[ + typedef enum PhysicsShapeType { PHYSICS_CIRCLE = 0, PHYSICS_POLYGON } PhysicsShapeType; typedef struct PhysicsBodyData *PhysicsBody; - typedef enum PhysicsShapeType { - PHYSICS_CIRCLE, - PHYSICS_POLYGON - } PhysicsShapeType; typedef struct Matrix2x2 { float m00; @@ -673,18 +670,18 @@ ffi.cdef [[ float m11; } Matrix2x2; - typedef struct PolygonData { + typedef struct PhysicsVertexData { unsigned int vertexCount; Vector2 positions[24]; Vector2 normals[24]; - } PolygonData; +} PhysicsVertexData; typedef struct PhysicsShape { PhysicsShapeType type; PhysicsBody body; + PhysicsVertexData vertexData; float radius; Matrix2x2 transform; - PolygonData vertexData; } PhysicsShape; typedef struct PhysicsBodyData { @@ -708,6 +705,19 @@ ffi.cdef [[ bool freezeOrient; PhysicsShape shape; } PhysicsBodyData; + + typedef struct PhysicsManifoldData { + unsigned int id; + PhysicsBody bodyA; + PhysicsBody bodyB; + float penetration; + Vector2 normal; + Vector2 contacts[2]; + unsigned int contactsCount; + float restitution; + float dynamicFriction; + float staticFriction; + } PhysicsManifoldData, *PhysicsManifold; ]] -- gestures cdef diff --git a/src/raylua.c b/src/raylua.c index 8d0c2c4..e239231 100644 --- a/src/raylua.c +++ b/src/raylua.c @@ -33,7 +33,6 @@ #include #define PHYSAC_IMPLEMENTATION -#define PHYSAC_NO_THREADS #include #include "autogen/bind.c" diff --git a/tools/api.h b/tools/api.h index 46ef8f1..5b565da 100644 --- a/tools/api.h +++ b/tools/api.h @@ -25,6 +25,7 @@ void *GetWindowHandle(void) int GetScreenWidth(void) int GetScreenHeight(void) int GetMonitorCount(void) +int GetCurrentMonitor(void) Vector2 GetMonitorPosition(int monitor) int GetMonitorWidth(int monitor) int GetMonitorHeight(int monitor) @@ -117,6 +118,7 @@ bool IsGamepadButtonUp(int gamepad, int button) int GetGamepadButtonPressed(void) int GetGamepadAxisCount(int gamepad) float GetGamepadAxisMovement(int gamepad, int axis) +int SetGamepadMappings(const char *mappings) bool IsMouseButtonPressed(int button) bool IsMouseButtonDown(int button) bool IsMouseButtonReleased(int button) @@ -154,6 +156,7 @@ void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color colo void DrawLineV(Vector2 startPos, Vector2 endPos, Color color) void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color) void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color) +void DrawLineBezierQuad(Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thick, Color color) void DrawLineStrip(Vector2 *points, int pointsCount, Color color) void DrawCircle(int centerX, int centerY, float radius, Color color) void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color) @@ -347,6 +350,7 @@ void UnloadModelKeepMeshes(Model model) Mesh *LoadMeshes(const char *fileName, int *meshCount) bool ExportMesh(Mesh mesh, const char *fileName) void UnloadMesh(Mesh mesh) +void UploadMesh(Mesh *mesh) Material *LoadMaterials(const char *fileName, int *materialCount) Material LoadMaterialDefault(void) void UnloadMaterial(Material material) diff --git a/tools/physac.h b/tools/physac.h index e2cbfc3..2a91f16 100644 --- a/tools/physac.h +++ b/tools/physac.h @@ -1,20 +1,19 @@ void InitPhysics(void) -void RunPhysicsStep(void) +void UpdatePhysics(void) +void ResetPhysics(void) +void ClosePhysics(void) void SetPhysicsTimeStep(double delta) -bool IsPhysicsEnabled(void) void SetPhysicsGravity(float x, float y) PhysicsBody CreatePhysicsBodyCircle(Vector2 pos, float radius, float density) PhysicsBody CreatePhysicsBodyRectangle(Vector2 pos, float width, float height, float density) PhysicsBody CreatePhysicsBodyPolygon(Vector2 pos, float radius, int sides, float density) +void DestroyPhysicsBody(PhysicsBody body) void PhysicsAddForce(PhysicsBody body, Vector2 force) void PhysicsAddTorque(PhysicsBody body, float amount) void PhysicsShatter(PhysicsBody body, Vector2 position, float force) -int GetPhysicsBodiesCount(void) +void SetPhysicsBodyRotation(PhysicsBody body, float radians) PhysicsBody GetPhysicsBody(int index) +int GetPhysicsBodiesCount(void) int GetPhysicsShapeType(int index) int GetPhysicsShapeVerticesCount(int index) Vector2 GetPhysicsShapeVertex(PhysicsBody body, int vertex) -void SetPhysicsBodyRotation(PhysicsBody body, float radians) -void DestroyPhysicsBody(PhysicsBody body) -void ResetPhysics(void) -void ClosePhysics(void)