[Scummvm-cvs-logs] CVS: scummvm/scumm script_v5.cpp,NONE,1.1 script_v6.cpp,NONE,1.1 module.mk,1.1,1.2 resource_v2.cpp,1.5,1.6 scumm.h,1.76,1.77 scummvm.cpp,1.92,1.93 script_v2.cpp,1.61,NONE

James Brown ender at users.sourceforge.net
Thu Dec 12 08:30:05 CET 2002


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

Modified Files:
	module.mk resource_v2.cpp scumm.h scummvm.cpp 
Added Files:
	script_v5.cpp script_v6.cpp 
Removed Files:
	script_v2.cpp 
Log Message:
Tidy one or two things up for future V1/V2/V8 SCUMM support.


--- NEW FILE: script_v5.cpp ---
/* ScummVM - Scumm Interpreter
 * Copyright (C) 2001  Ludvig Strigeus
 * Copyright (C) 2001/2002 The ScummVM project
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Header: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v 1.1 2002/12/12 16:29:20 ender Exp $
[...2569 lines suppressed...]

	if (obj < 1) {
		error("pickupObjectOld received invalid index %d (script %d)", obj, vm.slot[_currentScript].number);
	}

	if (getObjectIndex(obj) == -1)
		return;

	if (whereIsObject(obj) == WIO_INVENTORY)	/* Don't take an */
		return;											/* object twice */

	// warning("adding %d from %d to inventoryOld", obj, _currentRoom);
	addObjectToInventory(obj, _roomResource);
	removeObjectFromRoom(obj);
	putOwner(obj, _vars[VAR_EGO]);
	putClass(obj, 32, 1);
	putState(obj, 1);
	clearDrawObjectQueue();
	runHook(1);
}

--- NEW FILE: script_v6.cpp ---
/* ScummVM - Scumm Interpreter
 * Copyright (C) 2001  Ludvig Strigeus
 * Copyright (C) 2001/2002 The ScummVM project
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Header: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v 1.1 2002/12/12 16:29:20 ender Exp $
[...2940 lines suppressed...]
		}
	case 0xFE:
		setStringVars(m);
		if (n)
			_actorToPrintStrFor = pop();
		return;
	case 0xFF:
		_string[m].t_xpos = _string[m].xpos;
		_string[m].t_ypos = _string[m].ypos;
		_string[m].t_center = _string[m].center;
		_string[m].t_overhead = _string[m].overhead;
		_string[m].t_no_talk_anim = _string[m].no_talk_anim;
		_string[m].t_right = _string[m].right;
		_string[m].t_color = _string[m].color;
		_string[m].t_charset = _string[m].charset;
		return;
	default:
		error("decodeParseString: default case");
	}
}

Index: module.mk
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/module.mk,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- module.mk	21 Nov 2002 04:08:37 -0000	1.1
+++ module.mk	12 Dec 2002 16:29:20 -0000	1.2
@@ -18,8 +18,8 @@
 	scumm/resource_v4.o \
 	scumm/saveload.o \
 	scumm/script.o \
-	scumm/script_v1.o \
-	scumm/script_v2.o \
+	scumm/script_v5.o \
+	scumm/script_v6.o \
 	scumm/scummvm.o \
 	scumm/sound.o \
 	scumm/string.o \

Index: resource_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource_v2.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- resource_v2.cpp	21 Oct 2002 13:23:24 -0000	1.5
+++ resource_v2.cpp	12 Dec 2002 16:29:20 -0000	1.6
@@ -26,13 +26,14 @@
 
 void Scumm_v2::readIndexFile()
 {
+	int magic = 0;
 	debug(9, "readIndexFile()");
 
 	openRoom(-1);
 	openRoom(0);
 
-	if (_fileHandle.readUint16LE() != 0x0100)
-		warning("The magic id doesn't match\n");
+	if (magic = _fileHandle.readUint16LE() != 0x0100)
+		warning("The magic id doesn't match (0x%X)\n", magic);
 
 	_numGlobalObjects = _fileHandle.readUint16LE();
 	_fileHandle.seek(_numGlobalObjects, SEEK_CUR); // Skip object flags

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- scumm.h	11 Dec 2002 01:25:15 -0000	1.76
+++ scumm.h	12 Dec 2002 16:29:20 -0000	1.77
@@ -482,9 +482,9 @@
 	void freezeScripts(int scr);
 	void unfreezeScripts();
 	void runAllScripts();
-	void setupOpcodes();
-	void setupOpcodes2();	
-	//void setupOpcodes3();	
+	void setupOpcodes_V5();
+	void setupOpcodes_V6();	
+	//void setupOpcodes_V8();	
 	void cutscene(int16 *args);
 	void endCutscene();
 	void exitCutscene();

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- scummvm.cpp	11 Dec 2002 20:56:49 -0000	1.92
+++ scummvm.cpp	12 Dec 2002 16:29:21 -0000	1.93
@@ -1566,10 +1566,10 @@
 
 	readIndexFile();
 
-	if (_features & GF_NEW_OPCODES)
-		setupOpcodes2();
+	if (_features & GF_AFTER_V6)
+		setupOpcodes_V6();
 	else
-		setupOpcodes();
+		setupOpcodes_V5();
 
 	scummInit();
 

--- script_v2.cpp DELETED ---





More information about the Scummvm-git-logs mailing list