[Scummvm-cvs-logs] CVS: scummvm/scumm object.cpp,1.37,1.38 resource.cpp,1.46,1.47 scumm.h,1.121,1.122 scummvm.cpp,2.22,2.23

Max Horn fingolfin at users.sourceforge.net
Mon Dec 30 18:11:01 CET 2002


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv1095/scumm

Modified Files:
	object.cpp resource.cpp scumm.h scummvm.cpp 
Log Message:
get rid of DUMP_SCRIPTS; in its place, added run time option '-u' to enabled script dumping

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- object.cpp	28 Dec 2002 00:45:44 -0000	1.37
+++ object.cpp	31 Dec 2002 02:09:56 -0000	1.38
@@ -440,16 +440,15 @@
 		else
 			od->obj_nr = READ_LE_UINT16(&(cdhd->v5.obj_id));
 
-#ifdef DUMP_SCRIPTS
-		do {
+		if (_dumpScripts) {
 			char buf[32];
 			sprintf(buf, "roomobj-%d-", _roomResource);
 			if (_features & GF_AFTER_V8)
 				// TODO - maybe V8 is not the only that needs this?
 				ptr = findResource(MKID('VERB'), ptr, 0);
 			dumpResource(buf, od->obj_nr, ptr);
-		} while (0);
-#endif
+		}
+
 		searchptr = NULL;
 	}
 
@@ -514,13 +513,12 @@
 		od->OBCDoffset = ptr - room;
 		od->obj_nr = READ_LE_UINT16(ptr + 6);
 
-#ifdef DUMP_SCRIPTS
-		do {
+		if (_dumpScripts) {
 			char buf[32];
 			sprintf(buf, "roomobj-%d-", _roomResource);
 			dumpResource(buf, od->obj_nr, ptr);
-		} while (0);
-#endif
+		}
+
 		searchptr = NULL;
 	}
 

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- resource.cpp	28 Dec 2002 12:42:55 -0000	1.46
+++ resource.cpp	31 Dec 2002 02:09:56 -0000	1.47
@@ -585,12 +585,10 @@
 	}
 	_fileHandle.read(createResource(type, idx, size), size);
 
-	/* dump the resource */
-#ifdef DUMP_SCRIPTS
-	if (type == rtScript) {
+	// dump the resource if requested
+	if (_dumpScripts && type == rtScript) {
 		dumpResource("script-", idx, getResourceAddress(rtScript, idx));
 	}
-#endif
 
 	if (!_fileHandle.ioFailed()) {
 		return 1;

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -d -r1.121 -r1.122
--- scumm.h	29 Dec 2002 21:14:28 -0000	1.121
+++ scumm.h	31 Dec 2002 02:09:57 -0000	1.122
@@ -377,6 +377,7 @@
 
 	int16 _virtual_mouse_x, _virtual_mouse_y;
 	int _bootParam;
+	bool _dumpScripts;
 	uint16 _debugMode, _soundCardType;
 
 	/* Not sure where this stuff goes */

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.22
retrieving revision 2.23
diff -u -d -r2.22 -r2.23
--- scummvm.cpp	29 Dec 2002 19:54:11 -0000	2.22
+++ scummvm.cpp	31 Dec 2002 02:09:57 -0000	2.23
@@ -85,6 +85,7 @@
 
 	_debugMode = detector->_debugMode;
 	_debugLevel = detector->_debugLevel;
+	_dumpScripts = detector->_dumpScripts;
 	_bootParam = detector->_bootParam;
 	_exe_name = (char*)detector->_gameRealName.c_str();
 	_game_name = (char*)detector->_gameFileName.c_str();
@@ -755,18 +756,16 @@
 	ptr = findResourceData(MKID('EXCD'), roomResPtr);
 	if (ptr) {
 		_EXCD_offs = ptr - roomResPtr;
-#ifdef DUMP_SCRIPTS
-		dumpResource("exit-", _roomResource, ptr - _resourceHeaderSize);
-#endif
+		if (_dumpScripts)
+			dumpResource("exit-", _roomResource, ptr - _resourceHeaderSize);
 	}
 
 	// Look for an entry script
 	ptr = findResourceData(MKID('ENCD'), roomResPtr);
 	if (ptr) {
 		_ENCD_offs = ptr - roomResPtr;
-#ifdef DUMP_SCRIPTS
-		dumpResource("entry-", _roomResource, ptr - _resourceHeaderSize);
-#endif
+		if (_dumpScripts)
+			dumpResource("entry-", _roomResource, ptr - _resourceHeaderSize);
 	}
 
 	if (_features & GF_SMALL_HEADER) {
@@ -856,13 +855,13 @@
 			int id = 0;
 			ptr += _resourceHeaderSize;	/* skip tag & size */
 			id = ptr[0];
-#ifdef DUMP_SCRIPTS
-			do {
+
+			if (_dumpScripts) {
 				char buf[32];
 				sprintf(buf, "room-%d-", _roomResource);
 				dumpResource(buf, id, ptr - 6);
-			} while (0);
-#endif
+			}
+
 			_localScriptList[id - _numGlobalScripts] = ptr + 1 - roomptr;
 			searchptr = NULL;
 		}
@@ -884,13 +883,13 @@
 				id = ptr[0];
 				_localScriptList[id - _numGlobalScripts] = ptr + 1 - roomResPtr;
 			}
-#ifdef DUMP_SCRIPTS
-			do {
+
+			if (_dumpScripts) {
 				char buf[32];
 				sprintf(buf, "room-%d-", _roomResource);
 				dumpResource(buf, id, ptr - 8);
-			} while (0);
-#endif
+			}
+
 			searchptr = NULL;
 		}
 	}





More information about the Scummvm-git-logs mailing list