From 1c80f2ffa0d22c39fce5da342b72f890415aec8c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 26 Feb 2007 20:32:43 +0000 Subject: [PATCH] calling memset to zero a buffer you are about to fill with audio data is not necessary (removing this from Gob::Snd::readBuffer); removed dead code svn-id: r25883 --- engines/gob/init.cpp | 4 ---- engines/gob/sound.cpp | 3 --- engines/gob/sound.h | 1 - 3 files changed, 8 deletions(-) diff --git a/engines/gob/init.cpp b/engines/gob/init.cpp index 82cca27545a..81ad101ce99 100644 --- a/engines/gob/init.cpp +++ b/engines/gob/init.cpp @@ -61,10 +61,6 @@ void Init::cleanup(void) { _vm->_video->freeSurfDesc(_vm->_global->_pPrimarySurfDesc); _vm->_global->_pPrimarySurfDesc = 0; - if (_vm->_snd->_cleanupFunc != 0 && _vm->_snd->_playingSound != 0) { - (*_vm->_snd->_cleanupFunc) (0); - _vm->_snd->_cleanupFunc = 0; - } _vm->_snd->speakerOff(); _vm->_dataio->closeDataFile(); diff --git a/engines/gob/sound.cpp b/engines/gob/sound.cpp index fb591d5e367..af5bc59661a 100644 --- a/engines/gob/sound.cpp +++ b/engines/gob/sound.cpp @@ -96,7 +96,6 @@ int Snd::SquareWaveStream::readBuffer(int16 *buffer, const int numSamples) { } Snd::Snd(GobEngine *vm) : _vm(vm) { - _cleanupFunc = 0; _playingSound = 0; _curSoundDesc = 0; @@ -307,8 +306,6 @@ void Snd::checkEndSample(void) { } int Snd::readBuffer(int16 *buffer, const int numSamples) { - memset(buffer, 0, numSamples); - for (int i = 0; i < numSamples; i++) { Common::StackLock slock(_mutex); diff --git a/engines/gob/sound.h b/engines/gob/sound.h index 4628820ad8d..e11d42f1a36 100644 --- a/engines/gob/sound.h +++ b/engines/gob/sound.h @@ -46,7 +46,6 @@ public: typedef void (*CleanupFuncPtr) (int16); char _playingSound; - CleanupFuncPtr _cleanupFunc; Snd(GobEngine *vm);