[Scummvm-cvs-logs] SF.net SVN: scummvm:[41748] scummvm/trunk/engines/cruise

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Mon Jun 22 08:17:51 CEST 2009


Revision: 41748
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41748&view=rev
Author:   dreammaster
Date:     2009-06-22 06:17:50 +0000 (Mon, 22 Jun 2009)

Log Message:
-----------
Implemented the Op_SetVolume method like the original, which simply set a dummy variable and never actually changed the volume

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/function.cpp
    scummvm/trunk/engines/cruise/sound.cpp
    scummvm/trunk/engines/cruise/sound.h

Modified: scummvm/trunk/engines/cruise/function.cpp
===================================================================
--- scummvm/trunk/engines/cruise/function.cpp	2009-06-22 02:41:56 UTC (rev 41747)
+++ scummvm/trunk/engines/cruise/function.cpp	2009-06-22 06:17:50 UTC (rev 41748)
@@ -1630,16 +1630,13 @@
 }
 
 int16 Op_SetVolume(void) {
-	int oldVolume = _vm->sound().getVolume() >> 2;
+	int oldVolume = _vm->sound().getVolume();
 	int newVolume = popVar();
 
-	// TODO: The game seems to expect the volume will only range from 0 - 63, so for now
-	// I'm doing a translation of the full range 0 - 255 to the 0 - 63 for this script.
-	// Need to verify at some point that there's no problem with this
 	if (newVolume > 63) newVolume = 63;
 	if (newVolume >= 0) {
 		int volume = 63 - newVolume;
-		_vm->sound().setVolume(volume << 2);
+		_vm->sound().setVolume(volume);
 	}
 
 	return oldVolume >> 2;

Modified: scummvm/trunk/engines/cruise/sound.cpp
===================================================================
--- scummvm/trunk/engines/cruise/sound.cpp	2009-06-22 02:41:56 UTC (rev 41747)
+++ scummvm/trunk/engines/cruise/sound.cpp	2009-06-22 06:17:50 UTC (rev 41748)
@@ -814,15 +814,6 @@
 	_soundDriver->setChannelFrequency(channel, freq);
 }
 
-void PCSound::setVolume(int volume) {
-	warning("TODO: setVolume");
-}
-
-uint8 PCSound::getVolume() {
-	warning("TODO: getVolume");
-	return 63;
-}
-
 void PCSound::startSound(int channelNum, const byte *ptr, int size, int speed, int volume, bool loop) {
 	warning("TODO: validate startSound");
 	playSound(channelNum, speed, ptr, size, 0, 0, volume, loop);

Modified: scummvm/trunk/engines/cruise/sound.h
===================================================================
--- scummvm/trunk/engines/cruise/sound.h	2009-06-22 02:41:56 UTC (rev 41747)
+++ scummvm/trunk/engines/cruise/sound.h	2009-06-22 06:17:50 UTC (rev 41748)
@@ -41,6 +41,7 @@
 private:
 	Audio::Mixer *_mixer;
 	CruiseEngine *_vm;
+	int _genVolume;
 protected:
 	PCSoundDriver *_soundDriver;
 	PCSoundFxPlayer *_player;
@@ -71,8 +72,10 @@
 	bool musicLooping() const;
 	void musicLoop(bool v);
 	void startNote(int channel, int volume, int freq);
-	void setVolume(int volume);
-	uint8 getVolume();
+
+	// Note: Volume variable accessed by these methods is never actually used in original game
+	void setVolume(int volume) { _genVolume = volume; }
+	uint8 getVolume() const { return _genVolume; }
 };
 
 } // End of namespace Cruise


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