[Scummvm-cvs-logs] scummvm master -> 88c19138cf18a40e478447c4600d92d63ff0ed50

Strangerke Strangerke at scummvm.org
Thu Dec 31 14:54:22 CET 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
88c19138cf TONY: Remove more dead code related to unused raw codec


Commit: 88c19138cf18a40e478447c4600d92d63ff0ed50
    https://github.com/scummvm/scummvm/commit/88c19138cf18a40e478447c4600d92d63ff0ed50
Author: Strangerke (strangerke at scummvm.org)
Date: 2015-12-31T14:48:38+01:00

Commit Message:
TONY: Remove more dead code related to unused raw codec

Changed paths:
    engines/tony/sound.cpp
    engines/tony/sound.h
    engines/tony/tony.cpp



diff --git a/engines/tony/sound.cpp b/engines/tony/sound.cpp
index fe4e0ab..88379ba 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 50ef78a..6aa4ae9 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 b6ed51a..67ffd36 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);






More information about the Scummvm-git-logs mailing list