22 #ifndef GRIM_LUABASE_H 23 #define GRIM_LUABASE_H 25 #include "common/str.h" 26 #include "common/list.h" 28 #include "engines/grim/color.h" 32 typedef uint32 lua_Object;
39 class PrimitiveObject;
41 class TextObjectDefaults;
42 class TextObjectCommon;
48 #define DECLARE_LUA_OPCODE(func) \ 50 inline static void static_##func() {\ 51 static_cast<LuaClass *>(LuaBase::instance())->func();\ 58 #define LUA_OPCODE(class, func) \ 64 void lua_PatchGrimSave();
74 void add(
float number);
77 void add(
const char *str);
84 void pushObjects()
const;
113 inline static LuaBase *instance() {
return s_instance; }
115 int dofile(
const char *filename);
117 virtual bool findCostume(lua_Object costumeObj,
Actor *actor,
Costume **costume);
118 virtual Common::String parseMsgText(
const char *msg,
char *msgId);
119 virtual void parseSayLineTable(lua_Object paramObj,
bool *background,
int *vol,
int *pan,
float *x,
float *y);
120 virtual void setTextObjectParams(
TextObjectCommon *textObject, lua_Object tableObj);
122 void update(
int frameTime,
int movieTime);
123 void setFrameTime(
float frameTime);
124 void setMovieTime(
float movieTime);
125 virtual void registerLua();
126 virtual void registerOpcodes();
127 virtual void loadSystemScript();
129 virtual void postRestoreHandle() { }
132 virtual void forceDemo();
139 bool callback(
const char *name);
146 bool callback(
const char *name,
const LuaObjects &objects);
149 bool getbool(
int num);
150 void pushbool(
bool val);
152 int getobject(lua_Object obj);
153 Actor *getactor(lua_Object obj);
154 Bitmap *getbitmap(lua_Object obj);
156 Font *getfont(lua_Object obj);
157 Color getcolor(lua_Object obj);
163 int _translationMode;
165 DECLARE_LUA_OPCODE(dummyHandler);
166 DECLARE_LUA_OPCODE(typeOverride);
167 DECLARE_LUA_OPCODE(concatFallback);
170 unsigned int _frameTimeCollection;
174 int refOldConcatFallback;
177 int refTextObjectFont;
178 int refTextObjectWidth;
179 int refTextObjectHeight;
180 int refTextObjectFGColor;
181 int refTextObjectBGColor;
182 int refTextObjectFXColor;
183 int refTextObjectHIColor;
184 int refTextObjectDuration;
185 int refTextObjectCenter;
186 int refTextObjectLJustify;
187 int refTextObjectRJustify;
188 int refTextObjectVolume;
189 int refTextObjectBackground;
190 int refTextObjectPan;
191 int refTextObjectLayer;
192 int refTextObjectCoords;
A list of arguments to be passed to a Lua function.
Definition: lua.h:72
Definition: objectstate.h:34
Definition: textobject.h:84
Definition: textobject.h:35
Definition: primitives.h:34
Actor represents a 3D character on screen.
Definition: actor.h:72