From 5bb58a2e08721ad69df30f5b10af6fef46a4b0d3 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Mon, 19 Oct 2009 22:53:57 +0200 Subject: Split out crawl_lib from dlua.cc. Also fix error in previous commit. --- crawl-ref/source/dlua.cc | 49 +----------------------------------------------- 1 file changed, 1 insertion(+), 48 deletions(-) (limited to 'crawl-ref/source/dlua.cc') diff --git a/crawl-ref/source/dlua.cc b/crawl-ref/source/dlua.cc index 7d26c87d24..769a5b1752 100644 --- a/crawl-ref/source/dlua.cc +++ b/crawl-ref/source/dlua.cc @@ -1,5 +1,5 @@ /* - * File: luadgn.cc + * File: dlua.cc * Summary: Dungeon-builder Lua interface. * Created by: dshaligram on Sat Jun 23 20:02:09 2007 UTC */ @@ -23,7 +23,6 @@ #include "hiscores.h" #include "initfile.h" #include "items.h" -#include "l_los.h" #include "los.h" #include "mapdef.h" #include "mapmark.h" @@ -320,52 +319,6 @@ std::string dlua_chunk::get_chunk_prefix(const std::string &sorig) const return rewrite_chunk_prefix(sorig, true); } -LUAFN(_crawl_args) -{ - return dlua_stringtable(ls, SysEnv.cmd_args); -} - -LUAFN(_crawl_milestone) -{ -#ifdef DGL_MILESTONES - mark_milestone(luaL_checkstring(ls, 1), - luaL_checkstring(ls, 2)); -#endif - return (0); -} - -LUAFN(_crawl_redraw_view) -{ - viewwindow(true, false); - return (0); -} - -#ifdef UNIX -LUAFN(_crawl_millis) -{ - struct timeval tv; - struct timezone tz; - const int error = gettimeofday(&tv, &tz); - if (error) - luaL_error(ls, make_stringf("Failed to get time: %s", - strerror(error)).c_str()); - - lua_pushnumber(ls, tv.tv_sec * 1000 + tv.tv_usec / 1000); - return (1); -} -#endif - -static const struct luaL_reg crawl_lib[] = -{ - { "args", _crawl_args }, - { "mark_milestone", _crawl_milestone }, - { "redraw_view", _crawl_redraw_view }, -#ifdef UNIX - { "millis", _crawl_millis }, -#endif - { NULL, NULL } -}; - static int file_marshall(lua_State *ls) { if (lua_gettop(ls) != 2) -- cgit v1.2.3-54-g00ecf