summaryrefslogtreecommitdiffhomepage
path: root/examples/audio
diff options
context:
space:
mode:
authorJeffery Myers <[email protected]>2021-02-20 14:37:32 -0800
committerGitHub <[email protected]>2021-02-20 23:37:32 +0100
commit48a7cd3c8788799505b4fa9f84cb8f5979397c29 (patch)
treef9cbed3827f8855d0e3c27916930b9d82de3e423 /examples/audio
parent82cdd88ffe6cb9d2f97e34bd0724d791030372bf (diff)
downloadraylib-48a7cd3c8788799505b4fa9f84cb8f5979397c29.tar.gz
raylib-48a7cd3c8788799505b4fa9f84cb8f5979397c29.zip
[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 <[email protected]>
Diffstat (limited to 'examples/audio')
-rw-r--r--examples/audio/audio_module_playing.c12
-rw-r--r--examples/audio/audio_multichannel_sound.c2
-rw-r--r--examples/audio/audio_raw_stream.c4
3 files changed, 9 insertions, 9 deletions
diff --git a/examples/audio/audio_module_playing.c b/examples/audio/audio_module_playing.c
index 9a85cbc0..3c10e069 100644
--- a/examples/audio/audio_module_playing.c
+++ b/examples/audio/audio_module_playing.c
@@ -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;
}
diff --git a/examples/audio/audio_multichannel_sound.c b/examples/audio/audio_multichannel_sound.c
index b9a76f9d..22368093 100644
--- a/examples/audio/audio_multichannel_sound.c
+++ b/examples/audio/audio_multichannel_sound.c
@@ -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
//--------------------------------------------------------------------------------------
diff --git a/examples/audio/audio_raw_stream.c b/examples/audio/audio_raw_stream.c
index 1130eae0..219739b6 100644
--- a/examples/audio/audio_raw_stream.c
+++ b/examples/audio/audio_raw_stream.c
@@ -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);
}