Fixed Typecasts

Fixed compiler errors (implicit conversions)
This commit is contained in:
Gianni Alessandroni 2021-05-09 19:45:22 +02:00
parent 4e3757bc1a
commit 1cc6c02b62

View File

@ -61,7 +61,7 @@ int main(void)
cameraX = (sin(GetTime()) * 50.0f) - 10.0f; cameraX = (sin(GetTime()) * 50.0f) - 10.0f;
cameraY = cos(GetTime()) * 30.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. if (screenSpaceCamera.target.x >= 1 || screenSpaceCamera.target.x <= -1) // Round worldCamera's X, keep the decimals on screenSpaceCamera.
{ {
@ -105,9 +105,18 @@ int main(void)
// Also the renderTexture's height is flipped (in the source Rectangle), due to OpenGL reasons. // Also the renderTexture's height is flipped (in the source Rectangle), due to OpenGL reasons.
DrawTexturePro( DrawTexturePro(
renderTexture.texture, renderTexture.texture,
{ 0.0f, 0.0f, (float)renderTexture.texture.width, (float)-renderTexture.texture.height }, (Rectangle)
{ -virtualRatio, -virtualRatio, screenWidth + (virtualRatio * 2), screenHeight + (virtualRatio * 2) }, {
{ 0.0f, 0.0f }, 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, 0.0f,
WHITE WHITE
); );