[Examples] Fix typecast warnings in examples. (#1601)
* Fixing typecast warnings generated by visual studio 2019 in examples. * Changes to fixes based on feedback Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
This commit is contained in:
parent
82cdd88ffe
commit
48a7cd3c87
15 changed files with 57 additions and 54 deletions
|
@ -43,9 +43,9 @@ int main(void)
|
|||
for (int i = MAX_CIRCLES - 1; i >= 0; i--)
|
||||
{
|
||||
circles[i].alpha = 0.0f;
|
||||
circles[i].radius = GetRandomValue(10, 40);
|
||||
circles[i].position.x = GetRandomValue(circles[i].radius, screenWidth - circles[i].radius);
|
||||
circles[i].position.y = GetRandomValue(circles[i].radius, screenHeight - circles[i].radius);
|
||||
circles[i].radius = (float)GetRandomValue(10, 40);
|
||||
circles[i].position.x = (float)GetRandomValue((int)circles[i].radius, (int)(screenWidth - circles[i].radius));
|
||||
circles[i].position.y = (float)GetRandomValue((int)circles[i].radius, (int)(screenHeight - circles[i].radius));
|
||||
circles[i].speed = (float)GetRandomValue(1, 100)/2000.0f;
|
||||
circles[i].color = colors[GetRandomValue(0, 13)];
|
||||
}
|
||||
|
@ -104,9 +104,9 @@ int main(void)
|
|||
if (circles[i].alpha <= 0.0f)
|
||||
{
|
||||
circles[i].alpha = 0.0f;
|
||||
circles[i].radius = GetRandomValue(10, 40);
|
||||
circles[i].position.x = GetRandomValue(circles[i].radius, screenWidth - circles[i].radius);
|
||||
circles[i].position.y = GetRandomValue(circles[i].radius, screenHeight - circles[i].radius);
|
||||
circles[i].radius = (float)GetRandomValue(10, 40);
|
||||
circles[i].position.x = (float)GetRandomValue((int)circles[i].radius, (int)(screenWidth - circles[i].radius));
|
||||
circles[i].position.y = (float)GetRandomValue((int)circles[i].radius, (int)(screenHeight - circles[i].radius));
|
||||
circles[i].color = colors[GetRandomValue(0, 13)];
|
||||
circles[i].speed = (float)GetRandomValue(1, 100)/2000.0f;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ int main(void)
|
|||
Sound fxWav = LoadSound("resources/sound.wav"); // Load WAV audio file
|
||||
Sound fxOgg = LoadSound("resources/target.ogg"); // Load OGG audio file
|
||||
|
||||
SetSoundVolume(fxWav, 0.2);
|
||||
SetSoundVolume(fxWav, 0.2f);
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
|
|
@ -140,8 +140,8 @@ int main(void)
|
|||
// Draw the current buffer state proportionate to the screen
|
||||
for (int i = 0; i < screenWidth; i++)
|
||||
{
|
||||
position.x = i;
|
||||
position.y = 250 + 50*data[i*MAX_SAMPLES/screenWidth]/32000;
|
||||
position.x = (float)i;
|
||||
position.y = 250 + 50*data[i*MAX_SAMPLES/screenWidth]/32000.0f;
|
||||
|
||||
DrawPixelV(position, RED);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue