aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel
diff options
context:
space:
mode:
authorMax Horn2009-09-27 19:23:44 +0000
committerMax Horn2009-09-27 19:23:44 +0000
commit4edecad9db05c169bdccf2d45f212eb4e643bdb9 (patch)
tree20764e1b3751149370562648130501e43fc39c15 /engines/tinsel
parentcf1031fc63a19bfebc82744ab4b1ed55a3868408 (diff)
downloadscummvm-rg350-4edecad9db05c169bdccf2d45f212eb4e643bdb9.tar.gz
scummvm-rg350-4edecad9db05c169bdccf2d45f212eb4e643bdb9.tar.bz2
scummvm-rg350-4edecad9db05c169bdccf2d45f212eb4e643bdb9.zip
TINSEL: cleanup
svn-id: r44416
Diffstat (limited to 'engines/tinsel')
-rw-r--r--engines/tinsel/sound.cpp22
-rw-r--r--engines/tinsel/sound.h2
2 files changed, 12 insertions, 12 deletions
diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp
index 4876f91a3a..528a0c78f8 100644
--- a/engines/tinsel/sound.cpp
+++ b/engines/tinsel/sound.cpp
@@ -497,32 +497,32 @@ void SoundManager::openSampleFiles(void) {
// file must be corrupt if we get to here
error(FILE_IS_CORRUPT, _vm->getSampleFile(sampleLanguage));
-#ifdef SCUMM_BIG_ENDIAN
- // Convert all ids from LE to native format
- for (uint i = 0; i < _sampleIndexLen / sizeof(uint32); ++i) {
- _sampleIndex[i] = READ_LE_UINT32(_sampleIndex + i);
- }
-#endif
-
// close the file
f.close();
// convert file size to size in DWORDs
_sampleIndexLen /= sizeof(uint32);
+#ifdef SCUMM_BIG_ENDIAN
+ // Convert all ids from LE to native format
+ for (int i = 0; i < _sampleIndexLen; ++i) {
+ _sampleIndex[i] = SWAP_BYTES_32(_sampleIndex[i]);
+ }
+#endif
+
// Detect format of soundfile by looking at 1st sample-index
- switch (_sampleIndex[0]) {
- case MKID_BE(' 3PM'):
+ switch (TO_BE_32(_sampleIndex[0])) {
+ case MKID_BE('MP3 '):
debugC(DEBUG_DETAILED, kTinselDebugSound, "Detected MP3 sound-data");
_soundMode = kMP3Mode;
break;
- case MKID_BE(' GGO'):
+ case MKID_BE('OGG '):
debugC(DEBUG_DETAILED, kTinselDebugSound, "Detected OGG sound-data");
_soundMode = kVorbisMode;
break;
- case MKID_BE('CALF'):
+ case MKID_BE('FLAC'):
debugC(DEBUG_DETAILED, kTinselDebugSound, "Detected FLAC sound-data");
_soundMode = kFlacMode;
break;
diff --git a/engines/tinsel/sound.h b/engines/tinsel/sound.h
index 9bdd037ff0..27682a4a21 100644
--- a/engines/tinsel/sound.h
+++ b/engines/tinsel/sound.h
@@ -92,7 +92,7 @@ protected:
uint32 *_sampleIndex;
/** Number of entries in the sample index */
- long _sampleIndexLen;
+ int _sampleIndexLen;
/** Specifies if the sample-data is compressed and if yes, how */
SoundMode _soundMode;