[Scummvm-cvs-logs] SF.net SVN: scummvm:[39106] scummvm/trunk/engines/sci

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Mar 4 06:19:20 CET 2009


Revision: 39106
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39106&view=rev
Author:   fingolfin
Date:     2009-03-04 05:19:19 +0000 (Wed, 04 Mar 2009)

Log Message:
-----------
SCI: cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kdebug.cpp
    scummvm/trunk/engines/sci/engine/said.cpp
    scummvm/trunk/engines/sci/engine/said.y
    scummvm/trunk/engines/sci/engine/scriptdebug.cpp
    scummvm/trunk/engines/sci/sci.cpp
    scummvm/trunk/engines/sci/scicore/sciconsole.cpp
    scummvm/trunk/engines/sci/scicore/sciconsole.h

Modified: scummvm/trunk/engines/sci/engine/kdebug.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kdebug.cpp	2009-03-04 05:09:35 UTC (rev 39105)
+++ scummvm/trunk/engines/sci/engine/kdebug.cpp	2009-03-04 05:19:19 UTC (rev 39106)
@@ -33,15 +33,6 @@
 int script_debug_flag = 0; // Defaulting to running mode
 int sci_debug_flags = 0; // Special flags
 
-// Functions for internal macro use
-void _SCIkvprintf(FILE *file, const char *format, va_list args);
-
-void _SCIkvprintf(FILE *file, const char *format, va_list args) {
-	vfprintf(file, format, args);
-	if (con_file) vfprintf(con_file, format, args);
-}
-
-
 void _SCIkwarn(EngineState *s, const char *file, int line, int area, const char *format, ...) {
 	va_list args;
 
@@ -51,11 +42,12 @@
 		fprintf(stderr, "Warning: ");
 
 	va_start(args, format);
-	_SCIkvprintf(stderr, format, args);
+	vfprintf(stderr, format, args);
 	va_end(args);
 	fflush(NULL);
 
-	if (sci_debug_flags & _DEBUG_FLAG_BREAK_ON_WARNINGS) script_debug_flag = 1;
+	if (sci_debug_flags & _DEBUG_FLAG_BREAK_ON_WARNINGS)
+		script_debug_flag = 1;
 }
 
 void _SCIkdebug(EngineState *s, const char *file, int line, int area, const char *format, ...) {
@@ -64,7 +56,7 @@
 	if (s->debug_mode & (1 << area)) {
 		fprintf(stdout, " kernel: (%s L%d): ", file, line);
 		va_start(args, format);
-		_SCIkvprintf(stdout, format, args);
+		vfprintf(stdout, format, args);
 		va_end(args);
 		fflush(NULL);
 	}

Modified: scummvm/trunk/engines/sci/engine/said.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/said.cpp	2009-03-04 05:09:35 UTC (rev 39105)
+++ scummvm/trunk/engines/sci/engine/said.cpp	2009-03-04 05:19:19 UTC (rev 39106)
@@ -2466,7 +2466,7 @@
 int main (int argc, char *argv) {
 	byte block[] = {0x01, 0x00, 0xf8, 0xf5, 0x02, 0x01, 0xf6, 0xf2, 0x02, 0x01, 0xf2, 0x01, 0x03, 0xff};
 	EngineState s;
-	con_passthrough = 1;
+	con_passthrough = true;
 
 	s.parser_valid = 1;
 	said(&s, block);

Modified: scummvm/trunk/engines/sci/engine/said.y
===================================================================
--- scummvm/trunk/engines/sci/engine/said.y	2009-03-04 05:09:35 UTC (rev 39105)
+++ scummvm/trunk/engines/sci/engine/said.y	2009-03-04 05:19:19 UTC (rev 39106)
@@ -822,7 +822,7 @@
 int main (int argc, char *argv) {
 	byte block[] = {0x01, 0x00, 0xf8, 0xf5, 0x02, 0x01, 0xf6, 0xf2, 0x02, 0x01, 0xf2, 0x01, 0x03, 0xff};
 	EngineState s;
-	con_passthrough = 1;
+	con_passthrough = true;
 
 	s.parser_valid = 1;
 	said(&s, block);

Modified: scummvm/trunk/engines/sci/engine/scriptdebug.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-03-04 05:09:35 UTC (rev 39105)
+++ scummvm/trunk/engines/sci/engine/scriptdebug.cpp	2009-03-04 05:19:19 UTC (rev 39106)
@@ -3258,23 +3258,11 @@
 	while (_debugstate_valid) {
 		int skipfirst = 0;
 		const char *commandstring;
-#ifdef WANT_CONSOLE
-		char *input;
-#endif
 
 		// Suspend music playing
 		sfx_suspend(&s->sound, 1);
 
-#ifdef WANT_CONSOLE
-		if (!have_windowed) {
-			con_gfx_show(s->gfx_state);
-			input = con_gfx_read(s->gfx_state);
-			con_gfx_hide(s->gfx_state);
-			commandstring = input;
-			sciprintf("> %s\n", commandstring);
-		} else
-#endif
-			commandstring = _debug_get_input();
+		commandstring = _debug_get_input();
 
 		// Check if a specific destination has been given
 		if (commandstring && (commandstring[0] == '.' || commandstring[0] == ':'))

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-03-04 05:09:35 UTC (rev 39105)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-03-04 05:19:19 UTC (rev 39106)
@@ -51,9 +51,6 @@
 }
 
 static void init_console() {
-#ifdef WANT_CONSOLE
-	con_gfx_init();
-#endif
 	con_hook_command(&c_quit, "quit", "", "console: Quits gracefully");
 	con_hook_command(&c_die, "die", "", "console: Quits ungracefully");
 
@@ -76,7 +73,7 @@
 	con_hook_int(&sci01_priority_table_flags, "sci01_priority_table_flags",
 	             "SCI01 priority table debugging flags: 1:Disable, 2:Print on change\n");
 
-	con_passthrough = 1; // enables all sciprintf data to be sent to stdout
+	con_passthrough = true; // enables all sciprintf data to be sent to stdout
 }
 
 static int init_gamestate(EngineState *gamestate, sci_version_t version) {
@@ -298,8 +295,6 @@
 
 	delete _resmgr;
 
-	close_console_file();
-
 	gfxop_exit(&gfx_state);
 
 	return Common::kNoError;

Modified: scummvm/trunk/engines/sci/scicore/sciconsole.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/sciconsole.cpp	2009-03-04 05:09:35 UTC (rev 39105)
+++ scummvm/trunk/engines/sci/scicore/sciconsole.cpp	2009-03-04 05:19:19 UTC (rev 39106)
@@ -33,8 +33,7 @@
 
 #ifdef SCI_CONSOLE
 
-int con_passthrough = 0;
-FILE *con_file = NULL;
+int con_passthrough = false;
 
 static void (*_con_string_callback)(char*) = NULL;
 static void (*_con_pixmap_callback)(gfx_pixmap_t *) = NULL;
@@ -68,8 +67,6 @@
 
 	if (con_passthrough)
 		printf("%s", buf);
-	if (con_file)
-		fprintf(con_file, "%s", buf);
 
 	if (_con_string_callback)
 		_con_string_callback(buf);
@@ -99,30 +96,6 @@
 	return 0;
 }
 
-void open_console_file(char *filename) {
-	if (con_file != NULL)
-		fclose(con_file);
-
-	if (NULL == filename) {
-		fprintf(stderr, "console.c: open_console_file(): NULL passed for parameter filename\r\n");
-	}
-#ifdef WIN32
-	con_file = fopen(filename, "wt");
-#else
-	con_file = fopen(filename, "w");
-#endif
-
-	if (NULL == con_file)
-		fprintf(stderr, "console.c: open_console_file(): Could not open output file %s\n", filename);
-}
-
-void close_console_file() {
-	if (con_file != NULL) {
-		fclose(con_file);
-		con_file = NULL;
-	}
-}
-
 #endif // SCI_CONSOLE
 
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/scicore/sciconsole.h
===================================================================
--- scummvm/trunk/engines/sci/scicore/sciconsole.h	2009-03-04 05:09:35 UTC (rev 39105)
+++ scummvm/trunk/engines/sci/scicore/sciconsole.h	2009-03-04 05:19:19 UTC (rev 39106)
@@ -34,7 +34,6 @@
 
 #include "common/scummsys.h"
 
-#include "sci/sci_memory.h"
 #include "sci/tools.h"
 #include "sci/engine/vm_types.h"
 
@@ -43,13 +42,8 @@
 
 namespace Sci {
 
+/** If this flag is set, we echo all sciprintf() stuff to the text console. */
 extern int con_passthrough;
-/* Echo all sciprintf() stuff to the text console */
-extern FILE *con_file;
-/* Echo all sciprintf() output to a text file. Note: clients of freesci.dll
-** should use open_console_file and close_console_file, rather than refer
-** directly to the con_file variable.
-*/
 
 union cmd_param_t {
 	int32 val;
@@ -57,14 +51,14 @@
 	reg_t reg;
 };
 
+/** The number of parameters passed to a function called from the parser */
 extern unsigned int cmd_paramlength;
-/* The number of parameters passed to a function called from the parser */
 
+/** The parameters passed to a function called by the parser */
 extern cmd_param_t *cmd_params;
-/* The parameters passed to a function called by the parser */
 
+/** The game state as used by some of the console commands */
 extern struct EngineState *con_gamestate;
-/* The game state as used by some of the console commands */
 
 
 /*** FUNCTION DEFINITIONS ***/
@@ -139,21 +133,6 @@
 ** as no element beyond strlen(cmd_params[x].str)+1 is accessed.
 */
 
-cmd_param_t con_getopt(char *opt);
-/* Retreives the specified optional parameter
-** -- for use within console functions only --
-** Parameters: (char *) opt: The optional parameter to retrieve
-** Returns   : (cmd_param_t) The corresponding parameter
-** Should only be used if con_hasopt() reports its presence.
-*/
-
-int con_hasopt(char *opt);
-/* Checks whether an optional parameter was specified
-** -- for use within console functions only --
-** Parameters: (char *) opt: The optional parameter to check for
-** Returns   : (int) non-zero iff the parameter was specified
-*/
-
 int con_can_handle_pixmaps();
 /* Determines whether the console supports pixmap inserts
 ** Returns   : (int) non-zero iff pixmap inserts are supported
@@ -187,44 +166,8 @@
 */
 
 
-void con_gfx_init();
-/* Initializes the gfx console
-*/
-
-void con_gfx_show(gfx_state_t *state);
-/* Enters on-screen console mode
-** Parameters: (gfx_state_t *state): The graphics state to use for interaction
-** Returns   : (void)
-*/
-
-char *con_gfx_read(gfx_state_t *state);
-/* Reads a single line from the on-screen console, if it is open
-** Parameters: (gfx_state_t *state): The graphics state to use for interaction
-** Returns   : (char *) The input, in a static buffer
-*/
-
-void con_gfx_hide(gfx_state_t *stae);
-/* Closes the on-screen console
-** Parameters: (gfx_state_t *state): The graphics state to use for interaction
-** Returns   : (void)
-*/
-
-
 int sci_hexdump(byte *data, int length, int offsetplus);
 
-void open_console_file(char *filename);
-/* Opens the file to which the console output is echoed. If a file was opened
-** before, closes it.
-** Parameters: filename - name of the file
-** Returns   : (void)
-*/
-
-void close_console_file();
-/* Closes the console output file.
-** Parameters: (void)
-** Returns   : (void)
-*/
-
 } // End of namespace Sci
 
 #endif // SCI_SCICORE_SCICONSOLE_H


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