Fix VC warnings for examples (#2085)

This commit is contained in:
Jeffery Myers 2021-10-25 01:21:16 -07:00 committed by GitHub
parent 086f76ba7a
commit daeccd03ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 104 additions and 104 deletions

View file

@ -23,7 +23,7 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - easings box anim");
// Box variables to be animated with easings
Rectangle rec = { GetScreenWidth()/2, -100, 100, 100 };
Rectangle rec = { GetScreenWidth()/2.0f, -100, 100, 100 };
float rotation = 0.0f;
float alpha = 1.0f;
@ -46,7 +46,7 @@ int main(void)
// NOTE: Remember that 3rd parameter of easing function refers to
// desired value variation, do not confuse it with expected final value!
rec.y = EaseElasticOut(framesCounter, -100, GetScreenHeight()/2 + 100, 120);
rec.y = EaseElasticOut((float)framesCounter, -100, GetScreenHeight()/2.0f + 100, 120);
if (framesCounter >= 120)
{
@ -57,8 +57,8 @@ int main(void)
case 1: // Scale box to an horizontal bar
{
framesCounter++;
rec.height = EaseBounceOut(framesCounter, 100, -90, 120);
rec.width = EaseBounceOut(framesCounter, 100, GetScreenWidth(), 120);
rec.height = EaseBounceOut((float)framesCounter, 100, -90, 120);
rec.width = EaseBounceOut((float)framesCounter, 100, (float)GetScreenWidth(), 120);
if (framesCounter >= 120)
{
@ -69,7 +69,7 @@ int main(void)
case 2: // Rotate horizontal bar rectangle
{
framesCounter++;
rotation = EaseQuadOut(framesCounter, 0.0f, 270.0f, 240);
rotation = EaseQuadOut((float)framesCounter, 0.0f, 270.0f, 240);
if (framesCounter >= 240)
{
@ -80,7 +80,7 @@ int main(void)
case 3: // Increase bar size to fill all screen
{
framesCounter++;
rec.height = EaseCircOut(framesCounter, 10, GetScreenWidth(), 120);
rec.height = EaseCircOut((float)framesCounter, 10, (float)GetScreenWidth(), 120);
if (framesCounter >= 120)
{
@ -91,7 +91,7 @@ int main(void)
case 4: // Fade out animation
{
framesCounter++;
alpha = EaseSineOut(framesCounter, 1.0f, -1.0f, 160);
alpha = EaseSineOut((float)framesCounter, 1.0f, -1.0f, 160);
if (framesCounter >= 160)
{
@ -105,7 +105,7 @@ int main(void)
// Reset animation at any moment
if (IsKeyPressed(KEY_SPACE))
{
rec = (Rectangle){ GetScreenWidth()/2, -100, 100, 100 };
rec = (Rectangle){ GetScreenWidth()/2.0f, -100, 100, 100 };
rotation = 0.0f;
alpha = 1.0f;
state = 0;