[Scummvm-cvs-logs] CVS: scummvm/saga actionmap.cpp,1.28,1.29 actor.cpp,1.34,1.35 actor.h,1.13,1.14 animation.cpp,1.25,1.26 animation.h,1.11,1.12 console.cpp,1.18,1.19 console.h,1.5,1.6 events.cpp,1.31,1.32 game.cpp,1.27,1.28 ihnm_introproc.cpp,1.29,1.30 input.cpp,1.22,1.23 interface.cpp,1.36,1.37 ite_introproc.cpp,1.29,1.30 module.mk,1.18,1.19 objectmap.cpp,1.26,1.27 render.cpp,1.39,1.40 render.h,1.16,1.17 saga.cpp,1.70,1.71 scene.cpp,1.54,1.55 scene.h,1.20,1.21 script.cpp,1.30,1.31 script.h,1.27,1.28 sfuncs.cpp,1.43,1.44 sthread.cpp,1.38,1.39 cvar.cpp,1.13,NONE cvar.h,1.7,NONE cvar_mod.h,1.7,NONE expr.cpp,1.8,NONE expr.h,1.3,NONE

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Fri Dec 3 11:16:03 CET 2004


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

Modified Files:
	actionmap.cpp actor.cpp actor.h animation.cpp animation.h 
	console.cpp console.h events.cpp game.cpp ihnm_introproc.cpp 
	input.cpp interface.cpp ite_introproc.cpp module.mk 
	objectmap.cpp render.cpp render.h saga.cpp scene.cpp scene.h 
	script.cpp script.h sfuncs.cpp sthread.cpp 
Removed Files:
	cvar.cpp cvar.h cvar_mod.h expr.cpp expr.h 
Log Message:
First pass at migrating from the old Reinherit console to the ScummVM
console.

Some things are likely to have broken. For instance, I believe the old
console was could be visible during gameplay, while ScummVM's is modal. So
any place where we output something to the console during gameplay should
probably be removed.

Some things I've stubbed out. Basically any code that registers a variable.

Most of the debugging commands are untested.

Syntax may have changed because of different command-line parsing. (I never
actually used the old console, so I don't know for sure. :-)

Actually, I'm not that interested in reproducing the old console commands
faithfully. What we should do now is to make the immediately useful console
stuff work. Anything that remains unimplemented should probably be removed.


Index: actionmap.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actionmap.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- actionmap.cpp	30 Oct 2004 22:34:08 -0000	1.28
+++ actionmap.cpp	3 Dec 2004 19:15:43 -0000	1.29
@@ -24,7 +24,6 @@
 /* Action map module */
 #include "saga/saga.h"
 
-#include "saga/cvar_mod.h"
 #include "saga/gfx.h"
 #include "saga/console.h"
 
@@ -182,10 +181,10 @@
 }
 
 void ActionMap::info(void) {
-	_vm->_console->print("%d exits loaded.\n", _nExits);
+	_vm->_console->DebugPrintf("%d exits loaded.\n\n", _nExits);
 
 	for (int i = 0; i < _nExits; i++) {
-		_vm->_console->print ("Action %d: Exit to: %d", i, _exitsTbl[i].exitScene);
+		_vm->_console->DebugPrintf("Action %d: Exit to: %d\n", i, _exitsTbl[i].exitScene);
 	}
 }
 

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- actor.cpp	15 Nov 2004 03:03:46 -0000	1.34
+++ actor.cpp	3 Dec 2004 19:15:44 -0000	1.35
@@ -26,7 +26,6 @@
 #include "saga/gfx.h"
 
 #include "saga/game_mod.h"
-#include "saga/cvar_mod.h"
 #include "saga/console.h"
 #include "saga/rscfile_mod.h"
 #include "saga/script.h"
