[Scummvm-cvs-logs] scummvm master -> 4c13725a55fed393188a008a6e95a28e0c9c74c8

bluegr bluegr at gmail.com
Wed Jun 12 10:37:32 CEST 2013


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

Summary:
9d489e82ce NEVERHOOD: Remove or silence by default some more debug output
323fe8c45b NEVERHOOD: Stop all sounds before restoring / restarting
6bdc262c07 NEVERHOOD: Move some more cheat code to the cheat console command
09b235e2bd NEVERHOOD: Fix a slight glitch with the symbols cheat command
4c13725a55 NEVERHOOD: Hook the dump vars debug code into a command, "dumpvars"


Commit: 9d489e82ce3925150485e5bf50653c81e553bbcb
    https://github.com/scummvm/scummvm/commit/9d489e82ce3925150485e5bf50653c81e553bbcb
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-06-12T01:35:47-07:00

Commit Message:
NEVERHOOD: Remove or silence by default some more debug output

Changed paths:
    engines/neverhood/klaymen.cpp
    engines/neverhood/modules/module1000.cpp
    engines/neverhood/modules/module2200.cpp



diff --git a/engines/neverhood/klaymen.cpp b/engines/neverhood/klaymen.cpp
index 06d606e..7056780 100644
--- a/engines/neverhood/klaymen.cpp
+++ b/engines/neverhood/klaymen.cpp
@@ -434,7 +434,7 @@ void Klaymen::stopWalking() {
 }
 
 void Klaymen::startIdleAnimation(uint32 fileHash, AnimationCb callback) {
-	debug("startIdleAnimation(%08X)", fileHash);
+	debug(1, "startIdleAnimation(%08X)", fileHash);
 	NextState(callback);
 	SetUpdateHandler(&Klaymen::upIdleAnimation);
 }
