summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/dlua.cc1
-rw-r--r--crawl-ref/source/enum.h2
-rw-r--r--crawl-ref/source/l_dgn.cc229
-rw-r--r--crawl-ref/source/l_dgngrd.cc245
-rw-r--r--crawl-ref/source/l_libs.h4
-rw-r--r--crawl-ref/source/makefile.obj1
6 files changed, 253 insertions, 229 deletions
diff --git a/crawl-ref/source/dlua.cc b/crawl-ref/source/dlua.cc
index 027537ec84..c5a2b04bb2 100644
--- a/crawl-ref/source/dlua.cc
+++ b/crawl-ref/source/dlua.cc
@@ -309,6 +309,7 @@ void init_dungeon_lua()
luaL_openlib(dlua, "dgn", dgn_lib, 0);
luaL_openlib(dlua, "dgn", dgn_build_lib, 0);
luaL_openlib(dlua, "dgn", dgn_event_lib, 0);
+ luaL_openlib(dlua, "dgn", dgn_grid_lib, 0);
luaL_openlib(dlua, "dgn", dgn_item_lib, 0);
luaL_openlib(dlua, "dgn", dgn_level_lib, 0);
luaL_openlib(dlua, "dgn", dgn_mons_lib, 0);
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 9db5a63bbd..22e0b6e10d 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -983,7 +983,7 @@ enum dungeon_char_type
// vault_grid() for the feature, if you want vault maps to
// be able to use it. If you do, also update
// docs/level_design.txt with the new symbol.
-// * Any: edit luadgn.cc and add the feature's name to the dngn_feature_names
+// * Any: edit l_dgngrd.cc and add the feature's name to the dngn_feature_names
// array, if you want vault map Lua code to be able to use the
// feature, and/or you want to be able to create the feature
// using the "create feature by name" wizard command.
diff --git a/crawl-ref/source/l_dgn.cc b/crawl-ref/source/l_dgn.cc
index 99d33a57b6..fc34cee72c 100644
--- a/crawl-ref/source/l_dgn.cc
+++ b/crawl-ref/source/l_dgn.cc
@@ -19,35 +19,11 @@
///////////////////////////////////////////////////////////////////////////
// Lua dungeon bindings (in the dgn table).
-static dungeon_feature_type _get_lua_feature(lua_State *ls, int idx)
-{
- dungeon_feature_type feat = (dungeon_feature_type)0;
- if (lua_isnumber(ls, idx))
- feat = (dungeon_feature_type)luaL_checkint(ls, idx);
- else if (lua_isstring(ls, idx))
- feat = dungeon_feature_by_name(luaL_checkstring(ls, idx));
- else
- luaL_argerror(ls, idx, "Feature must be a string or a feature index.");
-
- return feat;
-}
-
-dungeon_feature_type check_lua_feature(lua_State *ls, int idx)
-{
- const dungeon_feature_type f = _get_lua_feature(ls, idx);
- if (!f)
- luaL_argerror(ls, idx, "Invalid dungeon feature");
- return (f);
-}
-
static inline bool _lua_boolean(lua_State *ls, int ndx, bool defval)
{
return lua_isnone(ls, ndx)? defval : lua_toboolean(ls, ndx);
}
-#define FEAT(f, pos) \
-dungeon_feature_type f = check_lua_feature(ls, pos)
-
void dgn_reset_default_depth()
{
lc_default_depths.clear();
@@ -639,29 +615,6 @@ static int dgn_welcome(lua_State *ls)
return (0);
}
-static int dgn_grid(lua_State *ls)
-{
- GETCOORD(c, 1, 2, map_bounds);
-
- if (!lua_isnone(ls, 3))
- {
- const dungeon_feature_type feat = _get_lua_feature(ls, 3);
- if (feat)
- grd(c) = feat;
- }
- PLUARET(number, grd(c));
-}
-
-LUARET1(_dgn_is_wall, boolean,
- feat_is_wall(static_cast<dungeon_feature_type>(luaL_checkint(ls, 1))))
-
-static int dgn_max_bounds(lua_State *ls)
-{
- lua_pushnumber(ls, GXM);
- lua_pushnumber(ls, GYM);
- return (2);
-}
-
typedef
flood_find<map_def::map_feature_finder, map_def::map_bounds_check>
map_flood_finder;
@@ -885,105 +838,6 @@ static int dgn_colour_at(lua_State *ls)
PLUARET(string, colour_to_str(env.grid_colours(c)).c_str());
}
-const char *dngn_feature_names[] =
-{
-"unseen", "closed_door", "detected_secret_door", "secret_door",
-"wax_wall", "metal_wall", "green_crystal_wall", "rock_wall", "stone_wall",
-"permarock_wall",
-"clear_rock_wall", "clear_stone_wall", "clear_permarock_wall", "trees",
-"open_sea", "orcish_idol", "", "", "", "", "",
-"granite_statue", "statue_reserved_1", "statue_reserved_2",
-"", "", "", "", "", "", "", "",
-"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
-"", "", "", "", "", "", "", "", "", "", "", "", "", "lava",
-"deep_water", "", "", "shallow_water", "water_stuck", "floor",
-"floor_special", "floor_reserved", "exit_hell", "enter_hell",
-"open_door", "", "", "trap_mechanical", "trap_magical", "trap_natural",
-"undiscovered_trap", "", "enter_shop", "enter_labyrinth",
-"stone_stairs_down_i", "stone_stairs_down_ii",
-"stone_stairs_down_iii", "escape_hatch_down", "stone_stairs_up_i",
-"stone_stairs_up_ii", "stone_stairs_up_iii", "escape_hatch_up", "",
-"", "enter_dis", "enter_gehenna", "enter_cocytus",
-"enter_tartarus", "enter_abyss", "exit_abyss", "stone_arch",
-"enter_pandemonium", "exit_pandemonium", "transit_pandemonium",
-"", "", "", "builder_special_wall", "builder_special_floor", "",
-"", "", "enter_orcish_mines", "enter_hive", "enter_lair",
-"enter_slime_pits", "enter_vaults", "enter_crypt",
-"enter_hall_of_blades", "enter_zot", "enter_temple",
-"enter_snake_pit", "enter_elven_halls", "enter_tomb",
-"enter_swamp", "enter_shoals", "enter_reserved_2",
-"enter_reserved_3", "enter_reserved_4", "", "", "",
-"return_from_orcish_mines", "return_from_hive",
-"return_from_lair", "return_from_slime_pits",
-"return_from_vaults", "return_from_crypt",
-"return_from_hall_of_blades", "return_from_zot",
-"return_from_temple", "return_from_snake_pit",
-"return_from_elven_halls", "return_from_tomb",
-"return_from_swamp", "return_from_shoals", "return_reserved_2",
-"return_reserved_3", "return_reserved_4", "", "", "", "", "", "",
-"", "", "", "", "", "", "", "enter_portal_vault", "exit_portal_vault",
-"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
-"", "", "altar_zin", "altar_shining_one", "altar_kikubaaqudgha",
-"altar_yredelemnul", "altar_xom", "altar_vehumet",
-"altar_okawaru", "altar_makhleb", "altar_sif_muna", "altar_trog",
-"altar_nemelex_xobeh", "altar_elyvilon", "altar_lugonu",
-"altar_beogh", "altar_jiyva", "altar_feawn", "", "", "", "",
-"fountain_blue", "fountain_sparkling", "fountain_blood",
-"dry_fountain_blue", "dry_fountain_sparkling", "dry_fountain_blood",
-"permadry_fountain", "abandoned_shop"
-};
-
-dungeon_feature_type dungeon_feature_by_name(const std::string &name)
-{
- COMPILE_CHECK(ARRAYSZ(dngn_feature_names) == NUM_REAL_FEATURES, c1);
- if (name.empty())
- return (DNGN_UNSEEN);
-
- for (unsigned i = 0; i < ARRAYSZ(dngn_feature_names); ++i)
- if (dngn_feature_names[i] == name)
- return static_cast<dungeon_feature_type>(i);
-
- return (DNGN_UNSEEN);
-}
-
-std::vector<std::string> dungeon_feature_matches(const std::string &name)
-{
- std::vector<std::string> matches;
-
- COMPILE_CHECK(ARRAYSZ(dngn_feature_names) == NUM_REAL_FEATURES, c1);
- if (name.empty())
- return (matches);
-
- for (unsigned i = 0; i < ARRAYSZ(dngn_feature_names); ++i)
- if (strstr(dngn_feature_names[i], name.c_str()))
- matches.push_back(dngn_feature_names[i]);
-
- return (matches);
-}
-
-const char *dungeon_feature_name(dungeon_feature_type rfeat)
-{
- const unsigned feat = rfeat;
-
- if (feat >= ARRAYSZ(dngn_feature_names))
- return (NULL);
-
- return dngn_feature_names[feat];
-}
-
-static int dgn_feature_number(lua_State *ls)
-{
- const std::string &name = luaL_checkstring(ls, 1);
- PLUARET(number, dungeon_feature_by_name(name));
-}
-
-static int dgn_feature_name(lua_State *ls)
-{
- const unsigned feat = luaL_checkint(ls, 1);
- PLUARET(string,
- dungeon_feature_name(static_cast<dungeon_feature_type>(feat)));
-}
-
static int dgn_register_listener(lua_State *ls)
{
unsigned mask = luaL_checkint(ls, 1);
@@ -1039,68 +893,6 @@ static int dgn_num_matching_markers(lua_State *ls)
PLUARET(number, markers.size());
}
-static int dgn_feature_desc(lua_State *ls)
-{
- const dungeon_feature_type feat =
- static_cast<dungeon_feature_type>(luaL_checkint(ls, 1));
- const description_level_type dtype =
- lua_isnumber(ls, 2)?
- static_cast<description_level_type>(luaL_checkint(ls, 2)) :
- description_type_by_name(lua_tostring(ls, 2));
- const bool need_stop = lua_isboolean(ls, 3)? lua_toboolean(ls, 3) : false;
- const std::string s =
- feature_description(feat, NUM_TRAPS, false, dtype, need_stop);
- lua_pushstring(ls, s.c_str());
- return (1);
-}
-
-static int dgn_feature_desc_at(lua_State *ls)
-{
- const description_level_type dtype =
- lua_isnumber(ls, 3)?
- static_cast<description_level_type>(luaL_checkint(ls, 3)) :
- description_type_by_name(lua_tostring(ls, 3));
- const bool need_stop = lua_isboolean(ls, 4)? lua_toboolean(ls, 4) : false;
- const std::string s =
- feature_description(coord_def(luaL_checkint(ls, 1),
- luaL_checkint(ls, 2)),
- false, dtype, need_stop);
- lua_pushstring(ls, s.c_str());
- return (1);
-}
-
-static int dgn_set_feature_desc_short(lua_State *ls)
-{
- const std::string base_name = luaL_checkstring(ls, 1);
- const std::string desc = luaL_checkstring(ls, 2);
-
- if (base_name.empty())
- {
- luaL_argerror(ls, 1, "Base name can't be empty");
- return (0);
- }
-
- set_feature_desc_short(base_name, desc);
-
- return (0);
-}
-
-static int dgn_set_feature_desc_long(lua_State *ls)
-{
- const std::string raw_name = luaL_checkstring(ls, 1);
- const std::string desc = luaL_checkstring(ls, 2);
-
- if (raw_name.empty())
- {
- luaL_argerror(ls, 1, "Raw name can't be empty");
- return (0);
- }
-
- set_feature_desc_long(raw_name, desc);
-
- return (0);
-}
-
static int dgn_terrain_changed(lua_State *ls)
{
dungeon_feature_type type = DNGN_UNSEEN;
@@ -1166,9 +958,7 @@ static int dgn_fixup_stairs(lua_State *ls)
if (new_feat != DNGN_UNSEEN)
{
grd[x][y] = new_feat;
- env.markers.add(
- new map_feature_marker(
- coord_def(x, y),
+ env.markers.add(new map_feature_marker(coord_def(x, y),
new_feat));
}
}
@@ -1457,13 +1247,6 @@ static int dgn_apply_area_cloud(lua_State *ls)
return (0);
}
-LUAFN(_dgn_is_opaque)
-{
- COORDS(c, 1, 2);
- lua_pushboolean(ls, feat_is_opaque(grd(c)));
- return (1);
-}
-
static int _dgn_is_passable(lua_State *ls)
{
COORDS(c, 1, 2);
@@ -1808,9 +1591,6 @@ const struct luaL_reg dgn_lib[] =
{ "kmask", dgn_kmask },
{ "mapsize", dgn_map_size },
-{ "grid", dgn_grid },
-{ "is_wall", _dgn_is_wall },
-{ "max_bounds", dgn_max_bounds },
{ "colour_at", dgn_colour_at },
{ "terrain_changed", dgn_terrain_changed },
@@ -1821,16 +1601,10 @@ const struct luaL_reg dgn_lib[] =
{ "gly_points", dgn_gly_points },
{ "original_map", dgn_original_map },
{ "load_des_file", dgn_load_des_file },
-{ "feature_number", dgn_feature_number },
-{ "feature_name", dgn_feature_name },
{ "register_listener", dgn_register_listener },
{ "remove_listener", dgn_remove_listener },
{ "remove_marker", dgn_remove_marker },
{ "num_matching_markers", dgn_num_matching_markers },
-{ "feature_desc", dgn_feature_desc },
-{ "feature_desc_at", dgn_feature_desc_at },
-{ "set_feature_desc_short", dgn_set_feature_desc_short },
-{ "set_feature_desc_long", dgn_set_feature_desc_long },
{ "change_level_flags", dgn_change_level_flags },
{ "change_branch_flags", dgn_change_branch_flags },
{ "get_floor_colour", dgn_get_floor_colour },
@@ -1843,7 +1617,6 @@ const struct luaL_reg dgn_lib[] =
{ "random_walk", dgn_random_walk },
{ "apply_area_cloud", dgn_apply_area_cloud },
-{ "is_opaque", _dgn_is_opaque },
{ "is_passable", _dgn_is_passable },
{ "register_feature_marker", dgn_register_feature_marker },
diff --git a/crawl-ref/source/l_dgngrd.cc b/crawl-ref/source/l_dgngrd.cc
new file mode 100644
index 0000000000..1b109e7243
--- /dev/null
+++ b/crawl-ref/source/l_dgngrd.cc
@@ -0,0 +1,245 @@
+/*
+ * File: l_dgngrd.cc
+ * Summary: Grid and dungeon_feature_type-related bindings.
+ */
+
+#include "AppHdr.h"
+
+#include "dlua.h"
+#include "l_libs.h"
+
+#include "directn.h"
+#include "terrain.h"
+
+const char *dngn_feature_names[] =
+{
+"unseen", "closed_door", "detected_secret_door", "secret_door",
+"wax_wall", "metal_wall", "green_crystal_wall", "rock_wall", "stone_wall",
+"permarock_wall",
+"clear_rock_wall", "clear_stone_wall", "clear_permarock_wall", "trees",
+"open_sea", "orcish_idol", "", "", "", "", "",
+"granite_statue", "statue_reserved_1", "statue_reserved_2",
+"", "", "", "", "", "", "", "",
+"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
+"", "", "", "", "", "", "", "", "", "", "", "", "", "lava",
+"deep_water", "", "", "shallow_water", "water_stuck", "floor",
+"floor_special", "floor_reserved", "exit_hell", "enter_hell",
+"open_door", "", "", "trap_mechanical", "trap_magical", "trap_natural",
+"undiscovered_trap", "", "enter_shop", "enter_labyrinth",
+"stone_stairs_down_i", "stone_stairs_down_ii",
+"stone_stairs_down_iii", "escape_hatch_down", "stone_stairs_up_i",
+"stone_stairs_up_ii", "stone_stairs_up_iii", "escape_hatch_up", "",
+"", "enter_dis", "enter_gehenna", "enter_cocytus",
+"enter_tartarus", "enter_abyss", "exit_abyss", "stone_arch",
+"enter_pandemonium", "exit_pandemonium", "transit_pandemonium",
+"", "", "", "builder_special_wall", "builder_special_floor", "",
+"", "", "enter_orcish_mines", "enter_hive", "enter_lair",
+"enter_slime_pits", "enter_vaults", "enter_crypt",
+"enter_hall_of_blades", "enter_zot", "enter_temple",
+"enter_snake_pit", "enter_elven_halls", "enter_tomb",
+"enter_swamp", "enter_shoals", "enter_reserved_2",
+"enter_reserved_3", "enter_reserved_4", "", "", "",
+"return_from_orcish_mines", "return_from_hive",
+"return_from_lair", "return_from_slime_pits",
+"return_from_vaults", "return_from_crypt",
+"return_from_hall_of_blades", "return_from_zot",
+"return_from_temple", "return_from_snake_pit",
+"return_from_elven_halls", "return_from_tomb",
+"return_from_swamp", "return_from_shoals", "return_reserved_2",
+"return_reserved_3", "return_reserved_4", "", "", "", "", "", "",
+"", "", "", "", "", "", "", "enter_portal_vault", "exit_portal_vault",
+"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
+"", "", "altar_zin", "altar_shining_one", "altar_kikubaaqudgha",
+"altar_yredelemnul", "altar_xom", "altar_vehumet",
+"altar_okawaru", "altar_makhleb", "altar_sif_muna", "altar_trog",
+"altar_nemelex_xobeh", "altar_elyvilon", "altar_lugonu",
+"altar_beogh", "altar_jiyva", "altar_feawn", "", "", "", "",
+"fountain_blue", "fountain_sparkling", "fountain_blood",
+"dry_fountain_blue", "dry_fountain_sparkling", "dry_fountain_blood",
+"permadry_fountain", "abandoned_shop"
+};
+
+dungeon_feature_type dungeon_feature_by_name(const std::string &name)
+{
+ COMPILE_CHECK(ARRAYSZ(dngn_feature_names) == NUM_REAL_FEATURES, c1);
+ if (name.empty())
+ return (DNGN_UNSEEN);
+
+ for (unsigned i = 0; i < ARRAYSZ(dngn_feature_names); ++i)
+ if (dngn_feature_names[i] == name)
+ return static_cast<dungeon_feature_type>(i);
+
+ return (DNGN_UNSEEN);
+}
+
+std::vector<std::string> dungeon_feature_matches(const std::string &name)
+{
+ std::vector<std::string> matches;
+
+ COMPILE_CHECK(ARRAYSZ(dngn_feature_names) == NUM_REAL_FEATURES, c1);
+ if (name.empty())
+ return (matches);
+
+ for (unsigned i = 0; i < ARRAYSZ(dngn_feature_names); ++i)
+ if (strstr(dngn_feature_names[i], name.c_str()))
+ matches.push_back(dngn_feature_names[i]);
+
+ return (matches);
+}
+
+const char *dungeon_feature_name(dungeon_feature_type rfeat)
+{
+ const unsigned feat = rfeat;
+
+ if (feat >= ARRAYSZ(dngn_feature_names))
+ return (NULL);
+
+ return dngn_feature_names[feat];
+}
+
+static int dgn_feature_number(lua_State *ls)
+{
+ const std::string &name = luaL_checkstring(ls, 1);
+ PLUARET(number, dungeon_feature_by_name(name));
+}
+
+static int dgn_feature_name(lua_State *ls)
+{
+ const unsigned feat = luaL_checkint(ls, 1);
+ PLUARET(string,
+ dungeon_feature_name(static_cast<dungeon_feature_type>(feat)));
+}
+
+static dungeon_feature_type _get_lua_feature(lua_State *ls, int idx)
+{
+ dungeon_feature_type feat = (dungeon_feature_type)0;
+ if (lua_isnumber(ls, idx))
+ feat = (dungeon_feature_type)luaL_checkint(ls, idx);
+ else if (lua_isstring(ls, idx))
+ feat = dungeon_feature_by_name(luaL_checkstring(ls, idx));
+ else
+ luaL_argerror(ls, idx, "Feature must be a string or a feature index.");
+
+ return feat;
+}
+
+dungeon_feature_type check_lua_feature(lua_State *ls, int idx)
+{
+ const dungeon_feature_type f = _get_lua_feature(ls, idx);
+ if (!f)
+ luaL_argerror(ls, idx, "Invalid dungeon feature");
+ return (f);
+}
+
+#define FEAT(f, pos) \
+dungeon_feature_type f = check_lua_feature(ls, pos)
+
+static int dgn_feature_desc(lua_State *ls)
+{
+ const dungeon_feature_type feat =
+ static_cast<dungeon_feature_type>(luaL_checkint(ls, 1));
+ const description_level_type dtype =
+ lua_isnumber(ls, 2)?
+ static_cast<description_level_type>(luaL_checkint(ls, 2)) :
+ description_type_by_name(lua_tostring(ls, 2));
+ const bool need_stop = lua_isboolean(ls, 3)? lua_toboolean(ls, 3) : false;
+ const std::string s =
+ feature_description(feat, NUM_TRAPS, false, dtype, need_stop);
+ lua_pushstring(ls, s.c_str());
+ return (1);
+}
+
+static int dgn_feature_desc_at(lua_State *ls)
+{
+ const description_level_type dtype =
+ lua_isnumber(ls, 3)?
+ static_cast<description_level_type>(luaL_checkint(ls, 3)) :
+ description_type_by_name(lua_tostring(ls, 3));
+ const bool need_stop = lua_isboolean(ls, 4)? lua_toboolean(ls, 4) : false;
+ const std::string s =
+ feature_description(coord_def(luaL_checkint(ls, 1),
+ luaL_checkint(ls, 2)),
+ false, dtype, need_stop);
+ lua_pushstring(ls, s.c_str());
+ return (1);
+}
+
+static int dgn_set_feature_desc_short(lua_State *ls)
+{
+ const std::string base_name = luaL_checkstring(ls, 1);
+ const std::string desc = luaL_checkstring(ls, 2);
+
+ if (base_name.empty())
+ {
+ luaL_argerror(ls, 1, "Base name can't be empty");
+ return (0);
+ }
+
+ set_feature_desc_short(base_name, desc);
+
+ return (0);
+}
+
+static int dgn_set_feature_desc_long(lua_State *ls)
+{
+ const std::string raw_name = luaL_checkstring(ls, 1);
+ const std::string desc = luaL_checkstring(ls, 2);
+
+ if (raw_name.empty())
+ {
+ luaL_argerror(ls, 1, "Raw name can't be empty");
+ return (0);
+ }
+
+ set_feature_desc_long(raw_name, desc);
+
+ return (0);
+}
+
+static int dgn_max_bounds(lua_State *ls)
+{
+ lua_pushnumber(ls, GXM);
+ lua_pushnumber(ls, GYM);
+ return (2);
+}
+
+static int dgn_grid(lua_State *ls)
+{
+ GETCOORD(c, 1, 2, map_bounds);
+
+ if (!lua_isnone(ls, 3))
+ {
+ const dungeon_feature_type feat = _get_lua_feature(ls, 3);
+ if (feat)
+ grd(c) = feat;
+ }
+ PLUARET(number, grd(c));
+}
+
+// XXX: these two shouldn't be so different.
+LUARET1(_dgn_is_wall, boolean,
+ feat_is_wall(static_cast<dungeon_feature_type>(luaL_checkint(ls, 1))))
+
+LUAFN(_dgn_is_opaque)
+{
+ COORDS(c, 1, 2);
+ lua_pushboolean(ls, feat_is_opaque(grd(c)));
+ return (1);
+}
+
+const struct luaL_reg dgn_grid_lib[] =
+{
+{ "feature_number", dgn_feature_number },
+{ "feature_name", dgn_feature_name },
+{ "feature_desc", dgn_feature_desc },
+{ "feature_desc_at", dgn_feature_desc_at },
+{ "set_feature_desc_short", dgn_set_feature_desc_short },
+{ "set_feature_desc_long", dgn_set_feature_desc_long },
+
+{ "grid", dgn_grid },
+{ "is_opaque", _dgn_is_opaque },
+{ "is_wall", _dgn_is_wall },
+{ "max_bounds", dgn_max_bounds },
+
+{ NULL, NULL }
+};
diff --git a/crawl-ref/source/l_libs.h b/crawl-ref/source/l_libs.h
index 030c5fd056..7b1b60ad89 100644
--- a/crawl-ref/source/l_libs.h
+++ b/crawl-ref/source/l_libs.h
@@ -16,6 +16,7 @@ extern const struct luaL_reg crawl_lib[];
extern const struct luaL_reg dgn_lib[];
extern const struct luaL_reg dgn_build_lib[];
extern const struct luaL_reg dgn_event_lib[];
+extern const struct luaL_reg dgn_grid_lib[];
extern const struct luaL_reg dgn_item_lib[];
extern const struct luaL_reg dgn_level_lib[];
extern const struct luaL_reg dgn_mons_lib[];
@@ -51,6 +52,9 @@ void register_builder_funcs(lua_State *ls);
#define COORDS(c, p1, p2) \
GETCOORD(c, p1, p2, in_bounds)
+#define FEAT(f, pos) \
+dungeon_feature_type f = check_lua_feature(ls, pos)
+
#define LEVEL(lev, br, pos) \
const char *level_name = luaL_checkstring(ls, pos); \
level_area_type lev = str_to_level_area_type(level_name); \
diff --git a/crawl-ref/source/makefile.obj b/crawl-ref/source/makefile.obj
index ed01986860..021d731015 100644
--- a/crawl-ref/source/makefile.obj
+++ b/crawl-ref/source/makefile.obj
@@ -42,6 +42,7 @@ l_crawl.o \
l_dgn.o \
l_dgnbld.o \
l_dgnevt.o \
+l_dgngrd.o \
l_dgnit.o \
l_dgnlvl.o \
l_dgnmon.o \