@@ -44,12 +43,6 @@
 namespace Saga {
 
 static int zCompare(const void *elem1, const void *elem2);
-static void CF_actor_add(int argc, char *argv[], void *refCon);
-static void CF_actor_del(int argc, char *argv[], void *refCon);
-static void CF_actor_move(int argc, char *argv[], void *refCon);
-static void CF_actor_moverel(int argc, char *argv[], void *refCon);
-static void CF_actor_seto(int argc, char *argv[], void *refCon);
-static void CF_actor_setact(int argc, char *argv[], void *refCon);
 
 ACTIONTIMES ActionTDeltas[] = {
 	{ ACTION_IDLE, 80 },
@@ -57,17 +50,6 @@
 	{ ACTION_SPEAK, 200 }
 };
 
-int Actor::reg() {
-	CVAR_RegisterFunc(CF_actor_add, "actor_add", "<Actor id> <lx> <ly>", CVAR_NONE, 3, 3, this);
-	CVAR_RegisterFunc(CF_actor_del, "actor_del", "<Actor id>", CVAR_NONE, 1, 1, this);
-	CVAR_RegisterFunc(CF_actor_move, "actor_move", "<Actor id> <lx> <ly>", CVAR_NONE, 3, 3, this);
-	CVAR_RegisterFunc(CF_actor_moverel, "actor_moverel", "<Actor id> <lx> <ly>", CVAR_NONE, 3, 3, this);
-	CVAR_RegisterFunc(CF_actor_seto, "actor_seto", "<Actor id> <Orientation>", CVAR_NONE, 2, 2, this);
-	CVAR_RegisterFunc(CF_actor_setact, "actor_setact", "<Actor id> <Action #>", CVAR_NONE, 2, 2, this);
-
-	return SUCCESS;
-}
-
 Actor::Actor(SagaEngine *vm) : _vm(vm), _initialized(false) {
 	int i;
 
@@ -1028,116 +1010,86 @@
 	return SUCCESS;
 }
 
-static void CF_actor_add(int argc, char *argv[], void *refCon) {
+void Actor::CF_actor_add(int argc, const char **argv) {
 	ACTOR actor;
 
-	if (argc < 3)
-		return;
-
-	actor.id = (uint16) atoi(argv[0]);
-
-	actor.a_pt.x = atoi(argv[1]);
-	actor.a_pt.y = atoi(argv[2]);
+	actor.id = (uint16) atoi(argv[1]);
 
-	((Actor *)refCon)->addActor(&actor);
+	actor.a_pt.x = atoi(argv[2]);
+	actor.a_pt.y = atoi(argv[3]);
 
-	return;
+	addActor(&actor);
 }
 
-static void CF_actor_del(int argc, char *argv[], void *refCon) {
+void Actor::CF_actor_del(int argc, const char **argv) {
 	int id;
  
-	if (argc < 0)
-		return;
-
-	id = atoi(argv[0]);
-
-	((Actor *)refCon)->deleteActor(id);
+	id = atoi(argv[1]);
 
-	return;
+	deleteActor(id);
 }
 
-static void CF_actor_move(int argc, char *argv[], void *refCon) {
+void Actor::CF_actor_move(int argc, const char **argv) {
 	int id;
 	Point move_pt;
 
-	if (argc < 2)
-		return;
-
-	id = atoi(argv[0]);
-
-	move_pt.x = atoi(argv[1]);
-	move_pt.y = atoi(argv[2]);
+	id = atoi(argv[1]);
 
-	((Actor *)refCon)->move(id, &move_pt);
+	move_pt.x = atoi(argv[2]);
+	move_pt.y = atoi(argv[3]);
 
-	return;
+	move(id, &move_pt);
 }
 
-static void CF_actor_moverel(int argc, char *argv[], void *refCon) {
+void Actor::CF_actor_moverel(int argc, const char **argv) {
 	int id;
 	Point move_pt;
 
-	if (argc < 3)
-		return;
-
-	id = atoi(argv[0]);
-
-	move_pt.x = atoi(argv[1]);
-	move_pt.y = atoi(argv[2]);
+	id = atoi(argv[1]);
 
-	((Actor *)refCon)->moveRelative(id, &move_pt);
+	move_pt.x = atoi(argv[2]);
+	move_pt.y = atoi(argv[3]);
 
-	return;
+	moveRelative(id, &move_pt);
 }
 
-static void CF_actor_seto(int argc, char *argv[], void *refCon) {
+void Actor::CF_actor_seto(int argc, const char **argv) {
 	int id;
 	int orient;
 
-	if (argc < 2)
-		return;
-
-	id = atoi(argv[0]);
-	orient = atoi(argv[1]);
-
-	((Actor *)refCon)->setOrientation(id, orient);
+	id = atoi(argv[1]);
+	orient = atoi(argv[2]);
 
-	return;
+	setOrientation(id, orient);
 }
 
-static void CF_actor_setact(int argc, char *argv[], void *refCon) {
+void Actor::CF_actor_setact(int argc, const char **argv) {
 	int index = 0;
 	int action_n = 0;
 
 	ACTOR *actor;
 
-	if (argc < 2)
-		return;
-
-	index = atoi(argv[0]);
-	action_n = atoi(argv[1]);
+	index = atoi(argv[1]);
+	action_n = atoi(argv[2]);
 
-	actor = ((Actor *)refCon)->lookupActor(index);
+	actor = lookupActor(index);
 	if (actor == NULL) {
-		_vm->_console->print("Invalid actor index.");
-
+		_vm->_console->DebugPrintf("Invalid actor index.\n");
 		return;
 	}
 
 	if ((action_n < 0) || (action_n >= actor->action_ct)) {
-		_vm->_console->print("Invalid action number.");
-
+		_vm->_console->DebugPrintf("Invalid action number.\n");
 		return;
 	}
 
-	_vm->_console->print("Action frame counts: %d %d %d %d.",
+	_vm->_console->DebugPrintf("Action frame counts: %d %d %d %d.\n",
 			actor->act_tbl[action_n].dir[0].frame_count,
 			actor->act_tbl[action_n].dir[1].frame_count,
 			actor->act_tbl[action_n].dir[2].frame_count,
 			actor->act_tbl[action_n].dir[3].frame_count);
 
-	((Actor *)refCon)->setAction(index, action_n, ACTION_LOOP);
+	setAction(index, action_n, ACTION_LOOP);
 }
 
 } // End of namespace Saga

Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- actor.h	31 Oct 2004 13:51:01 -0000	1.13
+++ actor.h	3 Dec 2004 19:15:44 -0000	1.14
@@ -186,10 +186,16 @@
 
 class Actor {
 public:
-	int reg();
 	Actor(SagaEngine *vm);
 	~Actor();
 
+	void CF_actor_add(int argc, const char **argv);
+	void CF_actor_del(int argc, const char **argv);
+	void CF_actor_move(int argc, const char **argv);
+	void CF_actor_moverel(int argc, const char **argv);
+	void CF_actor_seto(int argc, const char **argv);
+	void CF_actor_setact(int argc, const char **argv);
+
 	int direct(int msec);
 
 	int create(int actor_id, int x, int y);

Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/animation.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- animation.cpp	27 Oct 2004 21:32:27 -0000	1.25
+++ animation.cpp	3 Dec 2004 19:15:44 -0000	1.26
@@ -25,7 +25,6 @@
 #include "saga/saga.h"
 #include "saga/gfx.h"
 
-#include "saga/cvar_mod.h"
 #include "saga/console.h"
 #include "saga/game_mod.h"
 #include "saga/events.h"
@@ -35,13 +34,6 @@
 
 namespace Saga {
 
-static void CF_anim_info(int argc, char *argv[], void *refCon);
-
-int Anim::reg() {
-	CVAR_RegisterFunc(CF_anim_info, "anim_info", NULL, CVAR_NONE, 0, 0, this);
-	return SUCCESS;
-}
-
 Anim::Anim(SagaEngine *vm) : _vm(vm) {
 	int i;
 
@@ -915,29 +907,22 @@
 	return SUCCESS;
 }
 
-void Anim::animInfo(int argc, char *argv[]) {
+void Anim::animInfo() {
 	uint16 anim_ct;
 	uint16 i;
 	uint16 idx;
 
-	(void)(argc);
-	(void)(argv);
-
 	anim_ct = _anim_count;
 
-	_vm->_console->print("There are %d animations loaded:", anim_ct);
+	_vm->_console->DebugPrintf("There are %d animations loaded:\n", anim_ct);
 
 	for (idx = 0, i = 0; i < anim_ct; idx++, i++) {
 		while (_anim_tbl[idx] == NULL) {
 			idx++;
 		}
 
-		_vm->_console->print("%02d: Frames: %u Flags: %u", i, _anim_tbl[idx]->n_frames, _anim_tbl[idx]->flags);
+		_vm->_console->DebugPrintf("%02d: Frames: %u Flags: %u\n", i, _anim_tbl[idx]->n_frames, _anim_tbl[idx]->flags);
 	}
 }
 
-static void CF_anim_info(int argc, char *argv[], void *refCon) {
-	((Anim *)refCon)->animInfo(argc, argv);
-}
-
 } // End of namespace Saga

Index: animation.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/animation.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- animation.h	27 Oct 2004 21:32:27 -0000	1.11
+++ animation.h	3 Dec 2004 19:15:44 -0000	1.12
@@ -94,9 +94,9 @@
 
 class Anim {
 public:
-	int reg(void);
 	Anim(SagaEngine *vm);
 	~Anim(void);
+
 	int load(const byte *anim_resdata, size_t anim_resdata_len, uint16 *anim_id_p);
 	int freeId(uint16 anim_id);
 	int play(uint16 anim_id, int vector_time);
@@ -105,7 +105,7 @@
 	int clearFlag(uint16 anim_id, uint16 flag);
 	int setFrameTime(uint16 anim_id, int time);
 	int reset(void);
-	void animInfo(int argc, char *argv[]);
+	void animInfo(void);
 
 private:
 	int getNumFrames(const byte *anim_resource, size_t anim_resource_len, uint16 *n_frames);

Index: console.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/console.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- console.cpp	30 Oct 2004 22:34:08 -0000	1.18
+++ console.cpp	3 Dec 2004 19:15:44 -0000	1.19
@@ -24,442 +24,211 @@
 // Console module
 
 #include "saga/saga.h"
-#include "saga/gfx.h"
-#include "saga/font.h"
-#include "saga/cvar_mod.h"
-#include "saga/events.h"
+#include "saga/actor.h"
+#include "saga/animation.h"
+#include "saga/scene.h"
+#include "saga/script.h"
 
 #include "saga/console.h"
 
-namespace Saga {
+#include "common/debugger.cpp"
 
-int Console::reg() {
-	CVAR_Register_I(&_resize, "con_h", NULL, CVAR_NONE, 12, CON_DEFAULTPOS);
-	CVAR_Register_I(&_droptime, "con_droptime", NULL, CVAR_NONE, 0, 5000);
-	CVAR_Register_I(&_lineMax, "con_lines", NULL, CVAR_NONE, 5, 5000);
-	return SUCCESS;
-}
+namespace Saga {
 
-Console::Console(SagaEngine *vm) : _vm(vm) {
-	memset(&_scrollback, 0, sizeof(_scrollback));
-	memset(&_history, 0, sizeof(_history));
+Console::Console(SagaEngine *vm) : Common::Debugger<Console>() {
+	_vm = vm;
 
-	_resize = CON_DEFAULTPOS;
-	_droptime = CON_DROPTIME;
+	DCmd_Register("continue", &Console::Cmd_Exit);
+	DCmd_Register("exit", &Console::Cmd_Exit);
+	DCmd_Register("quit", &Console::Cmd_Exit);
+	DCmd_Register("help", &Console::Cmd_Help);
 
-	_active = false;
-	_yMax = CON_DEFAULTPOS;
-	_lineMax = CON_DEFAULTLINES;
-	_histMax = CON_DEFAULTCMDS;
-	_histPos = 0;
-	_linePos = 0;
-	_yPos = 0;
-	_prompt = NULL;
-	_promptW = 0;
-	*_inputBuf = 0;
-	_inputPos = 0;
-}
+	// CVAR_Register_I(&_soundEnabled, "sound", NULL, CVAR_CFG, 0, 1);
+	// CVAR_Register_I(&_musicEnabled, "music", NULL, CVAR_CFG, 0, 1);
 
-Console::~Console() {
-	debug(0, "~Console(): Deleting console scrollback and command history.");
+	// Actor commands
+	DCmd_Register("actor_add", &Console::Cmd_ActorAdd);
+	DCmd_Register("actor_del", &Console::Cmd_ActorDel);
+	DCmd_Register("actor_move", &Console::Cmd_ActorMove);
+	DCmd_Register("actor_moverel", &Console::Cmd_ActorMoveRel);
+	DCmd_Register("actor_seto", &Console::Cmd_ActorSetO);
+	DCmd_Register("actor_setact", &Console::Cmd_ActorSetAct);
 
-	deleteScroll(&_scrollback);
-	deleteScroll(&_history);
-}
+	// Animation commands
+	DCmd_Register("anim_info", &Console::Cmd_AnimInfo);
 
-int Console::activate() {
-	EVENT con_event;
+	// Game stuff
 
-	if (_active) {
-		return FAILURE;
-	}
+#if 0
+	// Register "g_language" cfg cvar
+	strncpy(GameModule.game_language, "us", MAXPATH);
 
-	con_event.type = CONTINUOUS_EVENT;
-	con_event.code = CONSOLE_EVENT | NODESTROY;
-	con_event.op = EVENT_ACTIVATE;
-	con_event.time = 0;
-	con_event.duration = _droptime;
+	CVAR_Register_S(GameModule.game_language, "g_language", NULL, CVAR_CFG, GAME_LANGSTR_LIMIT);
 
-	_vm->_events->queue(&con_event);
+	// Register "g_skipintro" cfg cvar
+	CVAR_Register_I(&GameModule.g_skipintro, "g_skipintro", NULL, CVAR_CFG, 0, 1);
+#endif
 
-	_active = true;
+	// Scene commands
+	DCmd_Register("scene_change", &Console::Cmd_SceneChange);
+	DCmd_Register("scene_info", &Console::Cmd_SceneInfo);
+	DCmd_Register("action_info", &Console::Cmd_ActionInfo);
+	DCmd_Register("object_info", &Console::Cmd_ObjectInfo);
+	// CVAR_Register_I(&_sceneNumber, "scene", NULL, CVAR_READONLY, 0, 0);
 
-	return SUCCESS;
+	// Script commands
+	DCmd_Register("script_info", &Console::Cmd_ScriptInfo);
+	DCmd_Register("script_exec", &Console::Cmd_ScriptExec);
+	DCmd_Register("script_togglestep", &Console::Cmd_ScriptToggleStep);
+//	CVAR_RegisterFunc(CF_script_info, "script_info", NULL, CVAR_NONE, 0, 0, this);
+//	CVAR_RegisterFunc(CF_script_exec, "script_exec", "<Script number>", CVAR_NONE, 1, 1, this);
+//	CVAR_RegisterFunc(CF_script_togglestep, "script_togglestep", NULL, CVAR_NONE, 0, 0, this);
 }
 
-int Console::deactivate() {
-	EVENT con_event;
-
-	if (!_active) {
-		return FAILURE;
-	}
-
-	con_event.type = CONTINUOUS_EVENT;
-	con_event.code = CONSOLE_EVENT | NODESTROY;
-	con_event.op = EVENT_DEACTIVATE;
-	con_event.time = 0;
-	con_event.duration = _droptime;
+Console::~Console() {
+}
 
-	_vm->_events->queue(&con_event);
+void Console::preEnter() {
+}
 
-	return SUCCESS;
+void Console::postEnter() {
 }
 
-bool Console::isActive(void) {
-	return _active;
+bool Console::Cmd_Exit(int argc, const char **argv) {
+	_detach_now = true;
+	return false;
 }
 
-// Responsible for processing character input to the console and maintaining
-// the console input buffer.
-// Input buffer is processed by EXPR_Parse on enter.
-// High ASCII characters are ignored.
-int Console::type(int in_char) {
-	int input_pos = _inputPos;
-	const char *expr;
-	int expr_len;
-	int result;
-	//char *lvalue;
+bool Console::Cmd_Help(int argc, const char **argv) {
+	// console normally has 39 line width
+	// wrap around nicely
+	int width = 0, size, i;
 
-	char *rvalue = NULL;
-	CVAR_P con_cvar = NULL;
+	DebugPrintf("Commands are:\n");
+	for (i = 0 ; i < _dcmd_count ; i++) {
+		size = strlen(_dcmds[i].name) + 1;
 
-	const char *expr_err;
-	const char *err_str;
+		if ((width + size) >= 39) {
+			DebugPrintf("\n");
+			width = size;
+		} else
+			width += size;
 
-	if (_yPos != _yMax) {
-		// Ignore keypress until console fully down
-		return SUCCESS;
+		DebugPrintf("%s ", _dcmds[i].name);
 	}
 
-	if ((in_char > 127) || (!in_char)) {
-		// Ignore non-ascii codes
-		return SUCCESS;
-	}
+	width = 0;
 
-	switch (in_char) {
-	case '\r':
-		expr = _inputBuf;
-		_vm->_console->print("> %s", _inputBuf);
-		expr_len = strlen(_inputBuf);
-		result = EXPR_Parse(&expr, &expr_len, &con_cvar, &rvalue);
-		_vm->_console->addLine(&_history, _histMax, _inputBuf);
-		memset(_inputBuf, 0, CON_INPUTBUF_LEN);
-		_inputPos = 0;
-		_histPos = 0;
-		if (result != SUCCESS) {
-			EXPR_GetError(&expr_err);
-			_vm->_console->print("Parse error: %s", expr_err);
-			break;
-		}
+	DebugPrintf("\n\nVariables are:\n");
+	for (i = 0 ; i < _dvar_count ; i++) {
+		size = strlen(_dvars[i].name) + 1;
 
-		if (rvalue == NULL) {
-			CVAR_Print(con_cvar);
-			break;
-		}
+		if ((width + size) >= 39) {
+			DebugPrintf("\n");
+			width = size;
+		} else
+			width += size;
 
-		if (CVAR_IsFunc(con_cvar)) {
-			CVAR_Exec(con_cvar, rvalue);
-		} else if (CVAR_SetValue(con_cvar, rvalue) != SUCCESS) {
-			CVAR_GetError(&err_str);
-			_vm->_console->print("Illegal assignment: %s.", err_str);
-		}
-		break;
-	case '\b':
-		_inputBuf[input_pos] = 0;
-		if (input_pos > 0) {
-			_inputPos--;
-			_inputBuf[_inputPos] = 0;
-		}
-		break;
-	default:
-		if (input_pos < CON_INPUTBUF_LEN) {
-			_inputBuf[input_pos] = (char)in_char;
-			_inputPos++;
-		}
-		break;
+		DebugPrintf("%s ", _dvars[i].name);
 	}
 
-	if (rvalue)
-		free(rvalue);
+	DebugPrintf("\n");
 
-	return SUCCESS;
+	return true;
 }
 
-int Console::draw(SURFACE *ds) {
-	int line_y;
-	CONSOLE_LINE *walk_ptr;
-	CONSOLE_LINE *start_ptr;
-	int txt_fgcolor;
-	int txt_shcolor;
-	Rect fill_rect;
-	int i;
-
-	if (!_active) {
-		return FAILURE;
-	}
-
-	if (_resize != _yMax) {
-		_yMax = _resize;
-		_yPos = _resize;
-	}
-
-	fill_rect.top = 0;
-	fill_rect.left = 0;
-	fill_rect.bottom = _yPos + 1;
-	fill_rect.right = ds->w;
-
-	drawRect(ds, &fill_rect, _vm->_gfx->matchColor(CONSOLE_BGCOLOR));
-	txt_fgcolor = _vm->_gfx->matchColor(CONSOLE_TXTCOLOR);
-	txt_shcolor = _vm->_gfx->matchColor(CONSOLE_TXTSHADOW);
-
-	_vm->_font->draw(SMALL_FONT_ID, ds, ">", 1, 2, _yPos - 10, txt_fgcolor, txt_shcolor, FONT_SHADOW);
-	_vm->_font->draw(SMALL_FONT_ID, ds, _inputBuf, strlen(_inputBuf),
-				10, _yPos - 10, txt_fgcolor, txt_shcolor, FONT_SHADOW);
-
-	line_y = _yPos - (CON_INPUT_H + CON_LINE_H);
-	start_ptr = _scrollback.head;
-
-	for (i = 0; i < _linePos; i++) {
-		if (start_ptr->next) {
-			start_ptr = start_ptr->next;
-		} else {
-			break;
-		}
-	}
-
-	for (walk_ptr = start_ptr; walk_ptr; walk_ptr = walk_ptr->next) {
-		_vm->_font->draw(SMALL_FONT_ID, ds, walk_ptr->str_p, walk_ptr->str_len, 2, line_y, txt_fgcolor, txt_shcolor, FONT_SHADOW);
-		line_y -= CON_LINE_H;
-		if (line_y < -CON_LINE_H)
-			break;
-	}
-
-	return SUCCESS;
+bool Console::Cmd_ActorAdd(int argc, const char **argv) {
+	if (argc != 4)
+		DebugPrintf("Usage: %s <Actor id> <lx> <ly>\n", argv[0]);
+	else
+		_vm->_actor->CF_actor_add(argc, argv);
+	return true;
 }
 
-int Console::print(const char *fmt_str, ...) {
-	char vsstr_p[CON_PRINTFLIMIT + 1];
-	va_list argptr;
-	int ret_val;
-
-	va_start(argptr, fmt_str);
-	ret_val = vsprintf(vsstr_p, fmt_str, argptr);
-	_vm->_console->addLine(&_scrollback, _lineMax, vsstr_p);
-	debug(0, vsstr_p);
-	va_end(argptr);
-	_linePos = 0;
-
-	return ret_val;
+bool Console::Cmd_ActorDel(int argc, const char **argv) {
+	if (argc != 2)
+		DebugPrintf("Usage: %s <Actor id>\n", argv[0]);
+	else
+		_vm->_actor->CF_actor_del(argc, argv);
+	return true;
 }
 
-int Console::cmdUp() {
-	CONSOLE_LINE *start_ptr = _history.head;
-	int i;
-
-	if (!start_ptr) {
-		return SUCCESS;
-	}
-
-	if (_histPos < _history.lines) {
-		_histPos++;
-	}
-
-	for (i = 1; (i < _histPos); i++) {
-		if (start_ptr->next) {
-			start_ptr = start_ptr->next;
-		} else {
-			break;
-		}
-	}
-
-	memset(_inputBuf, 0, CON_INPUTBUF_LEN);
-	strcpy(_inputBuf, start_ptr->str_p);
-	_inputPos = start_ptr->str_len - 1;
-
-	debug(0, "History pos: %d/%d", _histPos, _history.lines);
-
-	return SUCCESS;
+bool Console::Cmd_ActorMove(int argc, const char **argv) {
+	if (argc != 4)
+		DebugPrintf("Usage: %s <Actor id> <lx> <ly>\n", argv[0]);
+	else
+		_vm->_actor->CF_actor_move(argc, argv);
+	return true;
 }
 
-int Console::cmdDown(void) {
-	CONSOLE_LINE *start_ptr = _history.head;
-	int i;
-
-	if (_histPos == 1) {
-		debug(0, "Erased input buffer.");
-		memset(_inputBuf, 0, CON_INPUTBUF_LEN);
-		_inputPos = 0;
-		_histPos--;
-		return SUCCESS;
-	} else if (_histPos) {
-		_histPos--;
-	} else {
-		return SUCCESS;
-	}
-
-	for (i = 1; i < _histPos; i++) {
-		if (start_ptr->next) {
-			start_ptr = start_ptr->next;
-		} else {
-			break;
-		}
-	}
-
-	memset(_inputBuf, 0, CON_INPUTBUF_LEN);
-	strcpy(_inputBuf, start_ptr->str_p);
-	_inputPos = start_ptr->str_len - 1;
-
-	debug(0, "History pos: %d/%d", _histPos, _history.lines);
-
-	return SUCCESS;
+bool Console::Cmd_ActorMoveRel(int argc, const char **argv) {
+	if (argc != 4)
+		DebugPrintf("Usage: %s <Actor id> <lx> <ly>\n", argv[0]);
+	else
+		_vm->_actor->CF_actor_moverel(argc, argv);
+	return true;
 }
 
-int Console::pageUp() {
-	int n_lines;
-	n_lines = (_yMax - CON_INPUT_H) / CON_LINE_H;
-
-	if (_linePos < (_scrollback.lines - n_lines)) {
-		_linePos += n_lines;
-	}
-
-	debug(0, "Line pos: %d", _linePos);
-	return SUCCESS;
+bool Console::Cmd_ActorSetO(int argc, const char **argv) {
+	if (argc != 3)
+		DebugPrintf("Usage: %s <Actor id> <Orientation>\n", argv[0]);
+	else
+		_vm->_actor->CF_actor_seto(argc, argv);
+	return true;
 }
 
-int Console::pageDown() {
-	int n_lines;
-	n_lines = (_yMax - CON_INPUT_H) / CON_LINE_H;
-
-	if (_linePos > n_lines) {
-		_linePos -= n_lines;
-	} else {
-		_linePos = 0;
-	}
-
-	return SUCCESS;
+bool Console::Cmd_ActorSetAct(int argc, const char **argv) {
+	if (argc != 3)
+		DebugPrintf("Usage: %s <Actor id> <Action #>\n", argv[0]);
+	else
+		_vm->_actor->CF_actor_setact(argc, argv);
+	return true;
 }
 
-int Console::dropConsole(double percent) {
-	SURFACE *back_buf;
-
-	if (percent > 1.0) {
-		percent = 1.0;
-	}
-
-	back_buf = _vm->_gfx->getBackBuffer();
-	_vm->_console->setDropPos(percent);
-	_vm->_console->draw(back_buf);
-
-	return SUCCESS;
+bool Console::Cmd_AnimInfo(int argc, const char **argv) {
+	_vm->_anim->animInfo();
+	return true;
 }
 
-int Console::raiseConsole(double percent) {
-	SURFACE *back_buf;
-
-	if (percent >= 1.0) {
-		percent = 1.0;
-		_active = false;
-	}
-
-	back_buf = _vm->_gfx->getBackBuffer();
-	_vm->_console->setDropPos(1.0 - percent);
-	_vm->_console->draw(back_buf);
-
-	return SUCCESS;
+bool Console::Cmd_SceneChange(int argc, const char **argv) {
+	if (argc != 2)
+		DebugPrintf("Usage: %s <Scene number>\n", argv[0]);
+	else
+		_vm->_scene->sceneChangeCmd(argc, argv);
+	return true;
 }
 
-int Console::setDropPos(double percent) {
-	double exp_percent;
-
-	if (percent > 1.0)
-		percent = 1.0;
-	if (percent < 0.0)
-		percent = 0.0;
-
-	exp_percent = percent * percent;
-	_yPos = (int)(_yMax * exp_percent);
-
-	return SUCCESS;
+bool Console::Cmd_SceneInfo(int argc, const char **argv) {
+	_vm->_scene->sceneInfoCmd();
+	return true;
 }
 
-int Console::addLine(CON_SCROLLBACK *scroll, int line_max, const char *constr_p) {
-	int constr_len;
-	char *newstr_p;
-	CONSOLE_LINE *newline_p;
-	int del_lines;
-	int i;
-
-	constr_len = strlen(constr_p) + 1;
-	newstr_p = (char *)malloc(constr_len);
-	if (newstr_p == NULL) {
-		return MEM;
-	}
-
-	newline_p = (CONSOLE_LINE *)malloc(sizeof(CONSOLE_LINE));
-	if (newline_p == NULL) {
-		return MEM;
-	}
-	newline_p->next = NULL;
-	newline_p->prev = NULL;
-
-	strcpy(newstr_p, constr_p);
-	newline_p->str_p = newstr_p;
-	newline_p->str_len = constr_len;
-
-	if (scroll->head == NULL) {
-		scroll->head = newline_p;
-		scroll->tail = newline_p;
-	} else {
-		scroll->head->prev = newline_p;
-		newline_p->next = scroll->head;
-		scroll->head = newline_p;
-	}
-
-	scroll->lines++;
-
-	if (scroll->lines > line_max) {
-		del_lines = scroll->lines - line_max;
-
-		for (i = 0; i < del_lines; i++) {
-			_vm->_console->deleteLine(scroll);
-		}
-	}
-
-	return SUCCESS;
+bool Console::Cmd_ActionInfo(int argc, const char **argv) {
+	_vm->_scene->CF_actioninfo();
+	return true;
 }
 
-int Console::deleteLine(CON_SCROLLBACK *scroll) {
-	CONSOLE_LINE *temp_p = scroll->tail;
-
-	if (temp_p->prev == NULL) {
-		scroll->head = NULL;
-		scroll->tail = NULL;
-	} else {
-		temp_p->prev->next = NULL;
-		scroll->tail = temp_p->prev;
-	}
-
-	if (temp_p->str_p)
-		free(temp_p->str_p);
-	free(temp_p);
-	scroll->lines--;
-
-	return SUCCESS;
+bool Console::Cmd_ObjectInfo(int argc, const char **argv) {
+	_vm->_scene->CF_objectinfo();
+	return true;
 }
 
-int Console::deleteScroll(CON_SCROLLBACK * scroll) {
-	CONSOLE_LINE *walk_ptr;
-	CONSOLE_LINE *temp_ptr;
-
-	for (walk_ptr = scroll->head; walk_ptr; walk_ptr = temp_ptr) {
+bool Console::Cmd_ScriptInfo(int argc, const char **argv) {
+	_vm->_script->scriptInfo();
+	return true;
+}
 
-		if (walk_ptr->str_p)
-			free(walk_ptr->str_p);
-		temp_ptr = walk_ptr->next;
-		free(walk_ptr);
-	}
+bool Console::Cmd_ScriptExec(int argc, const char **argv) {
+	if (argc != 2)
+		DebugPrintf("Usage: %s <Script number>\n", argv[0]);
+	else
+		_vm->_script->scriptExec(argc, argv);
+	return true;
+}
 
-	return SUCCESS;
+bool Console::Cmd_ScriptToggleStep(int argc, const char **argv) {
+	_vm->_script->CF_script_togglestep();
+	return true;
 }
 
 } // End of namespace Saga

Index: console.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/console.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- console.h	27 Oct 2004 21:32:27 -0000	1.5
+++ console.h	3 Dec 2004 19:15:44 -0000	1.6
@@ -26,83 +26,43 @@
 #ifndef SAGA_CONSOLE_H_
 #define SAGA_CONSOLE_H_
 
-namespace Saga {
-
-#define CON_INPUTBUF_LEN 80
-
-#define CONSOLE_BGCOLOR   0x00A0A0A0UL
-#define CONSOLE_TXTCOLOR  0x00FFFFFFUL
-#define CONSOLE_TXTSHADOW 0x00202020UL
-
-struct CONSOLE_LINE {
-	CONSOLE_LINE *next;
-	CONSOLE_LINE *prev;
-	char *str_p;
-	int str_len;
-};
-
-struct CON_SCROLLBACK {
-	CONSOLE_LINE *head;
-	CONSOLE_LINE *tail;
-	int lines;
-};
+#include "common/debugger.h"
 
-#define CON_DEFAULTPOS 136
-#define CON_DEFAULTLINES 100
-#define CON_DEFAULTCMDS 10
-#define CON_DROPTIME 400
-#define CON_PRINTFLIMIT 1024
-#define CON_LINE_H 10
-#define CON_INPUT_H 10
+namespace Saga {
 
-class Console {
- public:
-	int reg(void);
+class Console : public Common::Debugger<Console> {
+public:
 	Console(SagaEngine *vm);
 	~Console(void);
 
-	int activate(void);
-	int deactivate(void);
-	bool isActive(void);
-
-	int type(int in_char);
-	int draw(SURFACE *ds);
-	int print(const char *fmt_str, ...);
-
-	int cmdUp(void);
-	int cmdDown(void);
-	int pageUp(void);
-	int pageDown(void);
+protected:
+	virtual void preEnter();
+	virtual void postEnter();
 
-	int dropConsole(double percent);
-	int raiseConsole(double percent);
+private:
+	bool Cmd_Exit(int argc, const char **argv);
+	bool Cmd_Help(int argc, const char **argv);
 
- private:
-	int addLine(CON_SCROLLBACK *scroll, int line_max, const char *constr_p);
-	int deleteLine(CON_SCROLLBACK *scroll);
-	int deleteScroll(CON_SCROLLBACK *scroll);
-	int setDropPos(double percent);
+	bool Cmd_ActorAdd(int argc, const char **argv);
+	bool Cmd_ActorDel(int argc, const char **argv);
+	bool Cmd_ActorMove(int argc, const char **argv);
+	bool Cmd_ActorMoveRel(int argc, const char **argv);
+	bool Cmd_ActorSetO(int argc, const char **argv);
+	bool Cmd_ActorSetAct(int argc, const char **argv);
 
- private:
-	SagaEngine *_vm;
+	bool Cmd_AnimInfo(int argc, const char **argv);
 
-	CON_SCROLLBACK _scrollback;
-	CON_SCROLLBACK _history;
+	bool Cmd_SceneChange(int argc, const char **argv);
+	bool Cmd_SceneInfo(int argc, const char **argv);
+	bool Cmd_ActionInfo(int argc, const char **argv);
+	bool Cmd_ObjectInfo(int argc, const char **argv);
 
-	int _resize;
-	int _droptime;
+	bool Cmd_ScriptInfo(int argc, const char **argv);
+	bool Cmd_ScriptExec(int argc, const char **argv);
+	bool Cmd_ScriptToggleStep(int argc, const char **argv);
 
-	bool _active;
-	int _yMax;
-	int _lineMax;
-	int _histMax;
-	int _histPos;
-	int _linePos;
-	int _yPos;
-	char *_prompt;
-	int _promptW;
-	char _inputBuf[CON_INPUTBUF_LEN + 1];
-	int _inputPos;
+private:
+	SagaEngine *_vm;
 };
 
 } // End of namespace Saga

Index: events.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/events.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- events.cpp	26 Nov 2004 13:27:59 -0000	1.31
+++ events.cpp	3 Dec 2004 19:15:44 -0000	1.32
@@ -198,18 +198,6 @@
 			break;
 		}
 		break;
-	case CONSOLE_EVENT:
-		switch (event->op) {
-		case EVENT_ACTIVATE:
-			_vm->_console->dropConsole(event_pc);
-			break;
-		case EVENT_DEACTIVATE:
-			_vm->_console->raiseConsole(event_pc);
-			break;
-		default:
-			break;
-		}
-		break;
 	default:
 		break;
 
@@ -398,7 +386,7 @@
 
 		sthread = _vm->_script->SThreadCreate();
 		if (sthread == NULL) {
-			_vm->_console->print("Thread creation failed.");
+			_vm->_console->DebugPrintf("Thread creation failed.\n");
 			break;
 		}
 

Index: game.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/game.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- game.cpp	25 Nov 2004 07:13:40 -0000	1.27
+++ game.cpp	3 Dec 2004 19:15:44 -0000	1.28
@@ -30,7 +30,6 @@
 #include "backends/fs/fs.h"
 
 #include "saga/rscfile_mod.h"
-#include "saga/cvar_mod.h"
 #include "saga/interface.h"
 #include "saga/scene.h"
 
@@ -296,25 +295,6 @@
 
 static GAMEMODULE GameModule;
 
-int GAME_Register() {
-	return SUCCESS;
-
-	// Register "g_language" cfg cvar
-	strncpy(GameModule.game_language, "us", MAXPATH);
-
-	if (CVAR_Register_S(GameModule.game_language, "g_language",
-						NULL, CVAR_CFG, GAME_LANGSTR_LIMIT) != SUCCESS) {
-		return FAILURE;
-	}
-
-	// Register "g_skipintro" cfg cvar
-	if (CVAR_Register_I(&GameModule.g_skipintro, "g_skipintro", NULL, CVAR_CFG, 0, 1) != SUCCESS) {
-		return FAILURE;
-	}
-
-	return SUCCESS;
-}
-
 int GAME_Init() {
 	uint16 game_n;
 

Index: ihnm_introproc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/ihnm_introproc.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- ihnm_introproc.cpp	28 Nov 2004 18:28:40 -0000	1.29
+++ ihnm_introproc.cpp	3 Dec 2004 19:15:44 -0000	1.30
@@ -28,7 +28,6 @@
 #include "saga/gfx.h"
 
 #include "saga/animation.h"
-#include "saga/cvar_mod.h"
 #include "saga/events.h"
 #include "saga/rscfile_mod.h"
 #include "saga/sndres.h"

Index: input.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/input.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- input.cpp	20 Nov 2004 23:49:10 -0000	1.22
+++ input.cpp	3 Dec 2004 19:15:44 -0000	1.23
@@ -38,76 +38,51 @@
 	Point imousePt;
 
 	while (g_system->pollEvent(event)) {
-		int in_char;
-
 		switch (event.event_code) {
 		case OSystem::EVENT_KEYDOWN:
-			if (_vm->_console->isActive()) {
-				in_char = event.kbd.ascii;
-				switch (event.kbd.keycode) {
-				case 96: // backquote
-					_vm->_console->deactivate();
-					break;
-				case 280: // page up
-					_vm->_console->pageUp();
-					break;
-				case 281: // page down
-					_vm->_console->pageDown();
-					break;
-				case 273: // up
-				case 264: // keypad up
-					_vm->_console->cmdUp();
-					break;
-				case 274: // down
-				case 258: // keypad down
-					_vm->_console->cmdDown();
-					break;
-				default:
-					if (in_char) {
-						_vm->_console->type(in_char);
-					}
-					break;
-				}
-				break;
+			if (event.kbd.flags == OSystem::KBD_CTRL) {
+				if (event.kbd.keycode == 'd')
+					_console->attach();
 			}
-
 			switch (event.kbd.keycode) {
-			case 96: // back quote
-				_vm->_console->activate();
+			case '#':
+			case '`':
+			case '~':
+				_console->attach();
 				break;
-			case 114: // r
-				_vm->_interface->draw();
+			case 'r':
+				_interface->draw();
 				break;
 			case 282: // F1
-				_vm->_render->toggleFlag(RF_SHOW_FPS);
+				_render->toggleFlag(RF_SHOW_FPS);
 				break;
 			case 283: // F2
-				_vm->_render->toggleFlag(RF_PALETTE_TEST);
+				_render->toggleFlag(RF_PALETTE_TEST);
 				break;
 			case 284: // F3
-				_vm->_render->toggleFlag(RF_TEXT_TEST);
+				_render->toggleFlag(RF_TEXT_TEST);
 				break;
 			case 285: // F4
-				_vm->_render->toggleFlag(RF_OBJECTMAP_TEST);
+				_render->toggleFlag(RF_OBJECTMAP_TEST);
 				break;
 			case 9: // Tab
-				_vm->_script->SThreadDebugStep();
+				_script->SThreadDebugStep();
 				break;
 
 			// Actual game keys
 			case 32: // space
-				_vm->_actor->skipDialogue();
+				_actor->skipDialogue();
 				break;
 			case 19:  // pause
-			case 112: // p
-				_vm->_render->toggleFlag(RF_RENDERPAUSE);
+			case 'p':
+				_render->toggleFlag(RF_RENDERPAUSE);
 				break;
 			case 27: // Esc
 				// Skip to next scene skip target
-				if (!_vm->_interface->getMode() == kPanelNone) // FIXME: hack
-					_vm->_script->SThreadAbortAll();
+				if (!_interface->getMode() == kPanelNone) // FIXME: hack
+					_script->SThreadAbortAll();
 				else
-					_vm->_scene->skipScene();
+					_scene->skipScene();
 				break;
 			default:
 				break;
@@ -117,7 +92,7 @@
 			_mousePos.x = event.mouse.x;
 			_mousePos.y = event.mouse.y;
 			imousePt = _mousePos;
-			_vm->_interface->update(imousePt, UPDATE_MOUSECLICK);
+			_interface->update(imousePt, UPDATE_MOUSECLICK);
 			break;
 		case OSystem::EVENT_MOUSEMOVE:
 			_mousePos.x = event.mouse.x;

Index: interface.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- interface.cpp	25 Nov 2004 07:18:35 -0000	1.36
+++ interface.cpp	3 Dec 2004 19:15:44 -0000	1.37
@@ -26,7 +26,6 @@
 
 #include "saga/gfx.h"
 #include "saga/game_mod.h"
-#include "saga/cvar_mod.h"
 #include "saga/actor.h"
 #include "saga/console.h"
 #include "saga/font.h"
@@ -144,6 +143,7 @@
 };
 
 int Interface::registerLang(void) {
+#if 0
 	size_t i;
 
 	for (i = 0; i < ARRAYSIZE(I_VerbData); i++) {
@@ -156,6 +156,7 @@
 
 		assert(CVAR_Find(I_VerbData[i].verb_cvar) != NULL);
 	}
+#endif
 
 	return SUCCESS;
 }

Index: ite_introproc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/ite_introproc.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- ite_introproc.cpp	27 Oct 2004 21:32:27 -0000	1.29
+++ ite_introproc.cpp	3 Dec 2004 19:15:44 -0000	1.30
@@ -29,7 +29,6 @@
 #include "saga/yslib.h"
 
 #include "saga/animation.h"
-#include "saga/cvar_mod.h"
 #include "saga/events.h"
 #include "saga/font.h"
 #include "saga/game_mod.h"
@@ -150,6 +149,7 @@
 }
 
 int Scene::ITEIntroRegisterLang() {
+#if 0
 	size_t i;
 
 	for (i = 0; i < ARRAYSIZE(IntroDiag); i++) {
@@ -160,6 +160,7 @@
 			return FAILURE;
 		}
 	}
+#endif
 
 	return SUCCESS;
 }

Index: module.mk
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/module.mk,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- module.mk	7 Nov 2004 14:15:41 -0000	1.18
+++ module.mk	3 Dec 2004 19:15:44 -0000	1.19
@@ -6,9 +6,7 @@
 	saga/actordata.o \
 	saga/animation.o \
 	saga/console.o \
-	saga/cvar.o \
 	saga/events.o \
-	saga/expr.o \
 	saga/font.o \
 	saga/font_map.o \
 	saga/game.o \

Index: objectmap.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/objectmap.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- objectmap.cpp	30 Oct 2004 22:34:08 -0000	1.26
+++ objectmap.cpp	3 Dec 2004 19:15:44 -0000	1.27
@@ -29,7 +29,6 @@
 #include "saga/saga.h"
 
 #include "saga/gfx.h"
-#include "saga/cvar_mod.h"
 #include "saga/console.h"
 #include "saga/font.h"
 #include "saga/objectmap.h"
@@ -345,11 +344,11 @@
 void ObjectMap::info(void) {
 	int i;
 
-	_vm->_console->print("%d objects loaded.", _nObjects);
+	_vm->_console->DebugPrintf("%d objects loaded.\n", _nObjects);
 
 	for (i = 0; i < _nObjects; i++) {
-		_vm->_console->print("%s:", _names[i]);
-		_vm->_console->print("%d. verb: %d, flags: %X, name_i: %d, scr_n: %d, ca_ct: %d", i, 
+		_vm->_console->DebugPrintf("%s:\n", _names[i]);
+		_vm->_console->DebugPrintf("%d. verb: %d, flags: %X, name_i: %d, scr_n: %d, ca_ct: %d\n", i, 
 					_objectMaps[i].defaultVerb,
 					_objectMaps[i].flags,
 					_objectMaps[i].objectNum,

Index: render.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/render.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- render.cpp	30 Oct 2004 22:34:08 -0000	1.39
+++ render.cpp	3 Dec 2004 19:15:44 -0000	1.40
@@ -26,8 +26,6 @@
 
 #include "saga/gfx.h"
 #include "saga/actor.h"
-#include "saga/console.h"
-#include "saga/cvar_mod.h"
 #include "saga/font.h"
 #include "saga/game_mod.h"
 #include "saga/interface.h"
@@ -44,10 +42,6 @@
 
 const char *test_txt = "The quick brown fox jumped over the lazy dog. She sells sea shells down by the sea shore.";
 
-int Render::reg(void) {
-	return SUCCESS;
-}
-
 Render::Render(SagaEngine *vm, OSystem *system) {
 	_vm = vm;
 	_system = system;
@@ -182,9 +176,6 @@
 		drawPalette(backbuf_surface);
 	}
 
-	// Draw console
-	_vm->_console->draw(backbuf_surface);
-
 	_system->copyRectToScreen((byte *)backbuf_surface->pixels, backbuf_surface->w, 0, 0, 
 							  backbuf_surface->w, backbuf_surface->h);
 

Index: render.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/render.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- render.h	27 Oct 2004 21:32:27 -0000	1.16
+++ render.h	3 Dec 2004 19:15:44 -0000	1.17
@@ -51,7 +51,6 @@
 
 class Render {
 public:
-	int reg(void);
 	Render(SagaEngine *vm, OSystem *system);
 	~Render(void);
 	bool initialized();

Index: saga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.cpp,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- saga.cpp	2 Dec 2004 00:33:39 -0000	1.70
+++ saga.cpp	3 Dec 2004 19:15:44 -0000	1.71
@@ -38,7 +38,6 @@
 #include "saga/actor.h"
 #include "saga/animation.h"
 #include "saga/console.h"
-#include "saga/cvar_mod.h"
 #include "saga/events.h"
 #include "saga/font.h"
 #include "saga/game_mod.h"
@@ -89,14 +88,13 @@
 
 #define MAX_TIME_DELTA 100
 
-static void CF_quitfunc(int argc, char *argv[], void *refCon);
-static void CF_testfunc(int argc, char *argv[], void *refCon);
-
 SagaEngine *_vm = NULL;
 
 SagaEngine::SagaEngine(GameDetector *detector, OSystem *syst)
 	: Engine(syst) {
 
+	_console = NULL;
+
 	// The Linux version of Inherit the Earth puts all data files in an
 	// 'itedata' sub-directory, except for voices.rsc
 	File::addDefaultDirectory(_gameDataPath + "itedata/");
@@ -129,16 +127,6 @@
 	_soundEnabled = 1;
 	_musicEnabled = 1;
 
-	_console = new Console(this);
-
-	CVAR_RegisterFunc(CF_testfunc, "testfunc", "foo [ optional foo ]", CVAR_NONE, 0, -1, this);
-
-	CVAR_Register_I(&_soundEnabled, "sound", NULL, CVAR_CFG, 0, 1);
-
-	CVAR_Register_I(&_musicEnabled, "music", NULL, CVAR_CFG, 0, 1);
-
-	CVAR_RegisterFunc(CF_quitfunc, "quit", NULL, CVAR_NONE, 0, 0, this);
-
 	// Add some default directories
 	// Win32 demo & full game
 	File::addDefaultDirectory("graphics");
@@ -186,6 +174,9 @@
 	GAME_GetDisplayInfo(&disp_info);
 	_gfx = new Gfx(_system, disp_info.logical_w, disp_info.logical_h, detector);
 
+	// Graphics driver should be initialized before console
+	_console = new Console(this);
+
 	// Graphics should be initialized before music
 	int midiDriver = MidiDriver::detectMusicDriver(MDT_NATIVE | MDT_ADLIB | MDT_PREFER_NATIVE);
 	bool native_mt32 = (ConfMan.getBool("native_mt32") || (midiDriver == MD_MT32));
@@ -221,15 +212,6 @@
 		debug(0, "Sound disabled.");
 	}
 
-	// Register engine modules
-	_console->reg(); // Register console cvars first
-	GAME_Register();
-	_scene->reg();
-	_actor->reg();
-	_script->reg();
-	_render->reg();
-	_anim->reg();
-
 	return 0;
 }
 
@@ -246,6 +228,9 @@
 	uint32 currentTicks;
 
 	for (;;) {
+		if (_console->isAttached())
+			_console->onFrame();
+
 		if (_render->getFlags() & RF_RENDERPAUSE) {
 			// Freeze time while paused
 			_previousTicks = _system->getMillis();
@@ -280,7 +265,6 @@
 	delete _sprite;
 	delete _font;
 	delete _console;
-	CVAR_Shutdown();
 	delete _events;
 	delete _palanim;
 
@@ -297,19 +281,4 @@
 	_system->quit();
 }
 
-static void CF_quitfunc(int argc, char *argv[], void *refCon) {
-	((SagaEngine *)refCon)->shutdown();
-	exit(0);
-}
-
-static void CF_testfunc(int argc, char *argv[], void *refCon) {
-	int i;
-
-	_vm->_console->print("Test function invoked: Got %d arguments.", argc);
-
-	for (i = 0; i < argc; i++) {
-		_vm->_console->print("Arg %d: %s", i, argv[i]);
-	}
-}
-
 } // End of namespace Saga

Index: scene.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- scene.cpp	3 Dec 2004 13:39:00 -0000	1.54
+++ scene.cpp	3 Dec 2004 19:15:44 -0000	1.55
@@ -29,7 +29,6 @@
 #include "saga/game_mod.h"
 #include "saga/animation.h"
 #include "saga/console.h"
-#include "saga/cvar_mod.h"
 #include "saga/interface.h"
 #include "saga/events.h"
 #include "saga/actionmap.h"
@@ -47,23 +46,6 @@
 
 namespace Saga {
 
-static void CF_scenechange(int argc, char *argv[], void *refCon);
-static void CF_sceneinfo(int argc, char *argv[], void *refCon);
-static void CF_actioninfo(int argc, char *argv[], void *refCon);
-static void CF_objectinfo(int argc, char *argv[], void *refCon);
-
-
-int Scene::reg() {
-	CVAR_Register_I(&_sceneNumber, "scene", NULL, CVAR_READONLY, 0, 0);
-	CVAR_RegisterFunc(CF_scenechange, "scene_change", "<Scene number>", CVAR_NONE, 1, 1, this);
-	CVAR_RegisterFunc(CF_sceneinfo, "scene_info", NULL, CVAR_NONE, 0, 0, this);
-	CVAR_RegisterFunc(CF_actioninfo,
-					  "action_info", NULL, CVAR_NONE, 0, 0, this);
-	CVAR_RegisterFunc(CF_objectinfo, "object_info", NULL, CVAR_NONE, 0, 0, this);
-
-	return SUCCESS;
-}
-
 Scene::Scene(SagaEngine *vm) : _vm(vm), _initialized(false) {
 	GAME_SCENEDESC gs_desc;
 	byte *scene_lut_p;
@@ -904,72 +886,53 @@
 	return SUCCESS;
 }
 
-void Scene::sceneChangeCmd(int argc, char *argv[]) {
+void Scene::sceneChangeCmd(int argc, const char **argv) {
 	int scene_num = 0;
 
-	if ((argc == 0) || (argc > 1)) {
-		return;
-	}
-
-	scene_num = atoi(argv[0]);
+	scene_num = atoi(argv[1]);
 
 	if ((scene_num < 1) || (scene_num > _sceneMax)) {
-		_vm->_console->print("Invalid scene number.");
+		_vm->_console->DebugPrintf("Invalid scene number.\n");
 		return;
 	}
 
 	clearSceneQueue();
 
 	if (changeScene(scene_num) == SUCCESS) {
-		_vm->_console->print("Scene changed.");
+		_vm->_console->DebugPrintf("Scene changed.\n");
 	} else {
-		_vm->_console->print("Couldn't change scene!");
+		_vm->_console->DebugPrintf("Couldn't change scene!\n");
 	}
 }
 
-static void CF_scenechange(int argc, char *argv[], void *refCon) {
-	((Scene *)refCon)->sceneChangeCmd(argc, argv);
-}
-
-void Scene::sceneInfoCmd(int argc, char *argv[]) {
-	const char *fmt = "%-20s %d";
-
-	_vm->_console->print(fmt, "Scene number:", _sceneNumber);
-	_vm->_console->print(fmt, "Descriptor R#:", _sceneResNum);
-	_vm->_console->print("-------------------------");
-	_vm->_console->print(fmt, "Flags:", _desc.flags);
-	_vm->_console->print(fmt, "Resource list R#:", _desc.resListRN);
-	_vm->_console->print(fmt, "End slope:", _desc.endSlope);
-	_vm->_console->print(fmt, "Begin slope:", _desc.beginSlope);
-	_vm->_console->print(fmt, "Script resource:", _desc.scriptNum);
-	_vm->_console->print(fmt, "Scene script:", _desc.sceneScriptNum);
-	_vm->_console->print(fmt, "Start script:", _desc.startScriptNum);
-	_vm->_console->print(fmt, "Music R#", _desc.musicRN);
-}
+void Scene::sceneInfoCmd() {
+	const char *fmt = "%-20s %d\n";
 
-static void CF_sceneinfo(int argc, char *argv[], void *refCon) {
-	((Scene *)refCon)->sceneInfoCmd(argc, argv);
+	_vm->_console->DebugPrintf(fmt, "Scene number:", _sceneNumber);
+	_vm->_console->DebugPrintf(fmt, "Descriptor R#:", _sceneResNum);
+	_vm->_console->DebugPrintf("-------------------------\n");
+	_vm->_console->DebugPrintf(fmt, "Flags:", _desc.flags);
+	_vm->_console->DebugPrintf(fmt, "Resource list R#:", _desc.resListRN);
+	_vm->_console->DebugPrintf(fmt, "End slope:", _desc.endSlope);
+	_vm->_console->DebugPrintf(fmt, "Begin slope:", _desc.beginSlope);
+	_vm->_console->DebugPrintf(fmt, "Script resource:", _desc.scriptNum);
+	_vm->_console->DebugPrintf(fmt, "Scene script:", _desc.sceneScriptNum);
+	_vm->_console->DebugPrintf(fmt, "Start script:", _desc.startScriptNum);
+	_vm->_console->DebugPrintf(fmt, "Music R#", _desc.musicRN);
 }
 
 int Scene::SC_defaultScene(int param, SCENE_INFO *scene_info, void *refCon) {
 	return ((Scene *)refCon)->defaultScene(param, scene_info);
 }
 
-static void CF_actioninfo(int argc, char *argv[], void *refCon) {
-	(void)(argc);
-	(void)(argv);
-
-	((Scene *)refCon)->_actionMap->info();
+void Scene::CF_actioninfo() {
+	_actionMap->info();
 }
 
-static void CF_objectinfo(int argc, char *argv[], void *refCon) {
-	(void)(argc);
-	(void)(argv);
-
-	((Scene *)refCon)->_objectMap->info();
+void Scene::CF_objectinfo() {
+	_objectMap->info();
 }
 
-
 int Scene::defaultScene(int param, SCENE_INFO *scene_info) {
 	EVENT event;
 	EVENT *q_event;

Index: scene.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- scene.h	25 Nov 2004 12:54:03 -0000	1.20
+++ scene.h	3 Dec 2004 19:15:44 -0000	1.21
@@ -214,7 +214,9 @@
  public:
 	Scene(SagaEngine *vm);
 	~Scene();
-	int reg();
+
+	void CF_actioninfo();
+	void CF_objectinfo();
 
 	int startScene();
 	int nextScene();
@@ -235,8 +237,8 @@
 
 	bool initialized() { return _initialized; }
 
-	void sceneInfoCmd(int argc, char *argv[]);
-	void sceneChangeCmd(int argc, char *argv[]);
+	void sceneInfoCmd();
+	void sceneChangeCmd(int argc, const char **argv);
 
 	int getSceneLUT(int num);
 	int currentSceneNumber() { return _sceneNumber; }

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/script.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- script.cpp	28 Nov 2004 18:26:09 -0000	1.30
+++ script.cpp	3 Dec 2004 19:15:44 -0000	1.31
@@ -29,24 +29,11 @@
 #include "saga/rscfile_mod.h"
 #include "saga/game_mod.h"
 #include "saga/console.h"
-#include "saga/cvar_mod.h"
 
 #include "saga/script.h"
 
 namespace Saga {
 
-static void CF_script_info(int argc, char *argv[], void *refCon); 
-static void CF_script_exec(int argc, char *argv[], void *refCon);
-static void CF_script_togglestep(int argc, char *argv[], void *refCon);
-
-int Script::reg() {
-	CVAR_RegisterFunc(CF_script_info, "script_info", NULL, CVAR_NONE, 0, 0, this);
-	CVAR_RegisterFunc(CF_script_exec, "script_exec", "<Script number>", CVAR_NONE, 1, 1, this);
-	CVAR_RegisterFunc(CF_script_togglestep, "script_togglestep", NULL, CVAR_NONE, 0, 0, this);
-
-	return SUCCESS;
-}
-
 // Initializes the scripting module.
 // Loads script resource look-up table, initializes script data system
 Script::Script() {
@@ -496,7 +483,7 @@
 	return voice_lut;
 }
 
-void Script::scriptInfo(int argc, char *argv[]) {
+void Script::scriptInfo() {
 	uint32 n_entrypoints;
 	uint32 i;
 	char *name_ptr;
@@ -511,51 +498,39 @@
 
 	n_entrypoints = currentScript()->bytecode->n_entrypoints;
 
-	_vm->_console->print("Current script contains %d entrypoints:", n_entrypoints);
+	_vm->_console->DebugPrintf("Current script contains %d entrypoints:\n", n_entrypoints);
 
 	for (i = 0; i < n_entrypoints; i++) {
 		name_ptr = (char *)currentScript()->bytecode->bytecode_p +
 							currentScript()->bytecode->entrypoints[i].name_offset;
-		_vm->_console->print("%lu: %s", i, name_ptr);
+		_vm->_console->DebugPrintf("%lu: %s\n", i, name_ptr);
 	}
 }
 
-void Script::scriptExec(int argc, char *argv[]) {
+void Script::scriptExec(int argc, const char **argv) {
 	uint16 ep_num;
 
-	if (argc < 1) {
-		return;
-	}
-
-	ep_num = atoi(argv[0]);
+	ep_num = atoi(argv[1]);
 
 	if (_dbg_thread == NULL) {
-		_vm->_console->print("Creating debug thread...");
+		_vm->_console->DebugPrintf("Creating debug thread...\n");
 		_dbg_thread = SThreadCreate();
 		if (_dbg_thread == NULL) {
-			_vm->_console->print("Thread creation failed.");
+			_vm->_console->DebugPrintf("Thread creation failed.\n");
 			return;
 		}
 	}
 
 	if (ep_num >= currentScript()->bytecode->n_entrypoints) {
-		_vm->_console->print("Invalid entrypoint.");
+		_vm->_console->DebugPrintf("Invalid entrypoint.\n");
 		return;
 	}
 
 	SThreadExecute(_dbg_thread, ep_num);
 }
 
-void CF_script_info(int argc, char *argv[], void *refCon) {
-	((Script *)refCon)->scriptInfo(argc, argv);
-}
-
-void CF_script_exec(int argc, char *argv[], void *refCon) {
-	((Script *)refCon)->scriptExec(argc, argv);
-}
-
-void CF_script_togglestep(int argc, char *argv[], void *refCon) {
-	((Script *)refCon)->_dbg_singlestep = !((Script *)refCon)->_dbg_singlestep;
+void Script::CF_script_togglestep() {
+	_dbg_singlestep = !_dbg_singlestep;
 }
 
 } // End of namespace Saga

Index: script.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/script.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- script.h	12 Nov 2004 15:32:42 -0000	1.27
+++ script.h	3 Dec 2004 19:15:44 -0000	1.28
@@ -186,7 +186,8 @@
 	Script();
 	~Script();
 	
-	int reg(void);
+	void CF_script_togglestep();
+
 	int loadScript(int scriptNum);
 	int freeScript();
 	SCRIPT_BYTECODE *loadBytecode(byte *bytecode_p, size_t bytecode_len);
@@ -201,8 +202,8 @@
 	SCRIPT_DATABUF *dataBuffer(int idx) { return _dataBuf[idx]; }
 	YS_DL_LIST *threadList() { return _threadList; }
 
-	void scriptInfo(int argc, char *argv[]);
-	void scriptExec(int argc, char *argv[]);
+	void scriptInfo();
+	void scriptExec(int argc, const char **argv);
 	
 protected:
 	bool _initialized;

Index: sfuncs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- sfuncs.cpp	26 Nov 2004 13:27:59 -0000	1.43
+++ sfuncs.cpp	3 Dec 2004 19:15:44 -0000	1.44
@@ -219,7 +219,7 @@
 	actor_id = _vm->_sdata->readWordS(actor_parm);
 	actor_idx = _vm->_actor->getActorIndex(actor_id);
 	if (actor_idx < 0) {
-		_vm->_console->print(S_WARN_PREFIX "SF.08: Actor id 0x%X not found.", actor_id);
+		_vm->_console->DebugPrintf(S_WARN_PREFIX "SF.08: Actor id 0x%X not found.\n", actor_id);
 		return FAILURE;
 	}
 
@@ -262,7 +262,7 @@
 	orientation = _vm->_sdata->readWordS(orient_parm);
 	actor_idx = _vm->_actor->getActorIndex(actor_id);
 	if (actor_idx < 0) {
-		_vm->_console->print(S_WARN_PREFIX "SF.08: Actor id 0x%X not found.", actor_id);
+		_vm->_console->DebugPrintf(S_WARN_PREFIX "SF.08: Actor id 0x%X not found.\n", actor_id);
 		return FAILURE;
 	}
 
@@ -468,7 +468,7 @@
 	anim_id = _vm->_sdata->readWordS(anim_id_parm);
 
 	if (_vm->_anim->play(anim_id, 0) != SUCCESS) {
-		_vm->_console->print(S_WARN_PREFIX "SF.26: Anim::play() failed. Anim id: %u\n", anim_id);
+		_vm->_console->DebugPrintf(S_WARN_PREFIX "SF.26: Anim::play() failed. Anim id: %u\n", anim_id);
 		return FAILURE;
 	}
 
@@ -495,7 +495,7 @@
 	actor_id = _vm->_sdata->readWordS(actor_parm);
 	actor_idx = _vm->_actor->getActorIndex(actor_id);
 	if (actor_idx < 0) {
-		_vm->_console->print(S_WARN_PREFIX "SF.08: Actor id 0x%X not found.",
+		_vm->_console->DebugPrintf(S_WARN_PREFIX "SF.08: Actor id 0x%X not found.\n",
 		    actor_id);
 		return FAILURE;
 	}
@@ -551,7 +551,7 @@
 	if (!_vm->_actor->actorExists(actor_id)) {
 		result = _vm->_actor->create(actor_id, pt.x, pt.y);
 		if (result != SUCCESS) {
-			_vm->_console->print(S_WARN_PREFIX "SF.30: Couldn't create actor 0x%X.", actor_id);
+			_vm->_console->DebugPrintf(S_WARN_PREFIX "SF.30: Couldn't create actor 0x%X.\n", actor_id);
 			return FAILURE;
 		}
 	} else {
@@ -646,7 +646,7 @@
 
 	actor_idx = _vm->_actor->getActorIndex(_vm->_sdata->readWordS(actor_parm));
 	if (actor_idx < 0) {
-		_vm->_console->print(S_WARN_PREFIX "SF.36: Actor id 0x%X not found.", (int)actor_parm);
+		_vm->_console->DebugPrintf(S_WARN_PREFIX "SF.36: Actor id 0x%X not found.\n", (int)actor_parm);
 		return FAILURE;
 	}
 
@@ -688,7 +688,7 @@
 	actor_idx = _vm->_actor->getActorIndex(actor_id);
 
 	if (_vm->_actor->setAction(actor_idx, action, ACTION_NONE) != SUCCESS) {
-		_vm->_console->print(S_WARN_PREFIX "SF.37: Actor::setAction() failed.");
+		_vm->_console->DebugPrintf(S_WARN_PREFIX "SF.37: Actor::setAction() failed.\n");
 		return FAILURE;
 	}
 
@@ -720,7 +720,7 @@
 	actor_idx = _vm->_actor->getActorIndex(actor_id);
 
 	if (_vm->_actor->setAction(actor_idx, action, ACTION_NONE) != SUCCESS) {
-		_vm->_console->print(S_WARN_PREFIX "SF.38: Actor::setAction() failed.");
+		_vm->_console->DebugPrintf(S_WARN_PREFIX "SF.38: Actor::setAction() failed.\n");
 		return FAILURE;
 	}
 
@@ -768,7 +768,7 @@
 	anim_id2 = _vm->_sdata->readWordU(anim2_parm);
 
 	if (_vm->_anim->link(anim_id1, anim_id2) != SUCCESS) {
-		_vm->_console->print(S_WARN_PREFIX "SF.41: Anim::link() failed. (%u->%u)\n", anim_id1, anim_id2);
+		_vm->_console->DebugPrintf(S_WARN_PREFIX "SF.41: Anim::link() failed. (%u->%u)\n", anim_id1, anim_id2);
 		return FAILURE;
 	}
 
@@ -824,7 +824,7 @@
 	if (!_vm->_actor->actorExists(actor_id)) {
 		result = _vm->_actor->create(actor_id, pt.x, pt.y);
 		if (result != SUCCESS) {
-			_vm->_console->print(S_WARN_PREFIX "SF.43: Couldn't create actor 0x%X.", actor_id);
+			_vm->_console->DebugPrintf(S_WARN_PREFIX "SF.43: Couldn't create actor 0x%X.\n", actor_id);
 			return FAILURE;
 		}
 	} else {

Index: sthread.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sthread.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- sthread.cpp	14 Nov 2004 13:15:26 -0000	1.38
+++ sthread.cpp	3 Dec 2004 19:15:44 -0000	1.39
@@ -383,7 +383,7 @@
 				n_args = scriptS.readByte();
 				func_num = scriptS.readUint16LE();
 				if (func_num >= SFUNC_NUM) {
-					_vm->_console->print(S_ERROR_PREFIX "Invalid script function number: (%X)\n", func_num);
+					_vm->_console->DebugPrintf(S_ERROR_PREFIX "Invalid script function number: (%X)\n", func_num);
 					thread->flags |= kTFlagAborted;
 					break;
 				}
@@ -391,7 +391,7 @@
 				sfunc = _SFuncList[func_num];
 				sfuncRetVal = (this->*sfunc)(thread, n_args);
 				if (sfuncRetVal != SUCCESS) {
-					_vm->_console->print(S_WARN_PREFIX "%X: Script function %d failed.\n", thread->i_offset, func_num);
+					_vm->_console->DebugPrintf(S_WARN_PREFIX "%X: Script function %d failed.\n", thread->i_offset, func_num);
 				}
 
 				if (func_num == 16) { // SF_gotoScene
@@ -419,7 +419,7 @@
 			thread->stackPtr = thread->framePtr;
 			setFramePtr(thread, thread->pop());
 			if (thread->stackSize() == 0) {
-				_vm->_console->print("Script execution complete.");
+				_vm->_console->DebugPrintf("Script execution complete.\n");
 				thread->flags |= kTFlagFinished;
 			} else {
 				thread->i_offset = thread->pop();
@@ -519,7 +519,7 @@
 					}
 				}
 				if (!branch_found) {
-					_vm->_console->print(S_ERROR_PREFIX "%X: Random jump target out of " "bounds.", thread->i_offset);
+					_vm->_console->DebugPrintf(S_ERROR_PREFIX "%X: Random jump target out of bounds.\n", thread->i_offset);
 				}
 			}
 			break;
@@ -757,7 +757,7 @@
 
 				a_index = _vm->_actor->getActorIndex(param1);
 				if (a_index < 0) {
-					_vm->_console->print(S_WARN_PREFIX "%X: DLGP Actor id not found.", thread->i_offset);
+					_vm->_console->DebugPrintf(S_WARN_PREFIX "%X: DLGP Actor id not found.\n", thread->i_offset);
 				}
 
 				for (i = 0; i < n_voices; i++) {
@@ -804,7 +804,7 @@
 
 		default:
 
-			_vm->_console->print(S_ERROR_PREFIX "%X: Invalid opcode encountered: " "(%X).\n", thread->i_offset, in_char);
+			_vm->_console->DebugPrintf(S_ERROR_PREFIX "%X: Invalid opcode encountered: (%X).\n", thread->i_offset, in_char);
 			thread->flags |= kTFlagAborted;
 			break;
 		}
@@ -816,7 +816,7 @@
 			scriptS.seek(thread->i_offset);
 		}
 		if (unhandled) {
-			_vm->_console->print(S_ERROR_PREFIX "%X: Unhandled opcode.\n", thread->i_offset);
+			_vm->_console->DebugPrintf(S_ERROR_PREFIX "%X: Unhandled opcode.\n", thread->i_offset);
 			thread->flags |= kTFlagAborted;
 		}
 		if ((thread->flags == kTFlagNone) && debug_print) {

--- cvar.cpp DELETED ---

--- cvar.h DELETED ---

--- cvar_mod.h DELETED ---

--- expr.cpp DELETED ---

--- expr.h DELETED ---





More information about the Scummvm-git-logs mailing list