From c34b54d97404a531e95326089d209b6b1604f578 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Thu, 31 Aug 2017 23:48:00 -0400 Subject: [PATCH] add sim.takeSnapshot lua function --- src/lua/LuaScriptInterface.cpp | 7 +++++++ src/lua/LuaScriptInterface.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index 48758c343..4c4a284dc 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -765,6 +765,7 @@ void LuaScriptInterface::initSimulationAPI() {"neighbors", simulation_neighbours}, {"framerender", simulation_framerender}, {"gspeed", simulation_gspeed}, + {"takeSnapshot", simulation_takeSnapshot}, {NULL, NULL} }; luaL_register(l, "simulation", simulationAPIMethods); @@ -2143,6 +2144,12 @@ int LuaScriptInterface::simulation_gspeed(lua_State * l) return 0; } +int LuaScriptInterface::simulation_takeSnapshot(lua_State * l) +{ + luacon_controller->HistorySnapshot(); + return 0; +} + //// Begin Renderer API void LuaScriptInterface::initRendererAPI() diff --git a/src/lua/LuaScriptInterface.h b/src/lua/LuaScriptInterface.h index e0c679b71..175bd3dba 100644 --- a/src/lua/LuaScriptInterface.h +++ b/src/lua/LuaScriptInterface.h @@ -108,6 +108,7 @@ class LuaScriptInterface: public CommandInterface static int simulation_neighbours(lua_State * l); static int simulation_framerender(lua_State * l); static int simulation_gspeed(lua_State * l); + static int simulation_takeSnapshot(lua_State *l); //Renderer void initRendererAPI();