[Scummvm-cvs-logs] SF.net SVN: scummvm:[44416] scummvm/trunk/engines/tinsel
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sun Sep 27 21:23:45 CEST 2009
Revision: 44416
http://scummvm.svn.sourceforge.net/scummvm/?rev=44416&view=rev
Author: fingolfin
Date: 2009-09-27 19:23:44 +0000 (Sun, 27 Sep 2009)
Log Message:
-----------
TINSEL: cleanup
Modified Paths:
--------------
scummvm/trunk/engines/tinsel/sound.cpp
scummvm/trunk/engines/tinsel/sound.h
Modified: scummvm/trunk/engines/tinsel/sound.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/sound.cpp 2009-09-27 18:58:40 UTC (rev 44415)
+++ scummvm/trunk/engines/tinsel/sound.cpp 2009-09-27 19:23:44 UTC (rev 44416)
@@ -497,32 +497,32 @@
// 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;
Modified: scummvm/trunk/engines/tinsel/sound.h
===================================================================
--- scummvm/trunk/engines/tinsel/sound.h 2009-09-27 18:58:40 UTC (rev 44415)
+++ scummvm/trunk/engines/tinsel/sound.h 2009-09-27 19:23:44 UTC (rev 44416)
@@ -92,7 +92,7 @@
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;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list