diff options
author | Darshan Shaligram <dshaligram@users.sourceforge.net> | 2009-10-30 15:46:55 +0530 |
---|---|---|
committer | Darshan Shaligram <dshaligram@users.sourceforge.net> | 2009-10-31 22:16:46 +0530 |
commit | ad11744e5d49d226fc9c77ed48c3dd8b97921350 (patch) | |
tree | c4334fd1e6b4b052ac93593f9021f12c9f10baac /crawl-ref/source/cluautil.h | |
parent | 23f8631266eac1a7b4b4727b26a5fc088a6f0184 (diff) | |
download | crawl-ref-ad11744e5d49d226fc9c77ed48c3dd8b97921350.tar.gz crawl-ref-ad11744e5d49d226fc9c77ed48c3dd8b97921350.zip |
lmark.synchronized_markers(): apply one marker's effects to multiple points simultaneously.
synchronized_markers() takes a marker, and a list of method names to override,
and returns a set of markers that fire simultaneously, to allow, say, fog
machines that fire at random intervals, but always fire in unison. lm_mslav.lua
has details. volcano.des has an example volcano entry vault that uses this.
Allow fetching a list of Lua markers/marker positions by property value.
Renamed dgn.find_marker_prop -> dgn.find_marker_position_by_prop.
s/helper/listener/ for fog machine listeners.
Diffstat (limited to 'crawl-ref/source/cluautil.h')
-rw-r--r-- | crawl-ref/source/cluautil.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/crawl-ref/source/cluautil.h b/crawl-ref/source/cluautil.h index 8ea98028ee..0f02555750 100644 --- a/crawl-ref/source/cluautil.h +++ b/crawl-ref/source/cluautil.h @@ -57,7 +57,7 @@ void clua_register_metatable(lua_State *ls, const char *tn, const luaL_reg *lr, int (*gcfn)(lua_State *ls) = NULL); -int dlua_stringtable(lua_State *ls, const std::vector<std::string> &s); +int clua_stringtable(lua_State *ls, const std::vector<std::string> &s); /* * User-data templates. @@ -175,4 +175,20 @@ dgn_event *var = *(dgn_event **) luaL_checkudata(ls, n, DEVENT_METATABLE) #define MAPMARKER(ls, n, var) \ map_marker *var = *(map_marker **) luaL_checkudata(ls, n, MAPMARK_METATABLE) + +template <typename list, typename lpush> +static int clua_gentable(lua_State *ls, const list &strings, lpush push) +{ + lua_newtable(ls); + for (int i = 0, size = strings.size(); i < size; ++i) + { + push(ls, strings[i]); + lua_rawseti(ls, -2, i + 1); + } + return (1); +} + +int clua_pushcxxstring(lua_State *ls, const std::string &s); +int clua_pushpoint(lua_State *ls, const coord_def &pos); + #endif |