aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2015-12-31 14:48:38 +0100
committerStrangerke2015-12-31 14:48:38 +0100
commit88c19138cf18a40e478447c4600d92d63ff0ed50 (patch)
treecaee71ac9bae8953162ddebd5a4450ce5e09ad39
parent7ee36a97ee8c43b28c5dd4d8a0d3211698d1dc7f (diff)
downloadscummvm-rg350-88c19138cf18a40e478447c4600d92d63ff0ed50.tar.gz
scummvm-rg350-88c19138cf18a40e478447c4600d92d63ff0ed50.tar.bz2
scummvm-rg350-88c19138cf18a40e478447c4600d92d63ff0ed50.zip
TONY: Remove more dead code related to unused raw codec
-rw-r--r--engines/tony/sound.cpp24
-rw-r--r--engines/tony/sound.h3
-rw-r--r--engines/tony/tony.cpp12
3 files changed, 13 insertions, 26 deletions
diff --git a/engines/tony/sound.cpp b/engines/tony/sound.cpp
index fe4e0ab0e7..88379baf15 100644
--- a/engines/tony/sound.cpp
+++ b/engines/tony/sound.cpp
@@ -461,7 +461,7 @@ void FPStream::release() {
*
* @returns True is everything is OK, False otherwise
*/
-bool FPStream::loadFile(const Common::String &fileName, uint32 codec, int bufSize) {
+bool FPStream::loadFile(const Common::String &fileName, int bufSize) {
if (!_soundSupported)
return true;
@@ -469,7 +469,7 @@ bool FPStream::loadFile(const Common::String &fileName, uint32 codec, int bufSiz
unloadFile();
// Save the codec type
- _codec = codec;
+ _codec = FPCODEC_ADPCM;
// Open the file stream for reading
if (!_file.open(fileName)) {
@@ -482,25 +482,13 @@ bool FPStream::loadFile(const Common::String &fileName, uint32 codec, int bufSiz
// Save the size of the stream
_size = _file.size();
- switch (_codec) {
- case FPCODEC_RAW:
- _rewindableStream = Audio::makeRawStream(&_file, 44100, Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN | Audio::FLAG_STEREO, DisposeAfterUse::NO);
- break;
-
- case FPCODEC_ADPCM:
#ifdef __amigaos4__
- // HACK: AmigaOS 4 has weird performance problems with reading in the audio thread,
- // so we read the whole stream into memory.
- _rewindableStream = Audio::makeADPCMStream(_file.readStream(_size), DisposeAfterUse::YES, 0, Audio::kADPCMDVI, 44100, 2);
+ // HACK: AmigaOS 4 has weird performance problems with reading in the audio thread,
+ // so we read the whole stream into memory.
+ _rewindableStream = Audio::makeADPCMStream(_file.readStream(_size), DisposeAfterUse::YES, 0, Audio::kADPCMDVI, 44100, 2);
#else
- _rewindableStream = Audio::makeADPCMStream(&_file, DisposeAfterUse::NO, 0, Audio::kADPCMDVI, 44100, 2);
+ _rewindableStream = Audio::makeADPCMStream(&_file, DisposeAfterUse::NO, 0, Audio::kADPCMDVI, 44100, 2);
#endif
- break;
-
- default:
- _file.close();
- return false;
- }
// All done
_fileLoaded = true;
diff --git a/engines/tony/sound.h b/engines/tony/sound.h
index 50ef78ae0d..6aa4ae9496 100644
--- a/engines/tony/sound.h
+++ b/engines/tony/sound.h
@@ -297,12 +297,11 @@ public:
* Opens a file stream
*
* @param fileName Filename to be opened
- * @param codec CODEC to be used to uncompress samples
*
* @returns True is everything is OK, False otherwise
*/
- bool loadFile(const Common::String &fileName, uint32 codec = FPCODEC_RAW, int sync = 2000);
+ bool loadFile(const Common::String &fileName, int sync);
/**
* Closes a file stream (opened or not).
diff --git a/engines/tony/tony.cpp b/engines/tony/tony.cpp
index b6ed51a84c..67ffd36d57 100644
--- a/engines/tony/tony.cpp
+++ b/engines/tony/tony.cpp
@@ -323,10 +323,10 @@ void TonyEngine::playMusic(int nChannel, const Common::String &fname, int nFX, b
_stream[GLOBALS._nextChannel]->unloadFile();
if (!getIsDemo()) {
- if (!_stream[GLOBALS._nextChannel]->loadFile(fname, FPCODEC_ADPCM, nSync))
+ if (!_stream[GLOBALS._nextChannel]->loadFile(fname, nSync))
error("failed to open music file '%s'", fname.c_str());
} else {
- _stream[GLOBALS._nextChannel]->loadFile(fname, FPCODEC_ADPCM, nSync);
+ _stream[GLOBALS._nextChannel]->loadFile(fname, nSync);
}
_stream[GLOBALS._nextChannel]->setLoop(bLoop);
@@ -335,10 +335,10 @@ void TonyEngine::playMusic(int nChannel, const Common::String &fname, int nFX, b
GLOBALS._flipflop = 1 - GLOBALS._flipflop;
} else {
if (!getIsDemo()) {
- if (!_stream[nChannel]->loadFile(fname, FPCODEC_ADPCM, nSync))
+ if (!_stream[nChannel]->loadFile(fname, nSync))
error("failed to open music file '%s'", fname.c_str());
} else {
- _stream[nChannel]->loadFile(fname, FPCODEC_ADPCM, nSync);
+ _stream[nChannel]->loadFile(fname, nSync);
}
_stream[nChannel]->setLoop(bLoop);
@@ -356,10 +356,10 @@ void TonyEngine::doNextMusic(CORO_PARAM, const void *param) {
CORO_BEGIN_CODE(_ctx);
if (!g_vm->getIsDemo()) {
- if (!streams[GLOBALS._nextChannel]->loadFile(GLOBALS._nextMusic, FPCODEC_ADPCM, GLOBALS._nextSync))
+ if (!streams[GLOBALS._nextChannel]->loadFile(GLOBALS._nextMusic, GLOBALS._nextSync))
error("failed to open next music file '%s'", GLOBALS._nextMusic.c_str());
} else {
- streams[GLOBALS._nextChannel]->loadFile(GLOBALS._nextMusic, FPCODEC_ADPCM, GLOBALS._nextSync);
+ streams[GLOBALS._nextChannel]->loadFile(GLOBALS._nextMusic, GLOBALS._nextSync);
}
streams[GLOBALS._nextChannel]->setLoop(GLOBALS._nextLoop);