[Scummvm-cvs-logs] CVS: residual lua.cpp,1.87,1.88
Pawel Kolodziejski
aquadran at users.sourceforge.net
Sat Jan 1 04:43:08 CET 2005
- Previous message: [Scummvm-cvs-logs] CVS: residual Makefile,1.20,1.21 Makefile.cross,1.13,1.14 Makefile.mingw,1.22,1.23 actor.cpp,1.35,1.36 actor.h,1.17,1.18 bitmap.cpp,1.28,1.29 bitmap.h,1.11,1.12 bits.h,1.17,1.18 blocky16.cpp,1.17,1.18 colormap.h,1.5,1.6 costume.cpp,1.21,1.22 costume.h,1.12,1.13 debug.cpp,1.6,1.7 debug.h,1.7,1.8 driver_gl.cpp,1.20,1.21 driver_gl.h,1.11,1.12 engine.cpp,1.52,1.53 engine.h,1.18,1.19 keyframe.cpp,1.8,1.9 lab.cpp,1.12,1.13 lipsynch.cpp,1.4,1.5 lipsynch.h,1.4,1.5 localize.cpp,1.8,1.9 lua.cpp,1.86,1.87 lua.h,1.6,1.7 main.cpp,1.41,1.42 material.cpp,1.11,1.12 material.h,1.7,1.8 matrix3.cpp,1.8,1.9 model.cpp,1.21,1.22 model.h,1.8,1.9 objectstate.h,1.7,1.8 registry.cpp,1.10,1.11 resource.cpp,1.19,1.20 resource.h,1.13,1.14 scene.cpp,1.30,1.31 scene.h,1.20,1.21 screen.cpp,1.16,1.17 smush.cpp,1.57,1.58 smush.h,1.23,1.24 stdafx.h,1.7,1.8 textobject.cpp,1.13,1.14 textobject.h,1.5,1.6 textsplit.cpp,1.9,1.10 timer.cpp,1.11,1.12 walkplane.h,1.10,1.11
- Next message: [Scummvm-cvs-logs] CVS: scummvm/sword2/driver _mouse.cpp,1.37,1.38 d_draw.cpp,1.62,1.63 d_draw.h,1.34,1.35 d_sound.cpp,1.132,1.133 d_sound.h,1.57,1.58 driver96.h,1.73,1.74 menu.cpp,1.29,1.30 menu.h,1.4,1.5 palette.cpp,1.34,1.35 rdwin.cpp,1.48,1.49 render.cpp,1.67,1.68 render.h,1.14,1.15 sprite.cpp,1.44,1.45
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27118
Modified Files:
lua.cpp
Log Message:
cleanup
Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -d -r1.87 -r1.88
--- lua.cpp 1 Jan 2005 12:27:55 -0000 1.87
+++ lua.cpp 1 Jan 2005 12:41:53 -0000 1.88
@@ -36,7 +36,7 @@
#include <SDL_keysym.h>
#include <SDL_keyboard.h>
-static int actor_tag, color_tag, sound_tag, text_tag, vbuffer_tag, object_tag;
+static int actor_tag, color_tag, text_tag, vbuffer_tag, object_tag;
extern Imuse *g_imuse;
@@ -58,12 +58,6 @@
return true;
}
-static inline bool isSound(int num) {
- if (lua_tag(lua_getparam(num)) != sound_tag)
- return false;
- return true;
-}
-
// 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)
@@ -82,13 +76,7 @@
luaL_argerror(num, "color expected");
return static_cast<Color *>(lua_getuserdata(lua_getparam(num)));
}
-/*
-static inline Sound *check_sound(int num) {
- if (lua_tag(lua_getparam(num)) != sound_tag)
- luaL_argerror(num, "sound expected");
- return static_cast<Sound *>(lua_getuserdata(lua_getparam(num)));
-}
-*/
+
static inline int check_int(int num) {
double val = luaL_check_number(num);
@@ -129,8 +117,7 @@
} else {
result = a->findCostume(luaL_check_string(param));
if (result == NULL)
- warning("Actor %s has no costume %s [%s]\n", a->name(),
- lua_getstring(lua_getparam(param)), called_from);
+ warning("Actor %s has no costume %s [%s]\n", a->name(), lua_getstring(lua_getparam(param)), called_from);
}
return result;
}
@@ -176,14 +163,14 @@
break;
default:
{
- if (line == 0)
- sprintf(buf, "main of %.100s", filename);
- else if (line < 0)
- sprintf(buf, "%.100s", filename);
- else {
- sprintf(buf, "function (%.100s:%d)", filename, line);
- filename = NULL;
- }
+ if (line == 0)
+ sprintf(buf, "main of %.100s", filename);
+ else if (line < 0)
+ sprintf(buf, "%.100s", filename);
+ else {
+ sprintf(buf, "function (%.100s:%d)", filename, line);
+ filename = NULL;
+ }
}
}
int curr_line = lua_currentline(lua_getparam(1));
@@ -213,10 +200,7 @@
}
static void MakeColor() {
- Color *c = new Color
- (clamp_color(check_int(1)),
- clamp_color(check_int(2)),
- clamp_color(check_int(3)));
+ Color *c = new Color (clamp_color(check_int(1)), clamp_color(check_int(2)), clamp_color(check_int(3)));
lua_pushusertag(c, color_tag);
}
@@ -290,8 +274,7 @@
if (lua_isnil(lua_getparam(2))) {
chore = -1;
costume = NULL;
- }
- else {
+ } else {
chore = check_int(2);
costume = get_costume(act, 3, "SetActorRestChore");
}
@@ -767,7 +750,7 @@
if (lua_isstring(sectorName)) {
char *name = luaL_check_string(1);
- for (i=0; i<numSectors; i++) {
+ for (i = 0; i < numSectors; i++) {
Sector *sector = g_engine->currScene()->getSectorBase(i);
if (strstr(sector->name(), name)) {
sector->setVisible(visible);
@@ -1040,7 +1023,7 @@
Color *fgColor = NULL;
TextObject *textObject;
- while (1) {
+ for (;;) {
lua_pushobject(table_obj);
if (key_text)
lua_pushobject(key);
@@ -1087,8 +1070,7 @@
textID = lua_getstring(lua_getparam(1));
- for (Engine::TextListType::const_iterator i = g_engine->textsBegin();
- i != g_engine->textsEnd(); i++) {
+ for (Engine::TextListType::const_iterator i = g_engine->textsBegin(); i != g_engine->textsEnd(); i++) {
TextObject *textO = *i;
if (strstr(textO->name(), textID)) {
@@ -1220,9 +1202,7 @@
}
static void GetTextCharPosition() {
- warning("STUB GetTextCharPosition(\"%s\", %d)",
- lua_getstring(lua_getparam(1)), lua_getnumber(lua_getparam(2)));
-
+ warning("STUB GetTextCharPosition(\"%s\", %d)", lua_getstring(lua_getparam(1)), lua_getnumber(lua_getparam(2)));
lua_pushnumber(0);
}
@@ -1314,16 +1294,10 @@
if (lua_tag(lua_getparam(i)) == actor_tag) {
Actor *a = check_actor(i);
fprintf(stderr, "<actor \"%s\">", a->name());
- }
- else if (lua_tag(lua_getparam(i)) == color_tag) {
+ } else if (lua_tag(lua_getparam(i)) == color_tag) {
Color *c = check_color(i);
fprintf(stderr, "<color #%02x%02x%02x>", c->red(), c->green(), c->blue());
- }
- else if (lua_tag(lua_getparam(i)) == sound_tag) {
-// Sound *s = check_sound(i);
-// fprintf(stderr, "<sound %s>", s->filename());
- }
- else
+ } else
fprintf(stderr, "<userdata %p>", lua_getuserdata(lua_getparam(i)));
} else if (lua_isfunction(lua_getparam(i)))
fprintf(stderr, "<function>");
@@ -1348,7 +1322,7 @@
int x = 0, y = 0, height = 0, width = 0;
Color *fgColor = NULL;
- while (1) {
+ for (;;) {
lua_pushobject(table_obj);
if (key_text)
lua_pushobject(key);
@@ -1379,8 +1353,7 @@
error("Unknown BlastText key %s\n", key_text);
}
- warning("STUB: BlastText(\"%s\", x = %d, y = %d)\n",
- g_localizer->localize(str).c_str(), x, y);
+ warning("STUB: BlastText(\"%s\", x = %d, y = %d)\n", g_localizer->localize(str).c_str(), x, y);
}
#define STUB_FUNC(name) static void name() { stubWarning(#name); }
@@ -2072,7 +2045,6 @@
// Create various LUA tags
actor_tag = lua_newtag();
color_tag = lua_newtag();
- 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();
- Previous message: [Scummvm-cvs-logs] CVS: residual Makefile,1.20,1.21 Makefile.cross,1.13,1.14 Makefile.mingw,1.22,1.23 actor.cpp,1.35,1.36 actor.h,1.17,1.18 bitmap.cpp,1.28,1.29 bitmap.h,1.11,1.12 bits.h,1.17,1.18 blocky16.cpp,1.17,1.18 colormap.h,1.5,1.6 costume.cpp,1.21,1.22 costume.h,1.12,1.13 debug.cpp,1.6,1.7 debug.h,1.7,1.8 driver_gl.cpp,1.20,1.21 driver_gl.h,1.11,1.12 engine.cpp,1.52,1.53 engine.h,1.18,1.19 keyframe.cpp,1.8,1.9 lab.cpp,1.12,1.13 lipsynch.cpp,1.4,1.5 lipsynch.h,1.4,1.5 localize.cpp,1.8,1.9 lua.cpp,1.86,1.87 lua.h,1.6,1.7 main.cpp,1.41,1.42 material.cpp,1.11,1.12 material.h,1.7,1.8 matrix3.cpp,1.8,1.9 model.cpp,1.21,1.22 model.h,1.8,1.9 objectstate.h,1.7,1.8 registry.cpp,1.10,1.11 resource.cpp,1.19,1.20 resource.h,1.13,1.14 scene.cpp,1.30,1.31 scene.h,1.20,1.21 screen.cpp,1.16,1.17 smush.cpp,1.57,1.58 smush.h,1.23,1.24 stdafx.h,1.7,1.8 textobject.cpp,1.13,1.14 textobject.h,1.5,1.6 textsplit.cpp,1.9,1.10 timer.cpp,1.11,1.12 walkplane.h,1.10,1.11
- Next message: [Scummvm-cvs-logs] CVS: scummvm/sword2/driver _mouse.cpp,1.37,1.38 d_draw.cpp,1.62,1.63 d_draw.h,1.34,1.35 d_sound.cpp,1.132,1.133 d_sound.h,1.57,1.58 driver96.h,1.73,1.74 menu.cpp,1.29,1.30 menu.h,1.4,1.5 palette.cpp,1.34,1.35 rdwin.cpp,1.48,1.49 render.cpp,1.67,1.68 render.h,1.14,1.15 sprite.cpp,1.44,1.45
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list