diff options
author | Marisa-Chan | 2014-06-13 21:43:04 +0700 |
---|---|---|
committer | Marisa-Chan | 2014-06-13 21:43:04 +0700 |
commit | 45589950c0fb1a449351e6a00ef10d42290d8bae (patch) | |
tree | 44e4eedcb7e69d5fc386155b000ed038af07251d /engines/mortevielle/sound.cpp | |
parent | 48360645dcd5f8fddb135b6e31ae5cae4be8d77f (diff) | |
parent | 5c005ad3a3f1df0bc968c85c1cf0fc48e36ab0b2 (diff) | |
download | scummvm-rg350-45589950c0fb1a449351e6a00ef10d42290d8bae.tar.gz scummvm-rg350-45589950c0fb1a449351e6a00ef10d42290d8bae.tar.bz2 scummvm-rg350-45589950c0fb1a449351e6a00ef10d42290d8bae.zip |
Merge remote-tracking branch 'upstream/master' into zvision
Conflicts:
engines/zvision/animation/rlf_animation.cpp
engines/zvision/animation_control.h
engines/zvision/core/console.cpp
engines/zvision/core/events.cpp
engines/zvision/cursors/cursor.cpp
engines/zvision/cursors/cursor_manager.cpp
engines/zvision/cursors/cursor_manager.h
engines/zvision/fonts/truetype_font.cpp
engines/zvision/graphics/render_manager.cpp
engines/zvision/graphics/render_manager.h
engines/zvision/inventory/inventory_manager.h
engines/zvision/inventory_manager.h
engines/zvision/meta_animation.h
engines/zvision/module.mk
engines/zvision/scripting/actions.cpp
engines/zvision/scripting/control.h
engines/zvision/scripting/controls/animation_control.cpp
engines/zvision/scripting/controls/animation_control.h
engines/zvision/scripting/controls/input_control.cpp
engines/zvision/scripting/controls/lever_control.cpp
engines/zvision/scripting/controls/timer_node.cpp
engines/zvision/scripting/controls/timer_node.h
engines/zvision/scripting/puzzle.h
engines/zvision/scripting/scr_file_handling.cpp
engines/zvision/scripting/script_manager.cpp
engines/zvision/scripting/script_manager.h
engines/zvision/sidefx.cpp
engines/zvision/sound/zork_raw.cpp
engines/zvision/sound/zork_raw.h
engines/zvision/video/video.cpp
engines/zvision/video/zork_avi_decoder.h
engines/zvision/zvision.cpp
engines/zvision/zvision.h
Diffstat (limited to 'engines/mortevielle/sound.cpp')
-rw-r--r-- | engines/mortevielle/sound.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp index b670246726..23ca9d89b4 100644 --- a/engines/mortevielle/sound.cpp +++ b/engines/mortevielle/sound.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -55,7 +55,8 @@ namespace Mortevielle { const byte _tabdph[16] = {0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10}; const byte _tabdbc[18] = {7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9}; -SoundManager::SoundManager(Audio::Mixer *mixer) { +SoundManager::SoundManager(MortevielleEngine *vm, Audio::Mixer *mixer) { + _vm = vm; _mixer = mixer; _audioStream = nullptr; _ambiantNoiseBuf = nullptr; @@ -72,6 +73,8 @@ SoundManager::SoundManager(Audio::Mixer *mixer) { _queue[i]._rep = 0; } _buildingSentence = false; + _ptr_oct = 0; + _cfiphBuffer = nullptr; } SoundManager::~SoundManager() { @@ -88,13 +91,12 @@ int SoundManager::decodeMusic(const byte *PSrc, byte *PDest, int size) { static const int tab[16] = { -96, -72, -48, -32, -20, -12, -8, -4, 0, 4, 8, 12, 20, 32, 48, 72 }; uint seed = 128; - int v; int decompSize = 0; int skipSize = 0; for (int idx1 = 0; idx1 < size; ++idx1) { byte srcByte = *PSrc++; - v = tab[srcByte >> 4]; + int v = tab[srcByte >> 4]; seed += v; *PDest++ = seed & 0xff; @@ -201,7 +203,7 @@ void SoundManager::litph(tablint &t, int typ, int tempo) { } } else { // 2 debugC(5, kMortevielleSounds, "litph - vadson"); - const static int ambiantNoiseAdr[] = {0, 14020, + const static int ambiantNoiseAdr[] = {0, 14020, 14020, 18994, 18994, 19630, 19630, 22258, @@ -281,10 +283,6 @@ void SoundManager::playSong(const byte* buf, uint size, uint loops) { _mixer->stopHandle(songHandle); } -void SoundManager::setParent(MortevielleEngine *vm) { - _vm = vm; -} - void SoundManager::spfrac(int wor) { _queue[2]._rep = (uint)wor >> 12; if ((_soundType == 0) && (_queue[2]._code != 9)) { @@ -697,7 +695,7 @@ void SoundManager::handlePhoneme() { uint16 startPos = _cfiphBuffer[_phonemeNumb - 1] + deca[_soundType]; uint16 endPos = _cfiphBuffer[_phonemeNumb] + deca[_soundType]; int wordCount = endPos - startPos; - + startPos /= 2; endPos /= 2; assert((endPos - startPos) < 1711); |