[Scummvm-cvs-logs] CVS: scummvm/queen defs.h,1.17,1.18 logic.h,1.44,1.45 logic.cpp,1.60,1.61 xref.txt,1.20,1.21

Gregory Montoir cyx at users.sourceforge.net
Sat Oct 25 13:36:06 CEST 2003


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1:/tmp/cvs-serv14738

Modified Files:
	defs.h logic.h logic.cpp xref.txt 
Log Message:
add some methods to Logic for future Command class

Index: defs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/defs.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- defs.h	25 Oct 2003 09:11:35 -0000	1.17
+++ defs.h	25 Oct 2003 20:26:50 -0000	1.18
@@ -116,7 +116,10 @@
 	VERB_DIGIT_LAST = 16,
 	
 	VERB_USE_JOURNAL = 20,
-	VERB_SKIP_TEXT   = 101
+	VERB_SKIP_TEXT   = 101,
+
+	VERB_PREP_WITH = 11,
+	VERB_PREP_TO   = 12
 };
 
 
@@ -137,6 +140,12 @@
 enum StateOn {
 	STATE_ON_ON,
 	STATE_ON_OFF
+};
+
+
+enum StateUse {
+	STATE_USE,
+	STATE_USE_ON
 };
 
 

Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- logic.h	25 Oct 2003 09:11:35 -0000	1.44
+++ logic.h	25 Oct 2003 20:26:50 -0000	1.45
@@ -75,6 +75,8 @@
 	//! FIND_STATE(state, "DEF");
 	static Verb findDefaultVerb(uint16 state);
 
+	static StateUse findUse(uint16 state);
+
 	//! ALTER_STATE(state, "ON");
 	static void alterOn(uint16 *objState, StateOn state);
 
@@ -121,6 +123,7 @@
 	uint16 currentRoomAreaMax();
 	uint16 walkOffCount();
 	WalkOffData *walkOffData(int index);
+	uint16 currentRoomObjMax() const { return _objMax[_currentRoom]; }
 
 	uint16 joeFacing()	{ return _joe.facing; }
 	uint16 joeX()		{ return _joe.x; }
@@ -213,6 +216,10 @@
 
 	Walk *walk() { return _walk; }
 	Display *display() { return _display; }
+
+	uint16 findObjectFromZone(uint16 zoneNum);
+
+	const char *verbName(Verb v) const;
 
 	void update();
 

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- logic.cpp	25 Oct 2003 09:11:35 -0000	1.60
+++ logic.cpp	25 Oct 2003 20:26:50 -0000	1.61
@@ -116,6 +116,11 @@
 }
 
 
+StateUse State::findUse(uint16 state) {
+	return (state & (1 << 10)) ? STATE_USE : STATE_USE_ON;
+}
+
+
 void State::alterOn(uint16 *objState, StateOn state) {
 	switch (state) {
 	case STATE_ON_ON:
@@ -1924,6 +1929,36 @@
 
 	return PANEL_VERBS[zoneIn(ZONE_PANEL, cursorx, cursory)];
 }
+
+
+uint16 Logic::findObjectFromZone(uint16 zoneNum) {
+
+	// l.316-327 select.c
+	uint16 noun = zoneNum;
+	uint16 objectMax = _objMax[_currentRoom];
+	if (zoneNum > objectMax) {
+		// this is an area box, check for associated object
+		uint16 obj = _area[_currentRoom][zoneNum - objectMax].object;
+		if (obj != 0) {
+			// there is an object, get its number
+			noun = obj - _roomData[_currentRoom];
+		}
+	}
+	return noun;
+}
+
+
+const char *Logic::verbName(Verb v) const {
+
+	if (v != VERB_NONE && v < 13) {
+		return _verbName[v];
+	}
+	else {
+		error("Logic::verbName() - Invalid verb %d", v);
+		return NULL;
+	}
+}
+
 
 
 void Logic::update() {

Index: xref.txt
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/xref.txt,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- xref.txt	25 Oct 2003 09:11:35 -0000	1.20
+++ xref.txt	25 Oct 2003 20:26:50 -0000	1.21
@@ -31,13 +31,11 @@
 ACTION,ACTION2				Command::_action*
 CLEVEL						Command::_commandLevel
 COMMANDstr					Command::_command
-DEFCOMM
-OLDVERB,VERB
-OLDNOUN,NOUN,NOUN2
+DEFCOMM						Command::_defaultVerb
+OLDVERB,VERB				Command::_*verb*
+OLDNOUN,NOUN,NOUN2			Command::_*old*
 PARSE						Command::_parse
 SUBJ1,SUBJ2,SUBJECT			Command::_subject*
-TEMPstr
-WORDstr
 
 
 CREDIT SCRIPTING SYSTEM
@@ -487,3 +485,5 @@
 OUTLINE	// not needed, textSet() Graphics::parameter
 FTOT //	queen.c/SETUP_FURNITURE local var
 OBJMAXv	// == Logic::_objMax[Logic::_currentRoom]
+TEMPstr
+WORDstr





More information about the Scummvm-git-logs mailing list