mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-25 04:28:30 +00:00
Change UpdateSound() to accept const void *
The function means to accept a const * so let's declare it. Will allow passing const buffers in games. Also constness is next to godliness! Signed-off-by: Saggi Mizrahi <saggi@mizrahi.cc>
This commit is contained in:
@@ -342,7 +342,7 @@ void UnloadSound(Sound sound)
|
||||
|
||||
// Update sound buffer with new data
|
||||
// NOTE: data must match sound.format
|
||||
void UpdateSound(Sound sound, void *data, int numSamples)
|
||||
void UpdateSound(Sound sound, const void *data, int numSamples)
|
||||
{
|
||||
ALint sampleRate, sampleSize, channels;
|
||||
alGetBufferi(sound.buffer, AL_FREQUENCY, &sampleRate);
|
||||
|
@@ -115,7 +115,7 @@ Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, in
|
||||
Sound LoadSound(const char *fileName); // Load sound to memory
|
||||
Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data
|
||||
Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource)
|
||||
void UpdateSound(Sound sound, void *data, int numSamples); // Update sound buffer with new data
|
||||
void UpdateSound(Sound sound, const void *data, int numSamples); // Update sound buffer with new data
|
||||
void UnloadWave(Wave wave); // Unload wave data
|
||||
void UnloadSound(Sound sound); // Unload sound
|
||||
void PlaySound(Sound sound); // Play a sound
|
||||
|
@@ -930,7 +930,8 @@ RLAPI Wave LoadWave(const char *fileName); // Load wa
|
||||
RLAPI Wave LoadWaveEx(float *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from float array data (32bit)
|
||||
RLAPI Sound LoadSound(const char *fileName); // Load sound to memory
|
||||
RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data
|
||||
RLAPI void UpdateSound(Sound sound, void *data, int numSamples); // Update sound buffer with new data
|
||||
RLAPI void UpdateSound(Sound sound, const void *data, int numSamples);// Update sound buffer with new data
|
||||
RLAPI Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource)
|
||||
RLAPI void UnloadWave(Wave wave); // Unload wave data
|
||||
RLAPI void UnloadSound(Sound sound); // Unload sound
|
||||
RLAPI void PlaySound(Sound sound); // Play a sound
|
||||
|
Reference in New Issue
Block a user