[Scummvm-cvs-logs] CVS: residual objectstate.h,NONE,1.1 lua.cpp,1.42,1.43
James Brown
ender at users.sourceforge.net
Fri Mar 19 04:43:07 CET 2004
Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16007
Modified Files:
lua.cpp
Added Files:
objectstate.h
Log Message:
Just pop in some temporary stuff as I'm probably about to mangle my local tree :)
--- NEW FILE: objectstate.h ---
#ifndef OSTATE_H
#define OSTATE_H
#include "vector3d.h"
#include "resource.h"
#include <string>
#include <list>
class ObjectState {
public:
};
#endif
Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- lua.cpp 3 Mar 2004 21:43:34 -0000 1.42
+++ lua.cpp 19 Mar 2004 12:33:09 -0000 1.43
@@ -28,15 +28,22 @@
#include "sound.h"
#include "smush.h"
#include "textobject.h"
+#include "objectstate.h"
#include <SDL_keysym.h>
#include <SDL_keyboard.h>
#include <cstdio>
#include <cmath>
-static int actor_tag, color_tag, sound_tag, text_tag, vbuffer_tag;
+static int actor_tag, color_tag, sound_tag, text_tag, vbuffer_tag, object_tag;
// Yaz: we'll need those later on, you'll see why....
+static inline bool isObject(int num) {
+ if(lua_tag(lua_getparam(num)) != object_tag)
+ return false;
+ return true;
+}
+
static inline bool isActor(int num) {
if(lua_tag(lua_getparam(num)) != actor_tag)
return false;
@@ -56,6 +63,11 @@
}
// Helper functions to ensure the arguments we get are what we expect
+static inline ObjectState *check_object(int num) {
+ if (lua_tag(lua_getparam(num)) != object_tag)
+ luaL_argerror(num, "objectstate expected");
+ return static_cast<ObjectState *>(lua_getuserdata(lua_getparam(num)));
+}
static inline Actor *check_actor(int num) {
if (lua_tag(lua_getparam(num)) != actor_tag)
@@ -1042,6 +1054,34 @@
g_smush->pause(lua_isnil(lua_getparam(1)) != 0);
}
+// Objectstate functions
+static void NewObjectState() {
+ ObjectState *object = NULL;
+
+ int setupID = check_int(1); // Setup ID
+ int unk1 = check_int(2); // ??
+ char *bitmap = luaL_check_string(3); // Bitmap
+ char *zbitmap; // Zbuffer Bitmap
+ bool unk2 = getbool(5); // ?
+ int unk3 = 0;
+
+ if (!lua_isnil(lua_getparam(4)))
+ zbitmap = luaL_check_string(4);
+
+ if (!unk2)
+ unk3 = check_int(6); // ?
+
+ warning("Stub: newObjectState(%d, %s, %s)", setupID, bitmap, zbitmap);
+ // object = scene.addObjectState;
+ // lua_pushusertag(object, object_tag);
+}
+
+static void FreeObjectState() {
+ ObjectState *object = check_object(1);
+ warning("State: freeObjectState(...)");
+ //scene.deleteObjectState(object);
+}
+
// Stub function for builtin functions not yet implemented
static void stubWarning() {
@@ -1124,8 +1164,6 @@
"SendObjectToFront",
"SendObjectToBack",
"SetObjectType",
- "FreeObjectState",
- "NewObjectState",
"SetActorShadowValid",
"AddShadowPlane",
"KillActorShadows",
@@ -1476,6 +1514,8 @@
{ "IsMoviePlaying", IsMoviePlaying },
{ "StartFullscreenMovie", StartFullscreenMovie },
{ "IsFullscreenMoviePlaying", IsFullscreenMoviePlaying },
+ { "NewObjectState", NewObjectState },
+ { "FreeObjectState", FreeObjectState }
};
void register_lua() {
@@ -1485,6 +1525,7 @@
sound_tag = lua_newtag(); // Yaz: wasn't found in the original engine, maybe I messed it.
text_tag = lua_newtag();
vbuffer_tag = lua_newtag();
+ object_tag = lua_newtag();
//Yaz: do we really need a garbage collector ?
// Register GC methods
More information about the Scummvm-git-logs
mailing list