[Scummvm-git-logs] scummvm master -> e8b6a1a5b40be348d47109045a9b9d5a717c304f

dreammaster paulfgilbert at gmail.com
Sat Feb 22 20:09:56 UTC 2020


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:
e8b6a1a5b4 ULTIMA8: Remaining console commands moved to Debugger


Commit: e8b6a1a5b40be348d47109045a9b9d5a717c304f
    https://github.com/scummvm/scummvm/commit/e8b6a1a5b40be348d47109045a9b9d5a717c304f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-02-22T12:09:27-08:00

Commit Message:
ULTIMA8: Remaining console commands moved to Debugger

Changed paths:
    engines/ultima/ultima8/gumps/console_gump.cpp
    engines/ultima/ultima8/gumps/console_gump.h
    engines/ultima/ultima8/misc/console.cpp
    engines/ultima/ultima8/misc/console.h
    engines/ultima/ultima8/misc/debugger.cpp
    engines/ultima/ultima8/misc/debugger.h
    engines/ultima/ultima8/usecode/uc_machine.cpp


diff --git a/engines/ultima/ultima8/gumps/console_gump.cpp b/engines/ultima/ultima8/gumps/console_gump.cpp
index d7f04a7..48787d3 100644
--- a/engines/ultima/ultima8/gumps/console_gump.cpp
+++ b/engines/ultima/ultima8/gumps/console_gump.cpp
@@ -34,7 +34,6 @@ namespace Ultima8 {
 DEFINE_RUNTIME_CLASSTYPE_CODE(ConsoleGump, Gump)
 
 ConsoleGump::ConsoleGump() : Gump() {
-	con->AddConsoleCommand("ConsoleGump::toggle", ConsoleGump::ConCmd_toggle);
 }
 
 ConsoleGump::ConsoleGump(int x, int y, int width, int height) :
@@ -44,12 +43,9 @@ ConsoleGump::ConsoleGump(int x, int y, int width, int height) :
 
 	// Resize it
 	con->CheckResize(width);
-
-	con->AddConsoleCommand("ConsoleGump::toggle", ConsoleGump::ConCmd_toggle);
 }
 
 ConsoleGump::~ConsoleGump() {
-	con->RemoveConsoleCommand(ConsoleGump::ConCmd_toggle);
 }
 
 void ConsoleGump::RenderSurfaceChanged() {
@@ -218,11 +214,6 @@ void ConsoleGump::run() {
 	}
 }
 
-void ConsoleGump::ConCmd_toggle(const Console::ArgvType &argv) {
-	ConsoleGump *consoleGump = Ultima8Engine::get_instance()->getConsoleGump();
-	consoleGump->ToggleConsole();
-}
-
 void ConsoleGump::saveData(ODataSource *ods) {
 	CANT_HAPPEN_MSG("Trying to save ConsoleGump");
 }
diff --git a/engines/ultima/ultima8/gumps/console_gump.h b/engines/ultima/ultima8/gumps/console_gump.h
index 9495b4c..3353b3f 100644
--- a/engines/ultima/ultima8/gumps/console_gump.h
+++ b/engines/ultima/ultima8/gumps/console_gump.h
@@ -69,8 +69,6 @@ public:
 	void        OnFocus(bool /*gain*/) override;
 	bool        OnKeyDown(int key, int mod) override;
 
-	static void         ConCmd_toggle(const Console::ArgvType &argv);   //!< "ConsoleGump::toggle" console command
-
 	bool    loadData(IDataSource *ids, uint32 version);
 
 protected:
diff --git a/engines/ultima/ultima8/misc/console.cpp b/engines/ultima/ultima8/misc/console.cpp
index b89e321..41e5036 100644
--- a/engines/ultima/ultima8/misc/console.cpp
+++ b/engines/ultima/ultima8/misc/console.cpp
@@ -60,10 +60,6 @@ Console::Console() : _current(0), _xOff(0), _display(0), _lineWidth(-1),
 	ppout = &_strOut;
 	pperr = &_errOut;
 
-	// Lets try adding a Console command!
-	AddConsoleCommand("Console::CmdList", ConCmd_CmdList);
-	AddConsoleCommand("Console::CmdHistory", ConCmd_CmdHistory);
-
 	PrintInternal("Console initialized.\n");
 }
 
