Skip to content

Commit

Permalink
add sim.takeSnapshot lua function
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Sep 1, 2017
1 parent be786d8 commit c34b54d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lua/LuaScriptInterface.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions src/lua/LuaScriptInterface.h
Expand Up @@ -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();
Expand Down

0 comments on commit c34b54d

Please sign in to comment.