diff --git a/engines/neverhood/modules/module1000.cpp b/engines/neverhood/modules/module1000.cpp
index 2a5afe3..a28d934 100644
--- a/engines/neverhood/modules/module1000.cpp
+++ b/engines/neverhood/modules/module1000.cpp
@@ -27,8 +27,6 @@ namespace Neverhood {
 Module1000::Module1000(NeverhoodEngine *vm, Module *parentModule, int which)
 	: Module(vm, parentModule) {
 	
-	debug("Create Module1000(%d)", which);
-
 	_musicFileHash = getGlobalVar(V_ENTRANCE_OPEN) ? 0x81106480 : 0x00103144;		
 
 	_vm->_soundMan->addMusic(0x03294419, 0x061880C6);
diff --git a/engines/neverhood/modules/module2200.cpp b/engines/neverhood/modules/module2200.cpp
index 39e3788..08ed274 100644
--- a/engines/neverhood/modules/module2200.cpp
+++ b/engines/neverhood/modules/module2200.cpp
@@ -31,8 +31,6 @@ namespace Neverhood {
 Module2200::Module2200(NeverhoodEngine *vm, Module *parentModule, int which)
 	: Module(vm, parentModule) {
 	
-	debug("Create Module2200(%d)", which);
-
 	_vm->_soundMan->addMusic(0x11391412, 0x601C908C); 
 
 	if (which < 0)


Commit: 323fe8c45bc9e602c7d8a043210e67811bab9d38
    https://github.com/scummvm/scummvm/commit/323fe8c45bc9e602c7d8a043210e67811bab9d38
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-06-12T01:35:47-07:00

Commit Message:
NEVERHOOD: Stop all sounds before restoring / restarting

This fixes the static heard when loading a saved game to a scene with
music, when the current scene also has music

Changed paths:
    engines/neverhood/gamemodule.cpp
    engines/neverhood/sound.cpp
    engines/neverhood/sound.h



diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp
index 70450e2..96e8cc1 100644
--- a/engines/neverhood/gamemodule.cpp
+++ b/engines/neverhood/gamemodule.cpp
@@ -411,6 +411,8 @@ void GameModule::checkRequests() {
 	}
 	if (_restoreGameRequested) {
 		_restoreGameRequested = false;
+		_vm->_audioResourceMan->stopAllSounds();
+		_vm->_soundMan->stopAllSounds();
 		delete _childObject;
 		delete _prevChildObject;
 		_childObject = NULL;
diff --git a/engines/neverhood/sound.cpp b/engines/neverhood/sound.cpp
index c84b751..46ec800 100644
--- a/engines/neverhood/sound.cpp
+++ b/engines/neverhood/sound.cpp
@@ -254,10 +254,26 @@ SoundMan::SoundMan(NeverhoodEngine *vm)
 }
 
 SoundMan::~SoundMan() {
-	for (uint i = 0; i < _soundItems.size(); ++i)
-		delete _soundItems[i];
-	for (uint i = 0; i < _musicItems.size(); ++i)
-		delete _musicItems[i];
+	stopAllSounds();
+}
+
+void SoundMan::stopAllSounds() {
+	for (uint i = 0; i < _soundItems.size(); ++i) {
+		if (_soundItems[i]) {
+			_soundItems[i]->stopSound();
+			delete _soundItems[i];
+			_soundItems[i] = NULL;
+		}
+	}
+	for (uint i = 0; i < _musicItems.size(); ++i) {
+		if (_musicItems[i]) {
+			_musicItems[i]->stopMusic(0, 0);
+			delete _musicItems[i];
+			_musicItems[i] = NULL;
+		}
+	}
+
+	_soundIndex1 = _soundIndex2 = _soundIndex3 = -1;
 }
 
 void SoundMan::addMusic(uint32 groupNameHash, uint32 musicFileHash) {
@@ -708,11 +724,25 @@ AudioResourceMan::AudioResourceMan(NeverhoodEngine *vm)
 	: _vm(vm) {
 }
 
+void AudioResourceMan::stopAllSounds() {
+	for (uint i = 0; i < _soundItems.size(); ++i) {
+		if (_soundItems[i]) {
+			_soundItems[i]->stopSound();
+			delete _soundItems[i];
+			_soundItems[i] = NULL;
+		}
+	}
+	for (uint i = 0; i < _musicItems.size(); ++i) {
+		if (_musicItems[i]) {
+			_musicItems[i]->stopMusic(0);
+			delete _musicItems[i];
+			_musicItems[i] = NULL;
+		}
+	}
+}
+
 AudioResourceMan::~AudioResourceMan() {
-	for (uint i = 0; i < _soundItems.size(); ++i)
-		delete _soundItems[i];
-	for (uint i = 0; i < _musicItems.size(); ++i)
-		delete _musicItems[i];
+	stopAllSounds();
 }
 
 int16 AudioResourceMan::addSound(uint32 fileHash) {
diff --git a/engines/neverhood/sound.h b/engines/neverhood/sound.h
index d331899..aa5da28 100644
--- a/engines/neverhood/sound.h
+++ b/engines/neverhood/sound.h
@@ -129,6 +129,8 @@ public:
 	SoundMan(NeverhoodEngine *vm);
 	~SoundMan();
 
+	void stopAllSounds();
+
 	// Music
 	void addMusic(uint32 groupNameHash, uint32 musicFileHash);
 	void deleteMusic(uint32 musicFileHash);
@@ -262,6 +264,8 @@ public:
 	AudioResourceMan(NeverhoodEngine *vm);
 	~AudioResourceMan();
 	
+	void stopAllSounds();
+
 	int16 addSound(uint32 fileHash);
 	void removeSound(int16 soundIndex);
 


Commit: 6bdc262c0728ed025b2c467db8018ede9104d5f3
    https://github.com/scummvm/scummvm/commit/6bdc262c0728ed025b2c467db8018ede9104d5f3
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-06-12T01:35:48-07:00

Commit Message:
NEVERHOOD: Move some more cheat code to the cheat console command

Changed paths:
    engines/neverhood/console.cpp
    engines/neverhood/modules/module2800.cpp



diff --git a/engines/neverhood/console.cpp b/engines/neverhood/console.cpp
index eae6b92..411e5ec 100644
--- a/engines/neverhood/console.cpp
+++ b/engines/neverhood/console.cpp
@@ -76,6 +76,7 @@ bool Console::Cmd_Cheat(int argc, const char **argv) {
 		DebugPrintf("  dice    - shows the correct dice combination in the teddy bear puzzle, module 1100, scene 6\n");
 		DebugPrintf("  memory  - solves the memory puzzle, module 1400, scene 4\n");
 		DebugPrintf("  radio   - enables the radio, module 3000, scene 9 - same as pulling the rightmost cord in the flytrap room\n");
+		DebugPrintf("  music   - shows the correct index in the radio music puzzle, module 2800, scene 1\n");
 		DebugPrintf("  symbols - solves the symbols puzzle, module 1600, scene 8. Only available in that room\n");
 		DebugPrintf("  tubes   - shows the correct test tube combination in module 2800, scenes 7 and 10, can be used anywhere\n");		
 		return true;
@@ -128,6 +129,9 @@ bool Console::Cmd_Cheat(int argc, const char **argv) {
 		}
 
 		DebugPrintf("Puzzle solved\n");
+	} else if (cheatName == "music") {
+		Scene *scene = (Scene *)((GameModule *)_vm->_gameModule->_childObject)->_childObject;
+		DebugPrintf("Good music index: %d, current radio music index: %d\n", scene->getGlobalVar(V_CURR_RADIO_MUSIC_INDEX), scene->getGlobalVar(V_GOOD_RADIO_MUSIC_INDEX));
 	} else if (cheatName == "radio") {
 		Scene *scene = (Scene *)((GameModule *)_vm->_gameModule->_childObject)->_childObject;
 		scene->setGlobalVar(V_RADIO_ENABLED, 1);
diff --git a/engines/neverhood/modules/module2800.cpp b/engines/neverhood/modules/module2800.cpp
index f359cc3..3d76d05 100644
--- a/engines/neverhood/modules/module2800.cpp
+++ b/engines/neverhood/modules/module2800.cpp
@@ -616,10 +616,6 @@ void Scene2802::update() {
 	if (prevTuneStatus != _currTuneStatus)
 		changeTuneStatus(prevTuneStatus, _currTuneStatus);
 		
-	//DEBUG>>>
-	//debug("_currRadioMusicIndex = %d; V_GOOD_RADIO_MUSIC_INDEX = %d", _currRadioMusicIndex, getGlobalVar(V_GOOD_RADIO_MUSIC_INDEX));
-	//DEBUG<<<
-
 	if (getGlobalVar(V_RADIO_MOVE_DISH_VIDEO) && prevTuneStatus != _currTuneStatus && _currRadioMusicIndex != 0) {
 		setGlobalVar(V_RADIO_MOVE_DISH_VIDEO, 0);
 		leaveScene(1);


Commit: 09b235e2bd2abf5d4f377e955a8252aed30fc3af
    https://github.com/scummvm/scummvm/commit/09b235e2bd2abf5d4f377e955a8252aed30fc3af
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-06-12T01:35:48-07:00

Commit Message:
NEVERHOOD: Fix a slight glitch with the symbols cheat command

Now, the countdown to show the next symbol is properly reset when the
command is used

Changed paths:
    engines/neverhood/console.cpp



diff --git a/engines/neverhood/console.cpp b/engines/neverhood/console.cpp
index 411e5ec..8db62d8 100644
--- a/engines/neverhood/console.cpp
+++ b/engines/neverhood/console.cpp
@@ -147,6 +147,7 @@ bool Console::Cmd_Cheat(int argc, const char **argv) {
 
 			scene->_changeCurrentSymbol = false;
 			scene->_symbolPosition = 11;
+			scene->_countdown1 = 36;
 
 			DebugPrintf("Puzzle solved\n");
 		} else {


Commit: 4c13725a55fed393188a008a6e95a28e0c9c74c8
    https://github.com/scummvm/scummvm/commit/4c13725a55fed393188a008a6e95a28e0c9c74c8
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-06-12T01:35:48-07:00

Commit Message:
NEVERHOOD: Hook the dump vars debug code into a command, "dumpvars"

Also, did some minor cleanup of the console commands
(alphabetical reordering)

Changed paths:
    engines/neverhood/console.cpp
    engines/neverhood/console.h
    engines/neverhood/gamevars.cpp
    engines/neverhood/gamevars.h



diff --git a/engines/neverhood/console.cpp b/engines/neverhood/console.cpp
index 8db62d8..7b5add6 100644
--- a/engines/neverhood/console.cpp
+++ b/engines/neverhood/console.cpp
@@ -30,9 +30,10 @@
 namespace Neverhood {
 
 Console::Console(NeverhoodEngine *vm) : GUI::Debugger(), _vm(vm) {
+	DCmd_Register("cheat",			WRAP_METHOD(Console, Cmd_Cheat));
+	DCmd_Register("dumpvars",		WRAP_METHOD(Console, Cmd_Dumpvars));
 	DCmd_Register("room",			WRAP_METHOD(Console, Cmd_Room));
 	DCmd_Register("surfaces",		WRAP_METHOD(Console, Cmd_Surfaces));
-	DCmd_Register("cheat",			WRAP_METHOD(Console, Cmd_Cheat));
 }
 
 Console::~Console() {
@@ -75,8 +76,8 @@ bool Console::Cmd_Cheat(int argc, const char **argv) {
 		DebugPrintf("  cannon  - sets the correct cannon combination in module 3000, scene 8\n");
 		DebugPrintf("  dice    - shows the correct dice combination in the teddy bear puzzle, module 1100, scene 6\n");
 		DebugPrintf("  memory  - solves the memory puzzle, module 1400, scene 4\n");
-		DebugPrintf("  radio   - enables the radio, module 3000, scene 9 - same as pulling the rightmost cord in the flytrap room\n");
 		DebugPrintf("  music   - shows the correct index in the radio music puzzle, module 2800, scene 1\n");
+		DebugPrintf("  radio   - enables the radio, module 3000, scene 9 - same as pulling the rightmost cord in the flytrap room\n");
 		DebugPrintf("  symbols - solves the symbols puzzle, module 1600, scene 8. Only available in that room\n");
 		DebugPrintf("  tubes   - shows the correct test tube combination in module 2800, scenes 7 and 10, can be used anywhere\n");		
 		return true;
@@ -162,4 +163,10 @@ bool Console::Cmd_Cheat(int argc, const char **argv) {
 	return true;
 }
 
+bool Console::Cmd_Dumpvars(int argc, const char **argv) {
+	_vm->_gameVars->dumpVars(this);
+
+	return true;
+}
+
 } // End of namespace Neverhood
diff --git a/engines/neverhood/console.h b/engines/neverhood/console.h
index 7349820..40c11b5 100644
--- a/engines/neverhood/console.h
+++ b/engines/neverhood/console.h
@@ -40,6 +40,7 @@ private:
 	bool Cmd_Room(int argc, const char **argv);
 	bool Cmd_Surfaces(int argc, const char **argv);
 	bool Cmd_Cheat(int argc, const char **argv);
+	bool Cmd_Dumpvars(int argc, const char **argv);
 };
 
 } // End of namespace Neverhood
diff --git a/engines/neverhood/gamevars.cpp b/engines/neverhood/gamevars.cpp
index 87f5fe6..dc25f74 100644
--- a/engines/neverhood/gamevars.cpp
+++ b/engines/neverhood/gamevars.cpp
@@ -20,6 +20,7 @@
  *
  */
 
+#include "neverhood/console.h"
 #include "neverhood/gamevars.h"
 
 namespace Neverhood {
@@ -123,10 +124,10 @@ int16 GameVars::getSubVarIndex(int16 varIndex, uint32 subNameHash) {
 	return subVarIndex;
 }
 
-void GameVars::dumpVars() {
+void GameVars::dumpVars(Console *con) {
 	for (Common::Array<GameVar>::iterator it = _vars.begin(); it != _vars.end(); ++it) {
 		GameVar gameVar = *it;
-		debug("%08X %08X %3d %3d", gameVar.nameHash, gameVar.value, gameVar.firstIndex, gameVar.nextIndex);
+		con->DebugPrintf("hash: %08X, var: %08X, first index: %3d, next index: %3d\n", gameVar.nameHash, gameVar.value, gameVar.firstIndex, gameVar.nextIndex);
 	}
 }
 
diff --git a/engines/neverhood/gamevars.h b/engines/neverhood/gamevars.h
index 5337c13..de9ffb8 100644
--- a/engines/neverhood/gamevars.h
+++ b/engines/neverhood/gamevars.h
@@ -169,6 +169,8 @@ struct GameVar {
 	int16 firstIndex, nextIndex;
 };
 
+class Console;
+
 class GameVars {
 public:
 	GameVars();
@@ -179,7 +181,7 @@ public:
 	void setGlobalVar(uint32 nameHash, uint32 value);
 	uint32 getSubVar(uint32 nameHash, uint32 subNameHash);
 	void setSubVar(uint32 nameHash, uint32 subNameHash, uint32 value);
-	void dumpVars();
+	void dumpVars(Console *con);
 protected:
 	Common::Array<GameVar> _vars;
 	int16 addVar(uint32 nameHash, uint32 value);






More information about the Scummvm-git-logs mailing list