[Scummvm-cvs-logs] CVS: residual lua.cpp,1.46,1.47 objectstate.h,1.1,1.2

Daniel Schepler dschepler at users.sourceforge.net
Mon Mar 22 01:03:02 CET 2004


Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21347

Modified Files:
	lua.cpp objectstate.h 
Log Message:
Display a bit more information on NewObjectState calls.


Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- lua.cpp	21 Mar 2004 15:16:56 -0000	1.46
+++ lua.cpp	22 Mar 2004 08:51:54 -0000	1.47
@@ -100,6 +100,13 @@
 	return val;
 }
 
+static inline ObjectState::Position check_objstate_pos(int num) {
+	int val = check_int(num);
+	if (val < 1 || val > 3)
+		luaL_argerror(num, "object state position out of range");
+	return (ObjectState::Position) val;
+}
+
 static inline bool getbool(int num) {
 	return ! lua_isnil(lua_getparam(num));
 }
@@ -1069,23 +1076,25 @@
 
 // Objectstate functions
 static void NewObjectState() {
+	enum ObjectPosition {
+		OBJSTATE_UNDERLAY = 1,
+		OBJSTATE_OVERLAY = 2,
+		OBJSTATE_STATE = 3
+	};
 	ObjectState *object = NULL;
 
 	int setupID = check_int(1);		// Setup ID
-	int unk1 = check_int(2);		// ??
+	ObjectState::Position pos = check_objstate_pos(2); // When to draw
 	char *bitmap = luaL_check_string(3);	// Bitmap
-	char *zbitmap;				// Zbuffer Bitmap
+	char *zbitmap = NULL;			// Zbuffer Bitmap
 	bool unk2 = getbool(5);			// ?
-	int unk3 = 0;
+	bool unk3 = getbool(6);
 
 	if (!lua_isnil(lua_getparam(4)))
 		zbitmap = luaL_check_string(4);
 
-	if (!unk2)
-		unk3 = check_int(6);		// ?
-
 #ifndef OSX
-	warning("Stub: newObjectState(%d, %s, %s)", setupID, bitmap, zbitmap);
+	warning("Stub: newObjectState(%d, %d, %s, %s)", setupID, pos, bitmap, zbitmap);
 #endif
 	// object = scene.addObjectState;
 	// lua_pushusertag(object, object_tag);

Index: objectstate.h
===================================================================
RCS file: /cvsroot/scummvm/residual/objectstate.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- objectstate.h	19 Mar 2004 12:33:09 -0000	1.1
+++ objectstate.h	22 Mar 2004 08:51:54 -0000	1.2
@@ -9,5 +9,12 @@
 
 class ObjectState {
 	public:
+	enum Position {
+		OBJSTATE_UNDERLAY = 1,
+		OBJSTATE_OVERLAY = 2,
+		OBJSTATE_STATE = 3
+	};
 };
+
+
 #endif





More information about the Scummvm-git-logs mailing list