aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorRichieSams2013-10-01 18:48:34 -0500
committerRichieSams2013-10-02 09:09:58 -0500
commit18b1c3130fa1c6dbce79b83491c524e4a1f37867 (patch)
treefc870623acc7039a3a1cbd1ae09e1abfe33330a9 /engines
parent1c8a5582a2dd23c01bda6002e746a4e5749b21b6 (diff)
downloadscummvm-rg350-18b1c3130fa1c6dbce79b83491c524e4a1f37867.tar.gz
scummvm-rg350-18b1c3130fa1c6dbce79b83491c524e4a1f37867.tar.bz2
scummvm-rg350-18b1c3130fa1c6dbce79b83491c524e4a1f37867.zip
ZVISION: Move two lookup tables inside the RawZorkStream class
Instead of being global variables.
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/zork_raw.cpp23
-rw-r--r--engines/zvision/zork_raw.h17
2 files changed, 21 insertions, 19 deletions
diff --git a/engines/zvision/zork_raw.cpp b/engines/zvision/zork_raw.cpp
index 1231e406cb..55ad2076e0 100644
--- a/engines/zvision/zork_raw.cpp
+++ b/engines/zvision/zork_raw.cpp
@@ -52,6 +52,21 @@ const int32 RawZorkStream::_amplitudeLookupTable[89] = {0x0007, 0x0008, 0x0009,
0x1BDC, 0x1EA5, 0x21B6, 0x2515, 0x28CA, 0x2CDF, 0x315B, 0x364B,
0x3BB9, 0x41B2, 0x4844, 0x4F7E, 0x5771, 0x602F, 0x69CE, 0x7462, 0x7FFF};
+const SoundParams RawZorkStream::_zNemSoundParamLookupTable[6] = {{'6', 0x2B11, false, false},
+ {'a', 0x5622, false, true},
+ {'b', 0x5622, true, true},
+ {'n', 0x2B11, false, true},
+ {'s', 0x5622, false, true},
+ {'t', 0x5622, true, true}
+};
+
+const SoundParams RawZorkStream::_zgiSoundParamLookupTable[5] = {{'a',0x5622, false, false},
+ {'k',0x2B11, true, true},
+ {'p',0x5622, false, true},
+ {'q',0x5622, true, true},
+ {'u',0xAC44, true, true}
+};
+
RawZorkStream::RawZorkStream(uint32 rate, bool stereo, DisposeAfterUse::Flag disposeStream, Common::SeekableReadStream *stream)
: _rate(rate),
_stereo(0),
@@ -166,14 +181,14 @@ Audio::RewindableAudioStream *makeRawZorkStream(const Common::String &filePath,
if (engine->getGameId() == GID_NEMESIS) {
for (int i = 0; i < 6; ++i) {
- if (zNemSoundParamLookupTable[i].identifier == (fileName[6]))
- soundParams = zNemSoundParamLookupTable[i];
+ if (RawZorkStream::_zNemSoundParamLookupTable[i].identifier == (fileName[6]))
+ soundParams = RawZorkStream::_zNemSoundParamLookupTable[i];
}
}
else if (engine->getGameId() == GID_GRANDINQUISITOR) {
for (int i = 0; i < 6; ++i) {
- if (zgiSoundParamLookupTable[i].identifier == (fileName[7]))
- soundParams = zgiSoundParamLookupTable[i];
+ if (RawZorkStream::_zgiSoundParamLookupTable[i].identifier == (fileName[7]))
+ soundParams = RawZorkStream::_zgiSoundParamLookupTable[i];
}
}
diff --git a/engines/zvision/zork_raw.h b/engines/zvision/zork_raw.h
index f19ffc1661..62433b137b 100644
--- a/engines/zvision/zork_raw.h
+++ b/engines/zvision/zork_raw.h
@@ -41,21 +41,6 @@ struct SoundParams {
bool packed;
};
-const SoundParams zNemSoundParamLookupTable[6] = {{'6', 0x2B11, false, false},
- {'a', 0x5622, false, true},
- {'b', 0x5622, true, true},
- {'n', 0x2B11, false, true},
- {'s', 0x5622, false, true},
- {'t', 0x5622, true, true}
-};
-
-const SoundParams zgiSoundParamLookupTable[5] = {{'a',0x5622, false, false},
- {'k',0x2B11, true, true},
- {'p',0x5622, false, true},
- {'q',0x5622, true, true},
- {'u',0xAC44, true, true}
-};
-
/**
* This is a stream, which allows for playing raw ADPCM data from a stream.
*/
@@ -67,6 +52,8 @@ public:
}
public:
+ static const SoundParams _zNemSoundParamLookupTable[6];
+ static const SoundParams _zgiSoundParamLookupTable[5];
private:
const int _rate; // Sample rate of stream