From 95c13516efdf4a8f4fa1331c0a860241e3c3f0f3 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 1 Oct 2009 02:02:57 +0000 Subject: [PATCH] added elapsedTime() git-svn-id: svn://anubis/anaglym/trunk@41 99a6e188-d820-4881-8870-2d33a10e2619 --- ag.cc | 7 +++++++ ag.h | 1 + 2 files changed, 8 insertions(+) diff --git a/ag.cc b/ag.cc index af322e9..50af69d 100644 --- a/ag.cc +++ b/ag.cc @@ -29,6 +29,7 @@ namespace ag { "startFrame", startFrame }, { "endFrame", endFrame }, { "setCamera", setCamera }, + { "elapsedTime", elapsedTime }, { NULL, NULL } }; luaL_register(L, "ag", functions); @@ -188,6 +189,12 @@ namespace ag return g_engine->setCamera(L); } + int elapsedTime(lua_State * L) + { + lua_pushinteger(L, SDL_GetTicks()); + return 1; + } + namespace object { int draw(lua_State * L) diff --git a/ag.h b/ag.h index 4776e76..e146cd9 100644 --- a/ag.h +++ b/ag.h @@ -16,6 +16,7 @@ namespace ag int startFrame(lua_State * L); int endFrame(lua_State * L); int setCamera(lua_State * L); + int elapsedTime(lua_State * L); namespace object {