diff --git a/LEGO1/lego/legoomni/include/legocachsound.h b/LEGO1/lego/legoomni/include/legocachsound.h index 792524b3..d1020679 100644 --- a/LEGO1/lego/legoomni/include/legocachsound.h +++ b/LEGO1/lego/legoomni/include/legocachsound.h @@ -56,7 +56,7 @@ class LegoCacheSound : public MxCore { MxString FUN_10006d80(const MxString& p_str); // [library:audio] WAVE_FORMAT_PCM (audio in .SI files only used this format) - static const MxU32 supportedFormatTag = 1; + static const MxU32 g_supportedFormatTag = 1; ma_audio_buffer m_buffer; ma_sound m_cacheSound; diff --git a/LEGO1/lego/legoomni/src/audio/legocachsound.cpp b/LEGO1/lego/legoomni/src/audio/legocachsound.cpp index 96d64a74..2080d27b 100644 --- a/LEGO1/lego/legoomni/src/audio/legocachsound.cpp +++ b/LEGO1/lego/legoomni/src/audio/legocachsound.cpp @@ -48,7 +48,7 @@ MxResult LegoCacheSound::Create( // [library:audio] These should never be null assert(p_data != NULL && p_dataSize != 0); - assert(p_pwfx.m_formatTag == supportedFormatTag); + assert(p_pwfx.m_formatTag == g_supportedFormatTag); assert(p_pwfx.m_bitsPerSample == 8 || p_pwfx.m_bitsPerSample == 16); CopyData(p_data, p_dataSize); diff --git a/LEGO1/omni/include/mxsoundmanager.h b/LEGO1/omni/include/mxsoundmanager.h index 26b8b1cc..1540cd79 100644 --- a/LEGO1/omni/include/mxsoundmanager.h +++ b/LEGO1/omni/include/mxsoundmanager.h @@ -35,8 +35,12 @@ class MxSoundManager : public MxAudioManager { // Not sure how DirectSound handles this when different buffers have different rates. static const MxU32 sampleRate = 44100; - static void SDLCALL - AudioStreamCallback(void* p_userdata, SDL_AudioStream* p_stream, int p_additionalAmount, int p_totalAmount); + static void AudioStreamCallback( + void* p_userdata, + SDL_AudioStream* p_stream, + int p_additionalAmount, + int p_totalAmount + ); ma_engine m_engine; SDL_AudioStream* m_stream; diff --git a/LEGO1/omni/include/mxwavepresenter.h b/LEGO1/omni/include/mxwavepresenter.h index e703a828..9caa3a6a 100644 --- a/LEGO1/omni/include/mxwavepresenter.h +++ b/LEGO1/omni/include/mxwavepresenter.h @@ -79,13 +79,13 @@ class MxWavePresenter : public MxSoundPresenter { MxBool WriteToSoundBuffer(void* p_audioPtr, MxU32 p_length); // [library:audio] One chunk has up to 1 second worth of frames - static const MxU32 millisecondsPerChunk = 1000; + static const MxU32 g_millisecondsPerChunk = 1000; // [library:audio] Store up to 2 chunks worth of frames (same as in original game) - static const MxU32 rbSizeInMilliseconds = millisecondsPerChunk * 2; + static const MxU32 g_rbSizeInMilliseconds = g_millisecondsPerChunk * 2; // [library:audio] WAVE_FORMAT_PCM (audio in .SI files only used this format) - static const MxU32 supportedFormatTag = 1; + static const MxU32 g_supportedFormatTag = 1; WaveFormat* m_waveFormat; // 0x54 ma_pcm_rb m_rb; diff --git a/LEGO1/omni/src/audio/mxsoundmanager.cpp b/LEGO1/omni/src/audio/mxsoundmanager.cpp index 0e82fc9d..37f4bfaf 100644 --- a/LEGO1/omni/src/audio/mxsoundmanager.cpp +++ b/LEGO1/omni/src/audio/mxsoundmanager.cpp @@ -127,7 +127,7 @@ MxResult MxSoundManager::Create(MxU32 p_frequencyMS, MxBool p_createThread) return status; } -void SDLCALL MxSoundManager::AudioStreamCallback( +void MxSoundManager::AudioStreamCallback( void* p_userdata, SDL_AudioStream* p_stream, int p_additionalAmount, diff --git a/LEGO1/omni/src/audio/mxwavepresenter.cpp b/LEGO1/omni/src/audio/mxwavepresenter.cpp index 22354e9e..db7f54e3 100644 --- a/LEGO1/omni/src/audio/mxwavepresenter.cpp +++ b/LEGO1/omni/src/audio/mxwavepresenter.cpp @@ -56,11 +56,11 @@ void MxWavePresenter::Destroy(MxBool p_fromDestructor) MxBool MxWavePresenter::WriteToSoundBuffer(void* p_audioPtr, MxU32 p_length) { ma_uint32 requestedFrames = - ma_calculate_buffer_size_in_frames_from_milliseconds(millisecondsPerChunk, m_waveFormat->m_samplesPerSec); + ma_calculate_buffer_size_in_frames_from_milliseconds(g_millisecondsPerChunk, m_waveFormat->m_samplesPerSec); ma_uint32 acquiredFrames = requestedFrames; - void* p_bufferOut; + void* bufferOut; - ma_pcm_rb_acquire_write(&m_rb, &acquiredFrames, &p_bufferOut); + ma_pcm_rb_acquire_write(&m_rb, &acquiredFrames, &bufferOut); // [library:audio] If there isn't enough space in the buffer for a full chunk, try again later. if (acquiredFrames != requestedFrames) { @@ -71,11 +71,11 @@ MxBool MxWavePresenter::WriteToSoundBuffer(void* p_audioPtr, MxU32 p_length) ma_uint32 acquiredBytes = acquiredFrames * ma_get_bytes_per_frame(m_rb.format, m_rb.channels); assert(p_length <= acquiredBytes); - memcpy(p_bufferOut, p_audioPtr, p_length); + memcpy(bufferOut, p_audioPtr, p_length); // [library:audio] Pad with silence data if we don't have a full chunk. if (p_length < acquiredBytes) { - memset((ma_uint8*) p_bufferOut + p_length, m_silenceData, acquiredBytes - p_length); + memset((ma_uint8*) bufferOut + p_length, m_silenceData, acquiredBytes - p_length); } ma_pcm_rb_commit_write(&m_rb, acquiredFrames); @@ -105,7 +105,7 @@ void MxWavePresenter::StartingTickle() MxBool success = FALSE; m_chunkLength = chunk->GetLength(); - assert(m_waveFormat->m_formatTag == supportedFormatTag); + assert(m_waveFormat->m_formatTag == g_supportedFormatTag); assert(m_waveFormat->m_bitsPerSample == 8 || m_waveFormat->m_bitsPerSample == 16); // [library:audio] @@ -132,7 +132,7 @@ void MxWavePresenter::StartingTickle() m_waveFormat->m_bitsPerSample == 16 ? ma_format_s16 : ma_format_u8, m_waveFormat->m_channels, ma_calculate_buffer_size_in_frames_from_milliseconds( - rbSizeInMilliseconds, + g_rbSizeInMilliseconds, m_waveFormat->m_samplesPerSec ), NULL,