aboutsummaryrefslogtreecommitdiff
path: root/src/porting.h
Commit message (Expand)AuthorAge
* Fix build on Windowskwolekr2013-02-25
* Fix most walled-off caveskwolekr2013-02-25
* Tune queue limits, some other adjustmentskwolekr2013-02-25
* Add multi-Emerge thread supportkwolekr2013-02-25
* Update Copyright YearsSfan52013-02-24
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
* Add flag string settings, flat map optionkwolekr2013-02-06
* Fix compile under MingWkwolekr2013-01-23
* Fix compile on certain Linux configurations, reduce spawn point heightkwolekr2013-01-21
* Last set of minor cleanupskwolekr2013-01-21
* Optimize headersPerttu Ahola2012-06-17
* Switch the license to be LGPLv2/later, with small parts still remaining as GP...Perttu Ahola2012-06-05
* Initial directory structure reworkPerttu Ahola2012-03-10
* Move images to data/textures and fix some path stuff; hope that installation ...Perttu Ahola2011-11-29
* fixed not finding data dir if installedConstantin Wenger2011-08-12
* Ctrl+C handling on POSIX, some commands for server and other tweakingPerttu Ahola2011-02-15
* some fixes to make compiling on some bsd easierPerttu Ahola2011-02-11
* new texture stuff quite workingPerttu Ahola2011-02-11
* Added a more flexible path system (and fixed some minor stuff)Perttu Ahola2011-01-07
* organizing stuff.Perttu Ahola2010-12-21
* framework for modifying texturesPerttu Ahola2010-12-20
* license stuffPerttu Ahola2010-11-29
* Initial filesPerttu Ahola2010-11-27
span>string text) { SCRIPTAPI_PRECHECKHEADER lua_pushcfunction(L, script_error_handler); int errorhandler = lua_gettop(L); // Get handler function lua_getglobal(L, "engine"); lua_getfield(L, -1, "event_handler"); lua_remove(L, -2); // Remove engine if(lua_isnil(L, -1)) { lua_pop(L, 1); // Pop event_handler return; } luaL_checktype(L, -1, LUA_TFUNCTION); // Call it lua_pushstring(L, text.c_str()); if(lua_pcall(L, 1, 0, errorhandler)) scriptError(); lua_pop(L, 1); // Pop error handler } void ScriptApiMainMenu::handleMainMenuButtons(std::map<std::string, std::string> fields) { SCRIPTAPI_PRECHECKHEADER lua_pushcfunction(L, script_error_handler); int errorhandler = lua_gettop(L); // Get handler function lua_getglobal(L, "engine"); lua_getfield(L, -1, "button_handler"); lua_remove(L, -2); // Remove engine if(lua_isnil(L, -1)) { lua_pop(L, 1); // Pop button handler return; } luaL_checktype(L, -1, LUA_TFUNCTION); // Convert fields to lua table lua_newtable(L); for(std::map<std::string, std::string>::const_iterator i = fields.begin(); i != fields.end(); i++){ const std::string &name = i->first; const std::string &value = i->second; lua_pushstring(L, name.c_str()); lua_pushlstring(L, value.c_str(), value.size()); lua_settable(L, -3); } // Call it if(lua_pcall(L, 1, 0, errorhandler)) scriptError(); lua_pop(L, 1); // Pop error handler }