[Scummvm-cvs-logs] SF.net SVN: scummvm: [33081] scummvm/branches/gsoc2008-rtl

cpage88 at users.sourceforge.net cpage88 at users.sourceforge.net
Wed Jul 16 00:54:39 CEST 2008


Revision: 33081
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33081&view=rev
Author:   cpage88
Date:     2008-07-15 15:54:39 -0700 (Tue, 15 Jul 2008)

Log Message:
-----------
Reverted some incorrect changes and fixed sound settings issues for LURE.  Fixed issues with quitting and calling GMM during intro sequences in LURE. Added a KEYCODE_MAINMENU in common/keyboard.h for the GMM.

Modified Paths:
--------------
    scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.cpp
    scummvm/branches/gsoc2008-rtl/common/keyboard.h
    scummvm/branches/gsoc2008-rtl/engines/lure/animseq.cpp
    scummvm/branches/gsoc2008-rtl/engines/lure/events.cpp
    scummvm/branches/gsoc2008-rtl/engines/lure/game.h
    scummvm/branches/gsoc2008-rtl/engines/lure/intro.cpp
    scummvm/branches/gsoc2008-rtl/engines/lure/lure.cpp
    scummvm/branches/gsoc2008-rtl/engines/lure/sound.cpp
    scummvm/branches/gsoc2008-rtl/engines/lure/sound.h

Modified: scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.cpp	2008-07-15 22:36:14 UTC (rev 33080)
+++ scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.cpp	2008-07-15 22:54:39 UTC (rev 33081)
@@ -392,7 +392,7 @@
 			_keyRepeatTime = time + kKeyRepeatInitialDelay;
 #endif
 			// Global Main Menu
-			if (event.kbd.keycode == Common::KEYCODE_F11)
+			if (event.kbd.keycode == Common::KEYCODE_MAINMENU)
 				if (g_engine && !g_engine->isPaused()) {
 					Common::Event menuEvent;
 					menuEvent.type = Common::EVENT_MAINMENU;

Modified: scummvm/branches/gsoc2008-rtl/common/keyboard.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/common/keyboard.h	2008-07-15 22:36:14 UTC (rev 33080)
+++ scummvm/branches/gsoc2008-rtl/common/keyboard.h	2008-07-15 22:54:39 UTC (rev 33081)
@@ -178,7 +178,10 @@
 	KEYCODE_MENU        = 319,
 	KEYCODE_POWER       = 320,      // Power Macintosh power key
 	KEYCODE_EURO        = 321,      // Some european keyboards
-	KEYCODE_UNDO        = 322       // Atari keyboard has Undo
+	KEYCODE_UNDO        = 322,      // Atari keyboard has Undo
+
+	// Global Main Menu key
+	KEYCODE_MAINMENU    = KEYCODE_F11
 };
 
 /**

Modified: scummvm/branches/gsoc2008-rtl/engines/lure/animseq.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/animseq.cpp	2008-07-15 22:36:14 UTC (rev 33080)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/animseq.cpp	2008-07-15 22:54:39 UTC (rev 33081)
@@ -45,6 +45,7 @@
 		while (events.pollEvent()) {
 			if ((events.type() == Common::EVENT_KEYDOWN) && (events.event().kbd.ascii != 0)) {
 				if (events.event().kbd.keycode == Common::KEYCODE_ESCAPE) return ABORT_END_INTRO;
+				else if (events.event().kbd.keycode == Common::KEYCODE_MAINMENU) return ABORT_NONE;
 				else return ABORT_NEXT_SCENE;
 			} else if (events.type() == Common::EVENT_LBUTTONDOWN)
 				return ABORT_NEXT_SCENE;

Modified: scummvm/branches/gsoc2008-rtl/engines/lure/events.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/events.cpp	2008-07-15 22:36:14 UTC (rev 33080)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/events.cpp	2008-07-15 22:54:39 UTC (rev 33081)
@@ -160,8 +160,6 @@
 
 
 bool Events::pollEvent() {
-	LureEngine &engine = LureEngine::getReference();
-	
 	if (!g_system->getEventManager()->pollEvent(_event)) return false;
 
 	// Handle keypress
@@ -216,7 +214,8 @@
 		if (engine.quit()) return true;
 
 		if (events.pollEvent()) {
-			if (((events.type() == Common::EVENT_KEYDOWN) && (events.event().kbd.ascii != 0)) ||
+			if (((events.type() == Common::EVENT_KEYDOWN) && (events.event().kbd.ascii != 0) && 
+			      	events.event().kbd.keycode != KEYCODE_MAINMENU) ||
 				(events.type() == Common::EVENT_LBUTTONDOWN))
 				return true;
 		}

Modified: scummvm/branches/gsoc2008-rtl/engines/lure/game.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/game.h	2008-07-15 22:36:14 UTC (rev 33080)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/game.h	2008-07-15 22:54:39 UTC (rev 33081)
@@ -27,6 +27,7 @@
 #define LURE_GAME_H
 
 
+#include "common/config-manager.h"
 #include "engines/engine.h"
 #include "lure/luredefs.h"
 #include "lure/menu.h"
@@ -85,8 +86,8 @@
 	bool &debugFlag() { return _debugFlag; }
 	bool fastTextFlag() { return _fastTextFlag; }
 	bool soundFlag() { return _soundFlag; }
-	uint8 sfxVolume() { return _sfxVolume; }
-	uint8 musicVolume() { return _musicVolume; }
+	uint8 sfxVolume() { return ConfMan.getInt("sfx_volume"); }
+	uint8 musicVolume() { return ConfMan.getInt("music_volume"); }
 	Debugger &debugger() { return *_debugger; }
 
 	// Menu item support methods

Modified: scummvm/branches/gsoc2008-rtl/engines/lure/intro.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/intro.cpp	2008-07-15 22:36:14 UTC (rev 33080)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/intro.cpp	2008-07-15 22:54:39 UTC (rev 33081)
@@ -60,6 +60,8 @@
 	screen.update();
 	Palette p(paletteId);
 
+	if (LureEngine::getReference().quit()) return true;
+	
 	if (isEGA) screen.setPalette(&p);
 	else screen.paletteFadeIn(&p);
 
@@ -82,6 +84,8 @@
 	if (events.interruptableDelay(milliseconds)) {
 		if (events.type() == Common::EVENT_KEYDOWN)
 			return events.event().kbd.keycode == 27;
+		else if (LureEngine::getReference().quit())
+			return true;
 		else if (events.type() == Common::EVENT_LBUTTONDOWN)
 			return false;
 	}

Modified: scummvm/branches/gsoc2008-rtl/engines/lure/lure.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/lure.cpp	2008-07-15 22:36:14 UTC (rev 33080)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/lure.cpp	2008-07-15 22:54:39 UTC (rev 33081)
@@ -247,7 +247,7 @@
 }
 
 void LureEngine::syncSoundSettings() {	
-	Sound.syncSounds(ConfMan.getInt("music_volume"), ConfMan.getInt("sfx_volume"));
+	Sound.syncSounds();
 }
 
 Common::String *LureEngine::detectSave(int slotNumber) {

Modified: scummvm/branches/gsoc2008-rtl/engines/lure/sound.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/sound.cpp	2008-07-15 22:36:14 UTC (rev 33080)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/sound.cpp	2008-07-15 22:54:39 UTC (rev 33081)
@@ -221,10 +221,10 @@
 	newEntry->numChannels = numChannels;
 	newEntry->flags = rec.flags;
 
-	if (newEntry->soundNumber & 0x80)	
-		newEntry->volume = ConfMan.getInt("music_volume");
-	else
-		newEntry->volume = ConfMan.getInt("sfx_volume");
+	if (_isRoland)
+		newEntry->volume = rec.volume;
+	else /* resource volumes do not seem to work well with our adlib emu */
+		newEntry->volume = 240; /* 255 causes clipping with adlib */
 
 	_activeSounds.push_back(SoundList::value_type(newEntry));
 
