aboutsummaryrefslogtreecommitdiff
path: root/src/physac.c
diff options
context:
space:
mode:
authorJoshua Reisenauer <kd7tck@msn.com>2016-05-22 15:03:10 -0700
committerJoshua Reisenauer <kd7tck@msn.com>2016-05-22 15:03:10 -0700
commitf232f34981c9ccc757e486c116db6d22d3042694 (patch)
tree26adf20c7a1f71cfc986df22c0f5e15520485ec1 /src/physac.c
parentcd7f25830bcf1f1bdc2efcde8ec70759b8eac3fc (diff)
parent9811a376902b0f568f31d2e8aace28144fbf33ff (diff)
downloadraylib-f232f34981c9ccc757e486c116db6d22d3042694.tar.gz
raylib-f232f34981c9ccc757e486c116db6d22d3042694.zip
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
Diffstat (limited to 'src/physac.c')
-rw-r--r--src/physac.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/physac.c b/src/physac.c
index ed707474..181488ac 100644
--- a/src/physac.c
+++ b/src/physac.c
@@ -49,7 +49,7 @@
//----------------------------------------------------------------------------------
// Global Variables Definition
//----------------------------------------------------------------------------------
-static PhysicObject *physicObjects[MAX_PHYSIC_OBJECTS]; // Physic objects pool
+static PhysicObject physicObjects[MAX_PHYSIC_OBJECTS]; // Physic objects pool
static int physicObjectsCount; // Counts current enabled physic objects
static Vector2 gravityForce; // Gravity force
@@ -463,10 +463,10 @@ void ClosePhysics()
}
// Create a new physic object dinamically, initialize it and add to pool
-PhysicObject *CreatePhysicObject(Vector2 position, float rotation, Vector2 scale)
+PhysicObject CreatePhysicObject(Vector2 position, float rotation, Vector2 scale)
{
// Allocate dynamic memory
- PhysicObject *obj = (PhysicObject *)malloc(sizeof(PhysicObject));
+ PhysicObject obj = (PhysicObject)malloc(sizeof(PhysicObjectData));
// Initialize physic object values with generic values
obj->id = physicObjectsCount;
@@ -498,7 +498,7 @@ PhysicObject *CreatePhysicObject(Vector2 position, float rotation, Vector2 scale
}
// Destroy a specific physic object and take it out of the list
-void DestroyPhysicObject(PhysicObject *pObj)
+void DestroyPhysicObject(PhysicObject pObj)
{
// Free dynamic memory allocation
free(physicObjects[pObj->id]);
@@ -520,7 +520,7 @@ void DestroyPhysicObject(PhysicObject *pObj)
}
// Apply directional force to a physic object
-void ApplyForce(PhysicObject *pObj, Vector2 force)
+void ApplyForce(PhysicObject pObj, Vector2 force)
{
if (pObj->rigidbody.enabled)
{
@@ -571,7 +571,7 @@ Rectangle TransformToRectangle(Transform transform)
}
// Draw physic object information at screen position
-void DrawPhysicObjectInfo(PhysicObject *pObj, Vector2 position, int fontSize)
+void DrawPhysicObjectInfo(PhysicObject pObj, Vector2 position, int fontSize)
{
// Draw physic object ID
DrawText(FormatText("PhysicObject ID: %i - Enabled: %i", pObj->id, pObj->enabled), position.x, position.y, fontSize, BLACK);