summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/others/iqm_loader/riqm.h117
-rw-r--r--examples/physac/physics_demo.c6
-rw-r--r--examples/physac/physics_friction.c4
-rw-r--r--examples/physac/physics_movement.c4
-rw-r--r--examples/physac/physics_restitution.c4
-rw-r--r--examples/physac/physics_shatter.c7
-rw-r--r--examples/textures/textures_image_processing.c6
-rw-r--r--examples/textures/textures_image_text.c6
-rw-r--r--examples/textures/textures_particles_blending.c6
-rw-r--r--examples/textures/textures_srcrec_dstrec.c12
10 files changed, 94 insertions, 78 deletions
diff --git a/examples/others/iqm_loader/riqm.h b/examples/others/iqm_loader/riqm.h
index 24ed3686..694e3a95 100644
--- a/examples/others/iqm_loader/riqm.h
+++ b/examples/others/iqm_loader/riqm.h
@@ -64,29 +64,32 @@ typedef struct Pose {
} Pose;
typedef struct Animation {
- int jointCount;
- Joint *joints; // NOTE: Joints in anims do not have names
+ int jointCount; // Number of joints (bones)
+ Joint *joints; // Joints array
+ // NOTE: Joints in anims do not have names
- int frameCount;
- float framerate;
+ int frameCount; // Number of animation frames
+ float framerate; // Frame change speed
- Pose **framepose;
+ Pose **framepose; // Poses array by frame (and one pose by joint)
} Animation;
// Animated Model type
typedef struct AnimatedModel {
- int meshCount;
- Mesh *mesh;
-
- int materialCount;
- int *meshMaterialId;
- Material *materials;
+ Matrix transform; // Local transform matrix
+
+ int meshCount; // Number of meshes
+ Mesh *meshes; // Meshes array
- int jointCount;
- Joint *joints;
+ int materialCount; // Number of materials
+ Material *materials; // Materials array
+
+ int *meshMaterialId; // Mesh materials ids
- Pose *basepose;
- Matrix transform;
+ // Animation required data
+ int jointCount; // Number of joints (and keyposes)
+ Joint *joints; // Mesh joints (bones)
+ Pose *basepose; // Mesh base-poses by joint
} AnimatedModel;
//----------------------------------------------------------------------------------
@@ -233,7 +236,7 @@ AnimatedModel LoadAnimatedModel(const char *filename)
{
AnimatedModel out = LoadIQM(filename);
- for (int i = 0; i < out.meshCount; i++) rlLoadMesh(&out.mesh[i], false);
+ for (int i = 0; i < out.meshCount; i++) rlLoadMesh(&out.meshes[i], false);
out.transform = MatrixIdentity();
out.meshMaterialId = malloc(sizeof(int)*out.meshCount);
@@ -258,7 +261,7 @@ AnimatedModel AnimatedModelAddTexture(AnimatedModel model, const char *filename)
return model;
}
-// Set the material for a mesh
+// Set the material for a meshes
AnimatedModel SetMeshMaterial(AnimatedModel model, int meshid, int textureid)
{
if (meshid > model.meshCount)
@@ -466,9 +469,9 @@ void UnloadAnimatedModel(AnimatedModel model)
free(model.joints);
free(model.basepose);
- for (int i = 0; i < model.meshCount; i++) rlUnloadMesh(&model.mesh[i]);
+ for (int i = 0; i < model.meshCount; i++) rlUnloadMesh(&model.meshes[i]);
- free(model.mesh);
+ free(model.meshes);
}
// Unload animation
@@ -515,9 +518,9 @@ void AnimateModel(AnimatedModel model, Animation anim, int frame)
int wcounter = 0;
int weightId = 0;
- for (int i = 0; i < model.mesh[m].vertexCount; i++)
+ for (int i = 0; i < model.meshes[m].vertexCount; i++)
{
- weightId = model.mesh[m].weightId[wcounter];
+ weightId = model.meshes[m].weightId[wcounter];
baset = model.basepose[weightId].translation;
baser = model.basepose[weightId].rotation;
bases = model.basepose[weightId].scale;
@@ -526,23 +529,23 @@ void AnimateModel(AnimatedModel model, Animation anim, int frame)
outs = anim.framepose[frame][weightId].scale;
// vertices
- // NOTE: We use mesh.baseVertices (default position) to calculate mesh.vertices (animated position)
- outv = (Vector3){ model.mesh[m].baseVertices[vcounter], model.mesh[m].baseVertices[vcounter + 1], model.mesh[m].baseVertices[vcounter + 2] };
+ // NOTE: We use meshes.baseVertices (default position) to calculate meshes.vertices (animated position)
+ outv = (Vector3){ model.meshes[m].baseVertices[vcounter], model.meshes[m].baseVertices[vcounter + 1], model.meshes[m].baseVertices[vcounter + 2] };
outv = Vector3MultiplyV(outv, outs);
outv = Vector3Subtract(outv, baset);
outv = Vector3RotateByQuaternion(outv, QuaternionMultiply(outr, QuaternionInvert(baser)));
outv = Vector3Add(outv, outt);
- model.mesh[m].vertices[vcounter] = outv.x;
- model.mesh[m].vertices[vcounter + 1] = outv.y;
- model.mesh[m].vertices[vcounter + 2] = outv.z;
+ model.meshes[m].vertices[vcounter] = outv.x;
+ model.meshes[m].vertices[vcounter + 1] = outv.y;
+ model.meshes[m].vertices[vcounter + 2] = outv.z;
// normals
- // NOTE: We use mesh.baseNormals (default normal) to calculate mesh.normals (animated normals)
- outn = (Vector3){ model.mesh[m].baseNormals[vcounter], model.mesh[m].baseNormals[vcounter + 1], model.mesh[m].baseNormals[vcounter + 2] };
+ // NOTE: We use meshes.baseNormals (default normal) to calculate meshes.normals (animated normals)
+ outn = (Vector3){ model.meshes[m].baseNormals[vcounter], model.meshes[m].baseNormals[vcounter + 1], model.meshes[m].baseNormals[vcounter + 2] };
outn = Vector3RotateByQuaternion(outn, QuaternionMultiply(outr, QuaternionInvert(baser)));
- model.mesh[m].normals[vcounter] = outn.x;
- model.mesh[m].normals[vcounter + 1] = outn.y;
- model.mesh[m].normals[vcounter + 2] = outn.z;
+ model.meshes[m].normals[vcounter] = outn.x;
+ model.meshes[m].normals[vcounter + 1] = outn.y;
+ model.meshes[m].normals[vcounter + 2] = outn.z;
vcounter += 3;
wcounter += 4;
}
@@ -563,7 +566,7 @@ void DrawAnimatedModelEx(AnimatedModel model, Vector3 position, Vector3 rotation
{
if (model.materialCount == 0)
{
- TraceLog(LOG_WARNING,"No materials set, can't draw animated mesh\n");
+ TraceLog(LOG_WARNING,"No materials set, can't draw animated meshes\n");
return;
}
@@ -576,9 +579,9 @@ void DrawAnimatedModelEx(AnimatedModel model, Vector3 position, Vector3 rotation
for (int i = 0; i < model.meshCount; i++)
{
- rlUpdateMesh(model.mesh[i], 0, model.mesh[i].vertexCount); // Update vertex position
- rlUpdateMesh(model.mesh[i], 2, model.mesh[i].vertexCount); // Update vertex normals
- rlDrawMesh(model.mesh[i], model.materials[model.meshMaterialId[i]], model.transform); // Draw mesh
+ rlUpdateMesh(model.meshes[i], 0, model.meshes[i].vertexCount); // Update vertex position
+ rlUpdateMesh(model.meshes[i], 2, model.meshes[i].vertexCount); // Update vertex normals
+ rlDrawMesh(model.meshes[i], model.materials[model.meshMaterialId[i]], model.transform); // Draw meshes
}
}
@@ -632,7 +635,7 @@ static AnimatedModel LoadIQM(const char *filename)
fread(imesh, sizeof(IQMMesh)*iqm.num_meshes, 1, iqmFile);
model.meshCount = iqm.num_meshes;
- model.mesh = malloc(sizeof(Mesh)*iqm.num_meshes);
+ model.meshes = malloc(sizeof(Mesh)*iqm.num_meshes);
char name[MESH_NAME_LENGTH];
@@ -640,21 +643,21 @@ static AnimatedModel LoadIQM(const char *filename)
{
fseek(iqmFile,iqm.ofs_text+imesh[i].name,SEEK_SET);
fread(name, sizeof(char)*MESH_NAME_LENGTH, 1, iqmFile); // Mesh name not used...
- model.mesh[i].vertexCount = imesh[i].num_vertexes;
+ model.meshes[i].vertexCount = imesh[i].num_vertexes;
- model.mesh[i].baseVertices = malloc(sizeof(float)*imesh[i].num_vertexes*3); // Default IQM base position
- model.mesh[i].baseNormals = malloc(sizeof(float)*imesh[i].num_vertexes*3); // Default IQM base normal
+ model.meshes[i].baseVertices = malloc(sizeof(float)*imesh[i].num_vertexes*3); // Default IQM base position
+ model.meshes[i].baseNormals = malloc(sizeof(float)*imesh[i].num_vertexes*3); // Default IQM base normal
- model.mesh[i].texcoords = malloc(sizeof(float)*imesh[i].num_vertexes*2);
- model.mesh[i].weightId = malloc(sizeof(int)*imesh[i].num_vertexes*4);
- model.mesh[i].weightBias = malloc(sizeof(float)*imesh[i].num_vertexes*4);
+ model.meshes[i].texcoords = malloc(sizeof(float)*imesh[i].num_vertexes*2);
+ model.meshes[i].weightId = malloc(sizeof(int)*imesh[i].num_vertexes*4);
+ model.meshes[i].weightBias = malloc(sizeof(float)*imesh[i].num_vertexes*4);
- model.mesh[i].triangleCount = imesh[i].num_triangles;
- model.mesh[i].indices = malloc(sizeof(unsigned short)*imesh[i].num_triangles*3);
+ model.meshes[i].triangleCount = imesh[i].num_triangles;
+ model.meshes[i].indices = malloc(sizeof(unsigned short)*imesh[i].num_triangles*3);
- // What we actually process for rendering, should be updated transforming mesh.vertices and mesh.normals
- model.mesh[i].vertices = malloc(sizeof(float)*imesh[i].num_vertexes*3);
- model.mesh[i].normals = malloc(sizeof(float)*imesh[i].num_vertexes*3);
+ // What we actually process for rendering, should be updated transforming meshes.vertices and meshes.normals
+ model.meshes[i].vertices = malloc(sizeof(float)*imesh[i].num_vertexes*3);
+ model.meshes[i].normals = malloc(sizeof(float)*imesh[i].num_vertexes*3);
}
// tris
@@ -669,9 +672,9 @@ static AnimatedModel LoadIQM(const char *filename)
for (int i = imesh[m].first_triangle; i < imesh[m].first_triangle+imesh[m].num_triangles; i++)
{
// IQM triangles are stored counter clockwise, but raylib sets opengl to clockwise drawing, so we swap them around
- model.mesh[m].indices[tcounter+2] = tri[i].vertex[0] - imesh[m].first_vertex;
- model.mesh[m].indices[tcounter+1] = tri[i].vertex[1] - imesh[m].first_vertex;
- model.mesh[m].indices[tcounter] = tri[i].vertex[2] - imesh[m].first_vertex;
+ model.meshes[m].indices[tcounter+2] = tri[i].vertex[0] - imesh[m].first_vertex;
+ model.meshes[m].indices[tcounter+1] = tri[i].vertex[1] - imesh[m].first_vertex;
+ model.meshes[m].indices[tcounter] = tri[i].vertex[2] - imesh[m].first_vertex;
tcounter += 3;
}
}
@@ -696,8 +699,8 @@ static AnimatedModel LoadIQM(const char *filename)
int vcounter = 0;
for (int i = imesh[m].first_vertex*3; i < (imesh[m].first_vertex + imesh[m].num_vertexes)*3; i++)
{
- model.mesh[m].vertices[vcounter] = vertex[i];
- model.mesh[m].baseVertices[vcounter] = vertex[i];
+ model.meshes[m].vertices[vcounter] = vertex[i];
+ model.meshes[m].baseVertices[vcounter] = vertex[i];
vcounter++;
}
}
@@ -713,8 +716,8 @@ static AnimatedModel LoadIQM(const char *filename)
int vcounter = 0;
for (int i = imesh[m].first_vertex*3; i < (imesh[m].first_vertex + imesh[m].num_vertexes)*3; i++)
{
- model.mesh[m].normals[vcounter] = normal[i];
- model.mesh[m].baseNormals[vcounter] = normal[i];
+ model.meshes[m].normals[vcounter] = normal[i];
+ model.meshes[m].baseNormals[vcounter] = normal[i];
vcounter++;
}
}
@@ -730,7 +733,7 @@ static AnimatedModel LoadIQM(const char *filename)
int vcounter = 0;
for (int i = imesh[m].first_vertex*2; i < (imesh[m].first_vertex + imesh[m].num_vertexes)*2; i++)
{
- model.mesh[m].texcoords[vcounter] = text[i];
+ model.meshes[m].texcoords[vcounter] = text[i];
vcounter++;
}
}
@@ -746,7 +749,7 @@ static AnimatedModel LoadIQM(const char *filename)
int vcounter = 0;
for (int i = imesh[m].first_vertex*4; i < (imesh[m].first_vertex + imesh[m].num_vertexes)*4; i++)
{
- model.mesh[m].weightId[vcounter] = blendi[i];
+ model.meshes[m].weightId[vcounter] = blendi[i];
vcounter++;
}
}
@@ -762,7 +765,7 @@ static AnimatedModel LoadIQM(const char *filename)
int vcounter = 0;
for (int i = imesh[m].first_vertex*4; i < (imesh[m].first_vertex + imesh[m].num_vertexes)*4; i++)
{
- model.mesh[m].weightBias[vcounter] = blendw[i]/255.0f;
+ model.meshes[m].weightBias[vcounter] = blendw[i]/255.0f;
vcounter++;
}
}
diff --git a/examples/physac/physics_demo.c b/examples/physac/physics_demo.c
index 273b9931..d417efec 100644
--- a/examples/physac/physics_demo.c
+++ b/examples/physac/physics_demo.c
@@ -17,6 +17,7 @@
#include "raylib.h"
#define PHYSAC_IMPLEMENTATION
+#define PHYSAC_NO_THREADS
#include "physac.h"
int main()
@@ -54,6 +55,8 @@ int main()
// Update
//----------------------------------------------------------------------------------
// Delay initialization of variables due to physics reset async
+ RunPhysicsStep();
+
if (needsReset)
{
floor = CreatePhysicsBodyRectangle((Vector2){ screenWidth/2, screenHeight }, 500, 100, 10);
@@ -61,6 +64,8 @@ int main()
circle = CreatePhysicsBodyCircle((Vector2){ screenWidth/2, screenHeight/2 }, 45, 10);
circle->enabled = false;
+
+ needsReset = false;
}
// Reset physics input
@@ -134,4 +139,3 @@ int main()
return 0;
}
-
diff --git a/examples/physac/physics_friction.c b/examples/physac/physics_friction.c
index b4cc571d..99491eeb 100644
--- a/examples/physac/physics_friction.c
+++ b/examples/physac/physics_friction.c
@@ -17,6 +17,7 @@
#include "raylib.h"
#define PHYSAC_IMPLEMENTATION
+#define PHYSAC_NO_THREADS
#include "physac.h"
int main()
@@ -71,6 +72,8 @@ int main()
{
// Update
//----------------------------------------------------------------------------------
+ RunPhysicsStep();
+
if (IsKeyPressed('R')) // Reset physics input
{
// Reset dynamic physics bodies position, velocity and rotation
@@ -141,4 +144,3 @@ int main()
return 0;
}
-
diff --git a/examples/physac/physics_movement.c b/examples/physac/physics_movement.c
index 3ca69671..4c4f259f 100644
--- a/examples/physac/physics_movement.c
+++ b/examples/physac/physics_movement.c
@@ -17,6 +17,7 @@
#include "raylib.h"
#define PHYSAC_IMPLEMENTATION
+#define PHYSAC_NO_THREADS
#include "physac.h"
#define VELOCITY 0.5f
@@ -64,6 +65,8 @@ int main()
{
// Update
//----------------------------------------------------------------------------------
+ RunPhysicsStep();
+
if (IsKeyPressed('R')) // Reset physics input
{
// Reset movement physics body position, velocity and rotation
@@ -127,4 +130,3 @@ int main()
return 0;
}
-
diff --git a/examples/physac/physics_restitution.c b/examples/physac/physics_restitution.c
index 8e26c93f..d2ec49db 100644
--- a/examples/physac/physics_restitution.c
+++ b/examples/physac/physics_restitution.c
@@ -17,6 +17,7 @@
#include "raylib.h"
#define PHYSAC_IMPLEMENTATION
+#define PHYSAC_NO_THREADS
#include "physac.h"
int main()
@@ -57,6 +58,8 @@ int main()
{
// Update
//----------------------------------------------------------------------------------
+ RunPhysicsStep();
+
if (IsKeyPressed('R')) // Reset physics input
{
// Reset circles physics bodies position and velocity
@@ -120,4 +123,3 @@ int main()
return 0;
}
-
diff --git a/examples/physac/physics_shatter.c b/examples/physac/physics_shatter.c
index e34d6cec..17f9bfc2 100644
--- a/examples/physac/physics_shatter.c
+++ b/examples/physac/physics_shatter.c
@@ -17,7 +17,8 @@
#include "raylib.h"
#define PHYSAC_IMPLEMENTATION
-#include "physac.h"
+#define PHYSAC_NO_THREADS
+#include "physac.h"
int main()
{
@@ -48,12 +49,15 @@ int main()
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
+ RunPhysicsStep();
+
//----------------------------------------------------------------------------------
// Delay initialization of variables due to physics reset asynchronous
if (needsReset)
{
// Create random polygon physics body to shatter
CreatePhysicsBodyPolygon((Vector2){ screenWidth/2, screenHeight/2 }, GetRandomValue(80, 200), GetRandomValue(3, 8), 10);
+ needsReset = false;
}
if (IsKeyPressed('R')) // Reset physics input
@@ -118,4 +122,3 @@ int main()
return 0;
}
-
diff --git a/examples/textures/textures_image_processing.c b/examples/textures/textures_image_processing.c
index 427faa60..6d33d95b 100644
--- a/examples/textures/textures_image_processing.c
+++ b/examples/textures/textures_image_processing.c
@@ -59,7 +59,7 @@ int main()
Rectangle selectRecs[NUM_PROCESSES];
- for (int i = 0; i < NUM_PROCESSES; i++) selectRecs[i] = (Rectangle){ 40, 50 + 32*i, 150, 30 };
+ for (int i = 0; i < NUM_PROCESSES; i++) selectRecs[i] = (Rectangle){ 40.0f, (float)(50 + 32*i), 150.0f, 30.0f };
SetTargetFPS(60);
//---------------------------------------------------------------------------------------
@@ -122,8 +122,8 @@ int main()
for (int i = 0; i < NUM_PROCESSES; i++)
{
DrawRectangleRec(selectRecs[i], (i == currentProcess) ? SKYBLUE : LIGHTGRAY);
- DrawRectangleLines(selectRecs[i].x, selectRecs[i].y, selectRecs[i].width, selectRecs[i].height, (i == currentProcess) ? BLUE : GRAY);
- DrawText(processText[i], selectRecs[i].x + selectRecs[i].width/2 - MeasureText(processText[i], 10)/2, selectRecs[i].y + 11, 10, (i == currentProcess) ? DARKBLUE : DARKGRAY);
+ DrawRectangleLines((int)selectRecs[i].x, (int) selectRecs[i].y, (int) selectRecs[i].width, (int) selectRecs[i].height, (i == currentProcess) ? BLUE : GRAY);
+ DrawText( processText[i], (int)( selectRecs[i].x + selectRecs[i].width/2 - MeasureText(processText[i], 10)/2), (int) selectRecs[i].y + 11, 10, (i == currentProcess) ? DARKBLUE : DARKGRAY);
}
DrawTexture(texture, screenWidth - texture.width - 60, screenHeight/2 - texture.height/2, WHITE);
diff --git a/examples/textures/textures_image_text.c b/examples/textures/textures_image_text.c
index 78d25c14..c69f0f55 100644
--- a/examples/textures/textures_image_text.c
+++ b/examples/textures/textures_image_text.c
@@ -26,12 +26,12 @@ int main()
Image parrots = LoadImage("resources/parrots.png"); // Load image in CPU memory (RAM)
// Draw over image using custom font
- ImageDrawTextEx(&parrots, (Vector2){ 20, 20 }, font, "[Parrots font drawing]", font.baseSize, 0, WHITE);
+ ImageDrawTextEx(&parrots, (Vector2){ 20.0f, 20.0f }, font, "[Parrots font drawing]", (float)font.baseSize, 0.0f, WHITE);
Texture2D texture = LoadTextureFromImage(parrots); // Image converted to texture, uploaded to GPU memory (VRAM)
UnloadImage(parrots); // Once image has been converted to texture and uploaded to VRAM, it can be unloaded from RAM
- Vector2 position = { screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2 - 20 };
+ Vector2 position = { (float)(screenWidth/2 - texture.width/2), (float)(screenHeight/2 - texture.height/2 - 20) };
bool showFont = false;
@@ -60,7 +60,7 @@ int main()
// Draw text directly using sprite font
DrawTextEx(font, "[Parrots font drawing]", (Vector2){ position.x + 20,
- position.y + 20 + 280 }, font.baseSize, 0, WHITE);
+ position.y + 20 + 280 }, (float)font.baseSize, 0.0f, WHITE);
}
else DrawTexture(font.texture, screenWidth/2 - font.texture.width/2, 50, BLACK);
diff --git a/examples/textures/textures_particles_blending.c b/examples/textures/textures_particles_blending.c
index 842ac77d..3b7dcaa3 100644
--- a/examples/textures/textures_particles_blending.c
+++ b/examples/textures/textures_particles_blending.c
@@ -42,7 +42,7 @@ int main()
mouseTail[i].color = (Color){ GetRandomValue(0, 255), GetRandomValue(0, 255), GetRandomValue(0, 255), 255 };
mouseTail[i].alpha = 1.0f;
mouseTail[i].size = (float)GetRandomValue(1, 30)/20.0f;
- mouseTail[i].rotation = GetRandomValue(0, 360);
+ mouseTail[i].rotation = (float)GetRandomValue(0, 360);
mouseTail[i].active = false;
}
@@ -107,9 +107,9 @@ int main()
// Draw active particles
for (int i = 0; i < MAX_PARTICLES; i++)
{
- if (mouseTail[i].active) DrawTexturePro(smoke, (Rectangle){ 0, 0, smoke.width, smoke.height },
+ if (mouseTail[i].active) DrawTexturePro(smoke, (Rectangle){ 0.0f, 0.0f, (float)smoke.width, (float)smoke.height },
(Rectangle){ mouseTail[i].position.x, mouseTail[i].position.y, smoke.width*mouseTail[i].size, smoke.height*mouseTail[i].size },
- (Vector2){ smoke.width*mouseTail[i].size/2, smoke.height*mouseTail[i].size/2 }, mouseTail[i].rotation,
+ (Vector2){ (float)(smoke.width*mouseTail[i].size/2.0f), (float)(smoke.height*mouseTail[i].size/2.0f) }, mouseTail[i].rotation,
Fade(mouseTail[i].color, mouseTail[i].alpha));
}
diff --git a/examples/textures/textures_srcrec_dstrec.c b/examples/textures/textures_srcrec_dstrec.c
index 53ffd1d0..cc08eb58 100644
--- a/examples/textures/textures_srcrec_dstrec.c
+++ b/examples/textures/textures_srcrec_dstrec.c
@@ -27,13 +27,13 @@ int main()
int frameHeight = scarfy.height;
// NOTE: Source rectangle (part of the texture to use for drawing)
- Rectangle sourceRec = { 0, 0, frameWidth, frameHeight };
+ Rectangle sourceRec = { 0.0f, 0.0f, (float)frameWidth, (float)frameHeight };
// NOTE: Destination rectangle (screen rectangle where drawing part of texture)
- Rectangle destRec = { screenWidth/2, screenHeight/2, frameWidth*2, frameHeight*2 };
+ Rectangle destRec = { (float)screenWidth/2, (float)screenHeight/2, (float)frameWidth*2, (float)frameHeight*2 };
// NOTE: Origin of the texture (rotation/scale point), it's relative to destination rectangle size
- Vector2 origin = { frameWidth, frameHeight };
+ Vector2 origin = { (float)frameWidth, (float)frameHeight };
int rotation = 0;
@@ -59,10 +59,10 @@ int main()
// destRec defines the rectangle where our texture part will fit (scaling it to fit)
// origin defines the point of the texture used as reference for rotation and scaling
// rotation defines the texture rotation (using origin as rotation point)
- DrawTexturePro(scarfy, sourceRec, destRec, origin, rotation, WHITE);
+ DrawTexturePro(scarfy, sourceRec, destRec, origin, (float)rotation, WHITE);
- DrawLine(destRec.x, 0, destRec.x, screenHeight, GRAY);
- DrawLine(0, destRec.y, screenWidth, destRec.y, GRAY);
+ DrawLine((int) destRec.x, 0, (int) destRec.x, screenHeight, GRAY);
+ DrawLine(0, (int)destRec.y, screenWidth, (int)destRec.y, GRAY);
DrawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, GRAY);