From 1cc6c02b62721b61f00843dc175d9ea5b764824e Mon Sep 17 00:00:00 2001 From: Gianni Alessandroni <45824238+NotManyIdeasDev@users.noreply.github.com> Date: Sun, 9 May 2021 19:45:22 +0200 Subject: [PATCH] Fixed Typecasts Fixed compiler errors (implicit conversions) --- .../core/core_2d_camera_smooth_pixelperfect.c | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/examples/core/core_2d_camera_smooth_pixelperfect.c b/examples/core/core_2d_camera_smooth_pixelperfect.c index 46602e0ce..7d8b30492 100644 --- a/examples/core/core_2d_camera_smooth_pixelperfect.c +++ b/examples/core/core_2d_camera_smooth_pixelperfect.c @@ -61,7 +61,7 @@ int main(void) cameraX = (sin(GetTime()) * 50.0f) - 10.0f; cameraY = cos(GetTime()) * 30.0f; - screenSpaceCamera.target = { cameraX, cameraY }; + screenSpaceCamera.target = (Vector2){ cameraX, cameraY }; if (screenSpaceCamera.target.x >= 1 || screenSpaceCamera.target.x <= -1) // Round worldCamera's X, keep the decimals on screenSpaceCamera. { @@ -105,12 +105,21 @@ int main(void) // Also the renderTexture's height is flipped (in the source Rectangle), due to OpenGL reasons. DrawTexturePro( renderTexture.texture, - { 0.0f, 0.0f, (float)renderTexture.texture.width, (float)-renderTexture.texture.height }, - { -virtualRatio, -virtualRatio, screenWidth + (virtualRatio * 2), screenHeight + (virtualRatio * 2) }, - { 0.0f, 0.0f }, - 0.0f, - WHITE - ); + (Rectangle) + { + 0.0f, 0.0f, (float)renderTexture.texture.width, (float)-renderTexture.texture.height + }, + (Rectangle) + { + -virtualRatio, -virtualRatio, screenWidth + (virtualRatio * 2), screenHeight + (virtualRatio * 2) + }, + (Vector2) + { + 0.0f, 0.0f + }, + 0.0f, + WHITE + ); EndMode2D();