aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2012-06-11 14:59:12 +0200
committerSven Hesse2012-06-11 15:10:59 +0200
commitf538b7658684aad26a38b2e3685a322ecc14a720 (patch)
treebd9b2a240aa3c8ee92f870602d1544f5954939c7 /engines/gob
parentb812ed50c8f6d9a24b607831a88a398730458d9a (diff)
downloadscummvm-rg350-f538b7658684aad26a38b2e3685a322ecc14a720.tar.gz
scummvm-rg350-f538b7658684aad26a38b2e3685a322ecc14a720.tar.bz2
scummvm-rg350-f538b7658684aad26a38b2e3685a322ecc14a720.zip
GOB: Don't recalculate the AdLib frequencies table on every player reset
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/sound/adlib.cpp8
-rw-r--r--engines/gob/sound/adlib.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/engines/gob/sound/adlib.cpp b/engines/gob/sound/adlib.cpp
index 3f46f6cf4b..d9fc362547 100644
--- a/engines/gob/sound/adlib.cpp
+++ b/engines/gob/sound/adlib.cpp
@@ -98,6 +98,8 @@ AdLib::AdLib(Audio::Mixer &mixer) : _mixer(&mixer), _opl(0),
_rate = _mixer->getOutputRate();
+ initFreqs();
+
createOPL();
initOPL();
@@ -295,7 +297,7 @@ void AdLib::initOPL() {
_opl->reset();
initOperatorVolumes();
- initFreqs();
+ resetFreqs();
setPercussionMode(false);
@@ -581,6 +583,10 @@ void AdLib::initFreqs() {
for (int i = 0; i < kPitchStepCount; i++)
setFreqs(_freqs[i], i * numStep, 100);
+ resetFreqs();
+}
+
+void AdLib::resetFreqs() {
for (int i = 0; i < kMaxVoiceCount; i++) {
_freqPtr [i] = _freqs[0];
_halfToneOffset[i] = 0;
diff --git a/engines/gob/sound/adlib.h b/engines/gob/sound/adlib.h
index 17ab950752..bd1778d2ed 100644
--- a/engines/gob/sound/adlib.h
+++ b/engines/gob/sound/adlib.h
@@ -295,6 +295,7 @@ private:
void initFreqs();
void setFreqs(uint16 *freqs, int32 num, int32 denom);
int32 calcFreq(int32 deltaDemiToneNum, int32 deltaDemiToneDenom);
+ void resetFreqs();
void changePitch(uint8 voice, uint16 pitchBend);