diff options
-rw-r--r-- | engines/cryo/clsoundgroup.cpp | 48 | ||||
-rw-r--r-- | engines/cryo/cryolib.cpp | 20 | ||||
-rw-r--r-- | engines/cryo/cryolib.h | 22 | ||||
-rw-r--r-- | engines/cryo/eden.cpp | 22 |
4 files changed, 56 insertions, 56 deletions
diff --git a/engines/cryo/clsoundgroup.cpp b/engines/cryo/clsoundgroup.cpp index 16d90bc29d..a0b708da05 100644 --- a/engines/cryo/clsoundgroup.cpp +++ b/engines/cryo/clsoundgroup.cpp @@ -29,21 +29,21 @@ soundgroup_t *CLSoundGroup_New(int16 numSounds, int16 arg4, int16 sampleSize, fl int16 i; sg = (soundgroup_t *)CLMemory_Alloc(sizeof(*sg)); - if (numSounds < CL_MAX_SOUNDS) - sg->numSounds = numSounds; + if (numSounds < kCryoMaxClSounds) + sg->_numSounds = numSounds; else { __libError = -3; __osError = 0; CLCheckError(); - sg->numSounds = CL_MAX_SOUNDS; + sg->_numSounds = kCryoMaxClSounds; } - for (i = 0; i < sg->numSounds; i++) { + for (i = 0; i < sg->_numSounds; i++) { sound_t *sound = CLSoundRaw_New(arg4, rate, sampleSize, mode); - sg->sound[i] = sound; + sg->_sound[i] = sound; sound->ff_1A = arg4; } - sg->soundIndex = 0; - sg->playIndex = 0; + sg->_soundIndex = 0; + sg->_playIndex = 0; sg->ff_106 = 1; return sg; @@ -51,26 +51,26 @@ soundgroup_t *CLSoundGroup_New(int16 numSounds, int16 arg4, int16 sampleSize, fl void CLSoundGroup_Free(soundgroup_t *sg) { int16 i; - for (i = 0; i < sg->numSounds; i++) - CLSoundRaw_Free(sg->sound[i]); + for (i = 0; i < sg->_numSounds; i++) + CLSoundRaw_Free(sg->_sound[i]); CLMemory_Free(sg); } void CLSoundGroup_Reverse16All(soundgroup_t *sg) { int16 i; - for (i = 0; i < sg->numSounds; i++) - sg->sound[i]->_reversed = true; + for (i = 0; i < sg->_numSounds; i++) + sg->_sound[i]->_reversed = true; } void *CLSoundGroup_GetNextBuffer(soundgroup_t *sg) { - sound_t *sound = sg->sound[sg->soundIndex]; + sound_t *sound = sg->_sound[sg->_soundIndex]; if (sg->ff_106) while (sound->_locked) ; return sound->sndHandle + sound->_headerLen; } int16 CLSoundGroup_AssignDatas(soundgroup_t *sg, void *buffer, int length, int16 isSigned) { - sound_t *sound = sg->sound[sg->soundIndex]; + sound_t *sound = sg->_sound[sg->_soundIndex]; if (sg->ff_106) while (sound->_locked) ; else if (sound->_locked) @@ -82,17 +82,17 @@ int16 CLSoundGroup_AssignDatas(soundgroup_t *sg, void *buffer, int length, int16 // ReverseBlock16(buffer, length); // if(isSigned) // CLSound_Signed2NonSigned(buffer, length); - if (sg->soundIndex == sg->numSounds - 1) - sg->soundIndex = 0; + if (sg->_soundIndex == sg->_numSounds - 1) + sg->_soundIndex = 0; else - sg->soundIndex++; + sg->_soundIndex++; return 1; } int16 CLSoundGroup_SetDatas(soundgroup_t *sg, void *data, int length, int16 isSigned) { void *buffer; - sound_t *sound = sg->sound[sg->soundIndex]; + sound_t *sound = sg->_sound[sg->_soundIndex]; if (length >= sound->ff_1A) { __libError = -10; __osError = 0; @@ -111,20 +111,20 @@ int16 CLSoundGroup_SetDatas(soundgroup_t *sg, void *data, int length, int16 isSi // ReverseBlock16(buffer, length); // if(isSigned) // CLSound_Signed2NonSigned(buffer, length); - if (sg->soundIndex == sg->numSounds - 1) - sg->soundIndex = 0; + if (sg->_soundIndex == sg->_numSounds - 1) + sg->_soundIndex = 0; else - sg->soundIndex++; + sg->_soundIndex++; return 1; } void CLSoundGroup_PlayNextSample(soundgroup_t *sg, soundchannel_t *ch) { - CLSoundChannel_Play(ch, sg->sound[sg->playIndex]); - if (sg->playIndex == sg->numSounds - 1) - sg->playIndex = 0; + CLSoundChannel_Play(ch, sg->_sound[sg->_playIndex]); + if (sg->_playIndex == sg->_numSounds - 1) + sg->_playIndex = 0; else - sg->playIndex++; + sg->_playIndex++; } diff --git a/engines/cryo/cryolib.cpp b/engines/cryo/cryolib.cpp index 5a0ce8b4d2..19ba960b2b 100644 --- a/engines/cryo/cryolib.cpp +++ b/engines/cryo/cryolib.cpp @@ -414,7 +414,7 @@ void CLSound_PrepareSample(sound_t *sound, int16 mode) { sound->_loopTimes = 0; sound->_reversed = false; sound->ff_32 = 0; - sound->volume = 255; + sound->_volume = 255; } void CLSound_SetWantsDesigned(int16 designed) { } @@ -429,11 +429,11 @@ soundchannel_t *CLSoundChannel_New(int arg1) { if (!ch) return 0; - ch->volumeLeft = ch->volumeRight = 255; - ch->numSounds = 0; + ch->_volumeLeft = ch->_volumeRight = 255; + ch->_numSounds = 0; - for (i = 0; i < CL_MAX_CH_SOUNDS; i++) - ch->sounds[i] = 0; + for (i = 0; i < kCryoMaxChSounds; i++) + ch->_sounds[i] = 0; return ch; } @@ -446,23 +446,23 @@ void CLSoundChannel_Stop(soundchannel_t *ch) { void CLSoundChannel_Play(soundchannel_t *ch, sound_t *sound) { } int16 CLSoundChannel_GetVolume(soundchannel_t *ch) { - return (ch->volumeLeft + ch->volumeRight) / 2; + return (ch->_volumeLeft + ch->_volumeRight) / 2; } void CLSoundChannel_SetVolume(soundchannel_t *ch, int16 volume) { if (volume < 0 || volume > 255) return; - ch->volumeLeft = volume; - ch->volumeRight = volume; + ch->_volumeLeft = volume; + ch->_volumeRight = volume; } void CLSoundChannel_SetVolumeRight(soundchannel_t *ch, int16 volume) { if (volume < 0 || volume > 255) return; - ch->volumeRight = volume; + ch->_volumeRight = volume; } void CLSoundChannel_SetVolumeLeft(soundchannel_t *ch, int16 volume) { if (volume < 0 || volume > 255) return; - ch->volumeLeft = volume; + ch->_volumeLeft = volume; } ///// CLTimer diff --git a/engines/cryo/cryolib.h b/engines/cryo/cryolib.h index 58e6afb323..42df4f9e32 100644 --- a/engines/cryo/cryolib.h +++ b/engines/cryo/cryolib.h @@ -162,32 +162,32 @@ struct sound_t { int16 _loopTimes; bool _reversed; int16 ff_32; - int16 volume; + int16 _volume; }; typedef struct sound_t sound_t; -#define CL_MAX_SOUNDS 64 +#define kCryoMaxClSounds 64 struct soundgroup_t { - sound_t *sound[CL_MAX_SOUNDS]; - int16 numSounds; - int16 soundIndex; - int16 playIndex; + sound_t *_sound[kCryoMaxClSounds]; + int16 _numSounds; + int16 _soundIndex; + int16 _playIndex; int16 ff_106; }; typedef struct soundgroup_t soundgroup_t; -#define CL_MAX_CH_SOUNDS 10 +#define kCryoMaxChSounds 10 struct soundchannel_t { Audio::SoundHandle ch; int xx; - int16 volumeLeft; - int16 volumeRight; - int16 numSounds; + int16 _volumeLeft; + int16 _volumeRight; + int16 _numSounds; - sound_t *sounds[CL_MAX_CH_SOUNDS]; + sound_t *_sounds[kCryoMaxChSounds]; int16 ff_536; }; diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp index 76a6c82b5a..3072268015 100644 --- a/engines/cryo/eden.cpp +++ b/engines/cryo/eden.cpp @@ -6306,9 +6306,9 @@ void EdenGame::musicspy() { mus_vol_right = p_global->pref_10C[1]; if (mus_fade_flags & 3) fademusicup(); - if (personTalking && !hnmsound_ch->numSounds) + if (personTalking && !hnmsound_ch->_numSounds) mus_fade_flags = 3; - if (music_channel->numSounds < 3) { + if (music_channel->_numSounds < 3) { patnum = mus_sequence_ptr[musicSequencePos]; if (patnum == 0xFF) { // rewind @@ -6348,17 +6348,17 @@ void EdenGame::persovox() { vol_l = p_global->pref_110[0]; vol_r = p_global->pref_110[1]; step_l = -1; - if (music_channel->volumeLeft < vol_l) + if (music_channel->_volumeLeft < vol_l) step_l = 1; step_r = -1; - if (music_channel->volumeRight < vol_r) + if (music_channel->_volumeRight < vol_r) step_r = 1; do { - if (vol_l != music_channel->volumeLeft) - CLSoundChannel_SetVolumeLeft(music_channel, music_channel->volumeLeft + step_l); - if (vol_r != music_channel->volumeRight) - CLSoundChannel_SetVolumeRight(music_channel, music_channel->volumeRight + step_r); - } while (music_channel->volumeLeft != vol_l || music_channel->volumeRight != vol_r); + if (vol_l != music_channel->_volumeLeft) + CLSoundChannel_SetVolumeLeft(music_channel, music_channel->_volumeLeft + step_l); + if (vol_r != music_channel->_volumeRight) + CLSoundChannel_SetVolumeRight(music_channel, music_channel->_volumeRight + step_r); + } while (music_channel->_volumeLeft != vol_l || music_channel->_volumeRight != vol_r); vol_l = p_global->pref_10E[0]; vol_r = p_global->pref_10E[1]; CLSoundChannel_SetVolumeLeft(hnmsound_ch, vol_l); @@ -6387,7 +6387,7 @@ void EdenGame::endpersovox() { void EdenGame::fademusicup() { int16 vol; if (mus_fade_flags & 2) { - vol = music_channel->volumeLeft; + vol = music_channel->_volumeLeft; if (vol < mus_vol_left) { vol += 8; if (vol > mus_vol_left) @@ -6402,7 +6402,7 @@ void EdenGame::fademusicup() { mus_fade_flags &= ~2; } if (mus_fade_flags & 1) { - vol = music_channel->volumeRight; + vol = music_channel->_volumeRight; if (vol < mus_vol_right) { vol += 8; if (vol > mus_vol_right) |