From e4018b3ebf7d7e14787a04420014acf581d69978 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Tue, 20 Oct 2009 11:19:41 +0200 Subject: Split debug lua bindings out to new library "debug". --- crawl-ref/source/l_dgn.cc | 66 ----------------------------------------------- 1 file changed, 66 deletions(-) (limited to 'crawl-ref/source/l_dgn.cc') diff --git a/crawl-ref/source/l_dgn.cc b/crawl-ref/source/l_dgn.cc index fc34cee72c..3555c541b8 100644 --- a/crawl-ref/source/l_dgn.cc +++ b/crawl-ref/source/l_dgn.cc @@ -6,13 +6,10 @@ #include #include "branch.h" -#include "chardump.h" #include "cloud.h" #include "initfile.h" #include "mapmark.h" #include "maps.h" -#include "message.h" -#include "place.h" #include "spl-util.h" #include "view.h" @@ -100,47 +97,6 @@ static int dgn_depth(lua_State *ls) return dgn_depth_proc(ls, map->depths, 2); } -// WARNING: This is a very low-level call. -LUAFN(dgn_dbg_goto_place) -{ - try - { - const level_id id = level_id::parse_level_id(luaL_checkstring(ls, 1)); - you.level_type = id.level_type; - if (id.level_type == LEVEL_DUNGEON) - { - you.where_are_you = static_cast(id.branch); - you.your_level = absdungeon_depth(id.branch, id.depth); - } - } - catch (const std::string &err) - { - luaL_error(ls, err.c_str()); - } - return (0); -} - -LUAFN(dgn_dbg_flush_map_memory) -{ - dgn_flush_map_memory(); - init_level_connectivity(); - return (0); -} - -LUAFN(dgn_dbg_generate_level) -{ - no_messages mx; - env.show.init(0); - env.map.init(map_cell()); -#ifdef USE_TILE - tile_init_default_flavour(); - tile_clear_flavour(); - TileNewLevel(true); -#endif - builder(you.your_level, you.level_type); - return (0); -} - static int dgn_place(lua_State *ls) { MAP(ls, 1, map); @@ -1533,32 +1489,10 @@ LUAFN(_dgn_reuse_map) return (0); } -LUAFN(dgn_dbg_dump_map) -{ - const int pos = lua_isuserdata(ls, 1) ? 2 : 1; - if (lua_isstring(ls, pos)) - dump_map(lua_tostring(ls, pos), true); - return (0); -} - -LUAFN(dgn_dbg_test_explore) -{ -#ifdef WIZARD - debug_test_explore(); -#endif - return (0); -} - LUAWRAP(_dgn_reset_level, dgn_reset_level()) const struct luaL_reg dgn_lib[] = { -{ "dbg_goto_place", dgn_dbg_goto_place }, -{ "dbg_flush_map_memory", dgn_dbg_flush_map_memory }, -{ "dbg_generate_level", dgn_dbg_generate_level }, -{ "dbg_dump_map", dgn_dbg_dump_map }, -{ "dbg_test_explore", dgn_dbg_test_explore }, - { "reset_level", _dgn_reset_level }, { "default_depth", dgn_default_depth }, -- cgit v1.2.3-54-g00ecf