[Scummvm-cvs-logs] CVS: scummvm/simon debugger.cpp,1.1,1.2 debugger.h,1.1,1.2

Travis Howell kirben at users.sourceforge.net
Tue Jan 27 09:29:41 CET 2004


Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31317/simon

Modified Files:
	debugger.cpp debugger.h 
Log Message:

Add help
Add music option for Simon1


Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/debugger.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- debugger.cpp	27 Jan 2004 16:28:38 -0000	1.1
+++ debugger.cpp	27 Jan 2004 17:13:43 -0000	1.2
@@ -31,18 +31,20 @@
 	_vm = vm;
 		
 	DCmd_Register("exit", &Debugger::Cmd_Exit);
+	DCmd_Register("help", &Debugger::Cmd_Help);
 	DCmd_Register("quit", &Debugger::Cmd_Exit);
-	DCmd_Register("playVoice", &Debugger::Cmd_PlayVoice);
+	DCmd_Register("voice", &Debugger::Cmd_PlayVoice);
+	DCmd_Register("music", &Debugger::Cmd_PlayMusic);
 }
 
 
 void Debugger::preEnter() {
-	_vm->midi.pause(1);
+	//_vm->midi.pause(1);
 }
 
 
 void Debugger::postEnter() {
-	_vm->midi.pause(0);
+	//_vm->midi.pause(0);
 }
 
 
@@ -51,12 +53,45 @@
 	return false;	
 }
  
+bool Debugger::Cmd_Help(int argc, const char **argv) {
+	// console normally has 39 line width
+	// wrap around nicely
+	int width = 0, size, i;
+
+	DebugPrintf("Commands are:\n");
+	for (i = 0 ; i < _dcmd_count ; i++) {
+		size = strlen(_dcmds[i].name) + 1;
+
+		if ((width + size) >= 39) {
+			DebugPrintf("\n");
+			width = size;
+		} else
+			width += size;
+
+		DebugPrintf("%s ", _dcmds[i].name);
+	}
+	DebugPrintf("\n");
+	return true;
+}
+
+bool Debugger::Cmd_PlayMusic(int argc, const char **argv) {
+	uint music = atoi(argv[1]);
+	if (_vm->_game & GF_SIMON2) {
+		DebugPrintf("No support for Simon the Sorcerer 2\n");
+	} else if (music > 0 && music < 35) {
+		_vm->loadMusic(music);
+	} else
+		DebugPrintf("Syntax: music <musicnum>\n");
+
+	return true;
+}
+
 bool Debugger::Cmd_PlayVoice(int argc, const char **argv) {
 	if (argc > 1) {
 		uint voice = atoi(argv[1]);
 		_vm->_sound->playVoice(voice);
 	} else
-		DebugPrintf("Syntax: playvoice <soundnum>\n");
+		DebugPrintf("Syntax: voice <soundnum>\n");
 
 	return true;
 }

Index: debugger.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/debugger.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- debugger.h	27 Jan 2004 16:28:38 -0000	1.1
+++ debugger.h	27 Jan 2004 17:13:43 -0000	1.2
@@ -39,7 +39,9 @@
 	virtual void postEnter();
 
 	bool Cmd_Exit(int argc, const char **argv);
+	bool Cmd_Help(int argc, const char **argv);
 	bool Cmd_PlayVoice(int argc, const char **argv);
+	bool Cmd_PlayMusic(int argc, const char **argv);
 };
 
 } // End of namespace Simon





More information about the Scummvm-git-logs mailing list