@@ -71,9 +67,6 @@ Console::Console() : _current(0), _xOff(0), _display(0), _lineWidth(-1),
 // Destructor
 //
 Console::~Console() {
-	RemoveConsoleCommand(Console::ConCmd_CmdList);
-	RemoveConsoleCommand(Console::ConCmd_CmdHistory);
-
 	// Need to do this first
 	PrintPutchar();
 
@@ -662,7 +655,7 @@ void Console::AddCharacterToCommandBuffer(int ch) {
 					ArgvType argv;
 					StringToArgv(args, argv);
 
-					ConCmd_CmdList(argv);
+					//ConCmd_CmdList(argv);
 					commandBuffer = common;
 				} else
 					commandBuffer = common;
@@ -707,47 +700,6 @@ void Console::MoveCommandCursor(int num) {
 	if (commandCursorPos > static_cast<int>(commandBuffer.size())) commandCursorPos = static_cast<int>(commandBuffer.size());
 }
 
-void Console::ConCmd_CmdList(const Console::ArgvType &argv) {
-	CommandsMap::iterator it;
-	int i = 0;
-
-	//pout << Std::endl;
-
-	if (argv.size() > 1) {
-		for (size_t a = 1; a < argv.size(); a++) {
-			const ArgsType &arg = argv[a];
-
-			for (it = con->ConsoleCommands.begin(); it != con->ConsoleCommands.end(); ++it)
-				if (it->_value) {
-					if (it->_key.compareToIgnoreCase(arg)) continue;
-
-					// TODO: Fix this
-					//pout << " " << it->_key << Std::endl;
-					i ++;
-				}
-		}
-	} else {
-		for (it = con->ConsoleCommands.begin(); it != con->ConsoleCommands.end(); ++it)
-			if (it->_value) {
-				// TODO
-				//pout << " " << it->_key << Std::endl;
-				i ++;
-			}
-	}
-
-	// TODO
-	//pout << i << " commands" << Std::endl;
-}
-
-void Console::ConCmd_CmdHistory(const Console::ArgvType & /*argv*/) {
-	Std::vector<ArgsType>::iterator it;
-
-	for (it = con->commandHistory.begin(); it != con->commandHistory.end(); ++it)
-		pout << " " << *it << Std::endl;
-
-	pout << con->commandHistory.size() << " commands" << Std::endl;
-}
-
 /*
 ==============================================================================
 
diff --git a/engines/ultima/ultima8/misc/console.h b/engines/ultima/ultima8/misc/console.h
index 06a0eba..8c309b5 100644
--- a/engines/ultima/ultima8/misc/console.h
+++ b/engines/ultima/ultima8/misc/console.h
@@ -379,12 +379,6 @@ public:
 		commandInsert = !commandInsert;
 	}
 
-	//! "CmdList" console command
-	static void     ConCmd_CmdList(const Console::ArgvType &argv);
-
-	//! "CmdHistory" console command
-	static void     ConCmd_CmdHistory(const Console::ArgvType &argv);
-
 private:
 
 	// Print a text string to the console
diff --git a/engines/ultima/ultima8/misc/debugger.cpp b/engines/ultima/ultima8/misc/debugger.cpp
index 9580993..e13a111 100644
--- a/engines/ultima/ultima8/misc/debugger.cpp
+++ b/engines/ultima/ultima8/misc/debugger.cpp
@@ -28,6 +28,7 @@
 #include "ultima/ultima8/filesys/file_system.h"
 #include "ultima/ultima8/filesys/raw_archive.h"
 #include "ultima/ultima8/graphics/inverter_process.h"
+#include "ultima/ultima8/gumps/console_gump.h"
 #include "ultima/ultima8/gumps/fast_area_vis_gump.h"
 #include "ultima/ultima8/gumps/game_map_gump.h"
 #include "ultima/ultima8/gumps/minimap_gump.h"
@@ -1408,6 +1409,12 @@ bool Debugger::cmdStopTrace(int argc, const char **argv) {
 #endif
 
 
+bool Debugger::cmdToggleConsole(int argc, const char **argv) {
+	ConsoleGump *consoleGump = Ultima8Engine::get_instance()->getConsoleGump();
+	consoleGump->ToggleConsole();
+	return false;
+}
+
 bool Debugger::cmdVerifyQuit(int argc, const char **argv) {
 	QuitGump::verifyQuit();
 	return false;
diff --git a/engines/ultima/ultima8/misc/debugger.h b/engines/ultima/ultima8/misc/debugger.h
index 06fea7e..29948d5 100644
--- a/engines/ultima/ultima8/misc/debugger.h
+++ b/engines/ultima/ultima8/misc/debugger.h
@@ -139,6 +139,7 @@ private:
 #endif
 
 	// Miscellaneous
+	bool cmdToggleConsole(int argc, const char **argv);
 	bool cmdToggleFastArea(int argc, const char **argv);
 	bool cmdVerifyQuit(int argc, const char **argv);
 	bool cmdU8ShapeViewer(int argc, const char **argv);
@@ -148,6 +149,7 @@ private:
 	bool cmdInvertScreen(int argc, const char **argv);
 	bool cmdPlayMovie(int argc, const char **argv);
 	bool cmdPlayMusic(int argc, const char **argv);
+
 #ifdef DEBUG
 	bool cmdVisualDebugPathfinder(int argc, const char **argv);
 #endif
diff --git a/engines/ultima/ultima8/usecode/uc_machine.cpp b/engines/ultima/ultima8/usecode/uc_machine.cpp
index 9bc8967..56dd1a0 100644
--- a/engines/ultima/ultima8/usecode/uc_machine.cpp
+++ b/engines/ultima/ultima8/usecode/uc_machine.cpp
@@ -354,7 +354,7 @@ void UCMachine::execProcess(UCProcess *p) {
 			//! TODO
 			uint16 arg_bytes = cs.read1();
 			uint16 func = cs.read2();
-			debug(("calli\t\t%04Xh (%02Xh arg bytes) %s \n", func, arg_bytes, _convUse->intrinsics()[func]));
+			debug("calli\t\t%04Xh (%02Xh arg bytes) %s \n", func, arg_bytes, _convUse->intrinsics()[func]);
 
 			// !constants
 			if (func >= _intrinsicCount || _intrinsics[func] == 0) {




More information about the Scummvm-git-logs mailing list