@@ -284,16 +284,17 @@
 
 // Used to sync the volume for all channels with the Config Manager
 //
-void SoundManager::syncSounds(uint8 musicVol, uint8 sfxVol) {
+void SoundManager::syncSounds() {
+	Game &game = Game::getReference();
 	musicInterface_TidySounds();
 
 	g_system->lockMutex(_soundMutex);
 	MusicListIterator i;
 	for (i = _playingSounds.begin(); i != _playingSounds.end(); ++i) {
 		if ((*i)->isMusic())
-			(*i)->setVolume(musicVol);
+			(*i)->setVolume(game.musicVolume());
 		else
-			(*i)->setVolume(sfxVol);
+			(*i)->setVolume(game.sfxVolume());
 	}
 	g_system->unlockMutex(_soundMutex);
 }
@@ -420,7 +421,8 @@
 		return;
 
 	bool isMusic = (soundNumber & 0x80) != 0;
-	
+	uint8 volume = isMusic ? game.musicVolume() : game.sfxVolume();
+
 	if (!game.soundFlag())
 		// Don't play sounds if sound is turned off
 		return;
@@ -655,9 +657,14 @@
 
 	_volume = volume;
 
+	Game &game = Game::getReference();
+	volume *= _isMusic ? game.musicVolume() : game.sfxVolume();
+
 	for (int i = 0; i < _numChannels; ++i) {
 		if (_channels[_channelNumber + i].midiChannel != NULL)
-			_channels[_channelNumber + i].midiChannel->volume(volume);
+			_channels[_channelNumber + i].midiChannel->volume(
+				_channels[_channelNumber + i].volume *
+				volume / 65025);
 	}
 }
 

Modified: scummvm/branches/gsoc2008-rtl/engines/lure/sound.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/sound.h	2008-07-15 22:36:14 UTC (rev 33080)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/sound.h	2008-07-15 22:54:39 UTC (rev 33081)
@@ -143,7 +143,7 @@
 	void stopSound(uint8 soundIndex);
 	void killSound(uint8 soundNumber);
 	void setVolume(uint8 soundNumber, uint8 volume);
-	void syncSounds(uint8 musicVol, uint8 sfxVol);
+	void syncSounds();
 	void tidySounds();
 	uint8 descIndexOf(uint8 soundNumber);
 	SoundDescResource *findSound(uint8 soundNumber);


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