[Scummvm-cvs-logs] CVS: residual lua.cpp,1.66,1.67

Jonathan Gray khalek at users.sourceforge.net
Fri Jun 4 12:09:02 CEST 2004


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

Modified Files:
	lua.cpp 
Log Message:
add disabled key stub to BlastText, add default value for system.frameTime (0), add GetTextCharPosition stub which lets the F1 menus work, they just aren't drawn as BlastText/Display/et cetera aren't implemented

Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- lua.cpp	4 Jun 2004 15:12:16 -0000	1.66
+++ lua.cpp	4 Jun 2004 19:08:16 -0000	1.67
@@ -1161,6 +1161,14 @@
 	g_smush->pause(lua_isnil(lua_getparam(1)) != 0);
 }
 
+
+static void GetTextCharPosition() {
+	warning("STUB GetTextCharPosition(\"%s\", %d)", 
+			lua_getstring(lua_getparam(1)), lua_getnumber(lua_getparam(2)));
+
+	lua_pushnumber(0);
+}
+
 // Objectstate functions
 static void NewObjectState() {
 	enum ObjectPosition {
@@ -1266,6 +1274,8 @@
 			lua_getresult(2);
 		else if (strstr(key_text, "center")) // TRUE or FALSE
 			lua_getresult(2);
+		else if (strstr(key_text, "disabled")) // TRUE or FALSE
+			lua_getresult(2);
 		else
 			error("Unknown BlastText key %s\n", key_text);
 	}
@@ -1394,7 +1404,6 @@
 	"EngineDisplay",
 	"SetOffscreenTextPos",
 	"SetEmergencyFont",
-	"GetTextCharPosition",
 	"GetTranslationMode",
 	"SetTranslationMode",
 	"ExpireText",
@@ -1411,6 +1420,14 @@
 	"print_stack",
 };
 
+// Entries in the system table
+static struct {
+	char *name;
+	int key;
+} system_defaults[] = {
+	{ "frameTime", 0 }
+};
+
 // Entries in the system.controls table
 
 static struct {
@@ -1663,6 +1680,7 @@
 	{ "FreeObjectState", FreeObjectState },
 	{ "GetSpeechMode", GetSpeechMode },
 	{ "SetSpeechMode", SetSpeechMode },
+	{ "GetTextCharPosition", GetTextCharPosition },
 	{ "Is3DHardwareEnabled", Is3DHardwareEnabled }
 };
 
@@ -1687,6 +1705,13 @@
 	lua_pushobject(system_table);
 	lua_setglobal("system");
 
+	for (unsigned i = 0; i < sizeof(system_defaults) / sizeof(system_defaults[0]); i++) {
+		lua_pushobject(system_table);
+		lua_pushstring(system_defaults[i].name);
+		lua_pushnumber(system_defaults[i].key);
+		lua_settable();
+	}
+	
 	// Create and populate system.controls table
 	lua_Object controls_table = lua_createtable();
 	lua_pushobject(system_table);





More information about the Scummvm-git-logs mailing list