aboutsummaryrefslogtreecommitdiff
path: root/builtin/profiler/reporter.lua
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-01-21 19:30:42 +0100
committerGitHub <noreply@github.com>2017-01-21 19:30:42 +0100
commit6d5a40713347424084af8ba04e76278961506881 (patch)
tree30b9f000b57aa8e65d2b8a59fe004cb766ce2768 /builtin/profiler/reporter.lua
parentbc29e03b597be350fa856b1ae3d8623778a808b3 (diff)
downloadminetest-6d5a40713347424084af8ba04e76278961506881.tar.gz
minetest-6d5a40713347424084af8ba04e76278961506881.tar.bz2
minetest-6d5a40713347424084af8ba04e76278961506881.zip
Add show_statusline_on_connect setting (#5084)
Add show_statusline_on_connect setting
Diffstat (limited to 'builtin/profiler/reporter.lua')
0 files changed, 0 insertions, 0 deletions
se for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "scripting_mainmenu.h" #include "mods.h" #include "cpp_api/s_internal.h" #include "lua_api/l_base.h" #include "lua_api/l_mainmenu.h" #include "lua_api/l_sound.h" #include "lua_api/l_util.h" #include "lua_api/l_settings.h" extern "C" { #include "lualib.h" } #define MAINMENU_NUM_ASYNC_THREADS 4 MainMenuScripting::MainMenuScripting(GUIEngine* guiengine) { setGuiEngine(guiengine); SCRIPTAPI_PRECHECKHEADER lua_getglobal(L, "core"); int top = lua_gettop(L); lua_newtable(L); lua_setglobal(L, "gamedata"); // Initialize our lua_api modules initializeModApi(L, top); lua_pop(L, 1); // Push builtin initialization type lua_pushstring(L, "mainmenu"); lua_setglobal(L, "INIT"); infostream << "SCRIPTAPI: Initialized main menu modules" << std::endl; } /******************************************************************************/ void MainMenuScripting::initializeModApi(lua_State *L, int top) { registerLuaClasses(L, top); // Initialize mod API modules ModApiMainMenu::Initialize(L, top); ModApiUtil::Initialize(L, top); ModApiSound::Initialize(L, top); asyncEngine.registerStateInitializer(registerLuaClasses); asyncEngine.registerStateInitializer(ModApiMainMenu::InitializeAsync); asyncEngine.registerStateInitializer(ModApiUtil::InitializeAsync); // Initialize async environment //TODO possibly make number of async threads configurable asyncEngine.initialize(MAINMENU_NUM_ASYNC_THREADS); } /******************************************************************************/ void MainMenuScripting::registerLuaClasses(lua_State *L, int top) { LuaSettings::Register(L); } /******************************************************************************/ void MainMenuScripting::step() { asyncEngine.step(getStack()); } /******************************************************************************/ unsigned int MainMenuScripting::queueAsync(const std::string &serialized_func, const std::string &serialized_param) { return asyncEngine.queueAsyncJob(serialized_func, serialized_param); }