mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Fix result of operation is garbage or undefined
This commit is contained in:
@ -76,13 +76,13 @@ int main()
|
|||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
unsigned char key;
|
static unsigned char key;
|
||||||
|
|
||||||
InitAudioDevice();
|
InitAudioDevice();
|
||||||
|
|
||||||
Sound fxWav = LoadSound("resources/audio/weird.wav"); // Load WAV audio file
|
Sound fxWav = LoadSound("resources/audio/weird.wav"); // Load WAV audio file
|
||||||
Sound fxOgg = LoadSound("resources/audio/tanatana.ogg"); // Load OGG audio file
|
Sound fxOgg = LoadSound("resources/audio/tanatana.ogg"); // Load OGG audio file
|
||||||
|
|
||||||
Music music = LoadMusicStream("resources/audio/guitar_noodling.ogg");
|
Music music = LoadMusicStream("resources/audio/guitar_noodling.ogg");
|
||||||
PlayMusicStream(music);
|
PlayMusicStream(music);
|
||||||
|
|
||||||
@ -99,23 +99,23 @@ int main()
|
|||||||
PlaySound(fxWav);
|
PlaySound(fxWav);
|
||||||
key = 0;
|
key = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key == 'd')
|
if (key == 'd')
|
||||||
{
|
{
|
||||||
PlaySound(fxOgg);
|
PlaySound(fxOgg);
|
||||||
key = 0;
|
key = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateMusicStream(music);
|
UpdateMusicStream(music);
|
||||||
}
|
}
|
||||||
|
|
||||||
// De-Initialization
|
// De-Initialization
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
UnloadSound(fxWav); // Unload sound data
|
UnloadSound(fxWav); // Unload sound data
|
||||||
UnloadSound(fxOgg); // Unload sound data
|
UnloadSound(fxOgg); // Unload sound data
|
||||||
|
|
||||||
UnloadMusicStream(music); // Unload music stream data
|
UnloadMusicStream(music); // Unload music stream data
|
||||||
|
|
||||||
CloseAudioDevice();
|
CloseAudioDevice();
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user