[Scummvm-cvs-logs] scummvm master -> 7ee36a97ee8c43b28c5dd4d8a0d3211698d1dc7f

Strangerke Strangerke at scummvm.org
Thu Dec 31 14:47:08 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:
7ee36a97ee TONY: As codec is always ADPCM, remove some dead code


Commit: 7ee36a97ee8c43b28c5dd4d8a0d3211698d1dc7f
    https://github.com/scummvm/scummvm/commit/7ee36a97ee8c43b28c5dd4d8a0d3211698d1dc7f
Author: Strangerke (strangerke at scummvm.org)
Date: 2015-12-31T14:41:18+01:00

Commit Message:
TONY: As codec is always ADPCM, remove some dead code

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



diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp
index 2875bc0..cbc15b9 100644
--- a/engines/mads/scene.cpp
+++ b/engines/mads/scene.cpp
@@ -504,6 +504,8 @@ void  Scene::drawElements(ScreenTransition transitionType, bool surfaceFlag) {
 	// Merge any identified dirty areas
 	_dirtyAreas.merge(1, DIRTY_AREAS_SIZE);
 
+	if (_posAdjust != Common::Point(0, 0))
+		warning("Adjust used %d %d", _posAdjust.x, _posAdjust.y);
 	// Copy background for the dirty areas to the screen
 	_dirtyAreas.copy(&_backgroundSurface, &_vm->_screen, _posAdjust);
 
diff --git a/engines/tony/sound.cpp b/engines/tony/sound.cpp
index 2a4eb82..fe4e0ab 100644
--- a/engines/tony/sound.cpp
+++ b/engines/tony/sound.cpp
@@ -219,11 +219,10 @@ bool FPSfx::loadVoiceFromVDB(Common::File &vdbFP) {
  * Opens a file and loads a sound effect.
  *
  * @param fileName         Sfx filename
- * @param codec            CODEC used to uncompress the samples
  *
  * @returns                True is everything is OK, False otherwise
  */
-bool FPSfx::loadFile(const char *fileName, uint32 codec) {
+bool FPSfx::loadFile(const char *fileName) {
 	if (!_soundSupported)
 		return true;
 
@@ -242,18 +241,7 @@ bool FPSfx::loadFile(const char *fileName, uint32 codec) {
 	uint32 channels = file.readUint32LE();
 
 	Common::SeekableReadStream *buffer = file.readStream(file.size() - file.pos());
-
-	if (codec == FPCODEC_ADPCM) {
-		_rewindableStream = Audio::makeADPCMStream(buffer, DisposeAfterUse::YES, 0, Audio::kADPCMDVI, rate, channels);
-	} else {
-		byte flags = Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN;
-
-		if (channels == 2)
-			flags |= Audio::FLAG_STEREO;
-
-		_rewindableStream = Audio::makeRawStream(buffer, rate, flags, DisposeAfterUse::YES);
-	}
-
+	_rewindableStream = Audio::makeADPCMStream(buffer, DisposeAfterUse::YES, 0, Audio::kADPCMDVI, rate, channels);
 	_fileLoaded = true;
 	return true;
 }
diff --git a/engines/tony/sound.h b/engines/tony/sound.h
index 446dc68..50ef78a 100644
--- a/engines/tony/sound.h
+++ b/engines/tony/sound.h
@@ -179,7 +179,7 @@ public:
 	 * @returns             True is everything is OK, False otherwise
 	 */
 
-	bool loadFile(const char *fileName, uint32 codec = FPCODEC_RAW);
+	bool loadFile(const char *fileName);
 	bool loadWave(Common::SeekableReadStream *stream);
 	bool loadVoiceFromVDB(Common::File &vdbFP);
 
diff --git a/engines/tony/tony.cpp b/engines/tony/tony.cpp
index 2857bb9..b6ed51a 100644
--- a/engines/tony/tony.cpp
+++ b/engines/tony/tony.cpp
@@ -433,7 +433,7 @@ void TonyEngine::preloadSFX(int nChannel, const char *fn) {
 
 	_theSound.createSfx(&_sfx[nChannel]);
 
-	_sfx[nChannel]->loadFile(fn, FPCODEC_ADPCM);
+	_sfx[nChannel]->loadFile(fn);
 }
 
 FPSfx *TonyEngine::createSFX(Common::SeekableReadStream *stream) {
@@ -453,7 +453,7 @@ void TonyEngine::preloadUtilSFX(int nChannel, const char *fn) {
 
 	_theSound.createSfx(&_utilSfx[nChannel]);
 
-	_utilSfx[nChannel]->loadFile(fn, FPCODEC_ADPCM);
+	_utilSfx[nChannel]->loadFile(fn);
 	_utilSfx[nChannel]->setVolume(63);
 }
 






More information about the Scummvm-git-logs mailing list