[Scummvm-cvs-logs] CVS: scummvm/base engine.cpp,1.12,1.13

James Brown ender at users.sourceforge.net
Fri Jan 9 21:21:01 CET 2004


Update of /cvsroot/scummvm/scummvm/base
In directory sc8-pr-cvs1:/tmp/cvs-serv7204/base

Modified Files:
	engine.cpp 
Log Message:
Start of debug channel support. TODO: Move this to the common Debugger system?


Index: engine.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/base/engine.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- engine.cpp	6 Jan 2004 12:45:27 -0000	1.12
+++ engine.cpp	10 Jan 2004 05:20:14 -0000	1.13
@@ -192,6 +192,33 @@
 	fflush(stdout);
 }
 
+void CDECL debug(const char *s, ...) {
+#ifdef __PALM_OS__
+	char buf[256]; // 1024 is too big overflow the stack
+#else
+	char buf[1024];
+#endif
+	va_list va;
+
+	va_start(va, s);
+	vsprintf(buf, s, va);
+	va_end(va);
+	printf("%s\n", buf);
+
+#if defined( USE_WINDBG )
+	strcat(buf, "\n");
+#if defined( _WIN32_WCE )
+	TCHAR buf_unicode[1024];
+	MultiByteToWideChar(CP_ACP, 0, buf, strlen(buf) + 1, buf_unicode, sizeof(buf_unicode));
+	OutputDebugString(buf_unicode);
+#else
+	OutputDebugString(buf);
+#endif
+#endif
+
+	fflush(stdout);
+}
+
 void checkHeap() {
 #if defined(_MSC_VER)
 	if (_heapchk() != _HEAPOK) {





More information about the Scummvm-git-logs mailing list