aboutsummaryrefslogtreecommitdiff
path: root/src/client/tile.h
Commit message (Expand)AuthorAge
* Use Irrlicht functions to query npot texture supportsfan52021-05-05
* Bump animation frame count from u8 to u16 (#10054)Lars Müller2020-07-10
* Remove std::shared_ptr use in TileLayer (#10090)sfan52020-07-10
* Make shading of CAOs optional (#10033)Danila Shutov2020-06-16
* Textures: Load base pack only as last fallback (#8974)SmallJoker2019-09-29
* Unify GLES support in gui scaling filtersfan52019-08-04
* Unify OpenGL ES supportsfan52019-08-04
* Require 'waving = 3' in a nodedef to apply the liquid waving shader (#8418)Paramat2019-03-27
* Software inventorycube (#7651)Vitaliy2018-09-29
* Some minor Fastface optimizations. (#7628)lhofhansl2018-08-08
* Android build fixes for c++11stujones112018-03-11
* Drop texture file list cache (#6660)Vitaliy2018-03-10
* Include alpha channel reference in MaterialTypeParamstujones112018-02-08
* Load files from subfolders in texturepacksnumber Zero2017-11-17
* Real global textures (#6105)Vitaliy2017-10-15
* Code modernization: subfolders (#6283)Loïc Blot2017-08-19
* C++ modernize: Pragma once (#6264)Loïc Blot2017-08-17
* Modernize client code (#6250)Loïc Blot2017-08-15
* TileLayer: use shared_ptr for FrameSpec vector (#6171)Loïc Blot2017-07-26
* Irrlicht cleanup: cleanup various object to use RenderingEngine (#6088)Loïc Blot2017-07-02
* Tile material: Add 'TILE_MATERIAL_OPAQUE', use for drawtype 'NDT_NORMAL'stujones112017-07-01
* Isolate irrlicht references and use a singleton (#6041)Loïc Blot2017-06-26
* C++11 cleanup on constructors dir client (#6012)Vincent Glize2017-06-21
* Remove threads.h and replace its definitions with their C++11 equivalents (#5...ShadowNinja2017-06-11
* Reorder TileLayer. (#5638)Auke Kok2017-04-29
* Soft node overlay (#5186)Dániel Juhász2017-04-21
* Reorder TileSpec. (#5591)Auke Kok2017-04-18
* Hardware coloring for itemstacksDániel Juhász2017-04-08
* Add hardware node coloring. Includes:Dániel Juhász2017-01-23
* Move TileAnimation code to seperate filesfan52017-01-02
* v2d & aabbox3d<f32> & sky cleanupsnerzhul2016-02-11
* tileable flags are needed also without shaders because of filtersRealBadAngel2015-08-20
* Remove use of engine sent texture tiling flags - theyre no longer neededRealBadAngel2015-08-20
* Fix tiling issues for PLANTLIKE and FIRELIKE with FSAARealBadAngel2015-08-05
* Add wielded (and CAOs) shaderRealBadAngel2015-07-21
* Fix relief mapping issuesRealBadAngel2015-07-16
* Add minimap featureRealBadAngel2015-06-27
* Clean scaling pre-filter for formspec/HUD.Aaron Suen2015-04-01
* Move texture_min_size even further down the pipe. Now, textures are JIT-upsca...Aaron Suen2015-03-31
* Replace std::list to std::vector into tile.cpp (m_texture_trash) and move til...Loic Blot2015-03-05
span class="hl slc">// Get registered shutdown hooks lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_shutdown"); // Call callbacks runCallbacks(0, RUN_CALLBACKS_MODE_FIRST); } bool ScriptApiClient::on_sending_message(const std::string &message) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_chat_messages lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_sending_chat_message"); // Call callbacks lua_pushstring(L, message.c_str()); runCallbacks(1, RUN_CALLBACKS_MODE_OR_SC); return readParam<bool>(L, -1); } bool ScriptApiClient::on_receiving_message(const std::string &message) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_chat_messages lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_receiving_chat_message"); // Call callbacks lua_pushstring(L, message.c_str()); runCallbacks(1, RUN_CALLBACKS_MODE_OR_SC); return readParam<bool>(L, -1); } void ScriptApiClient::on_damage_taken(int32_t damage_amount) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_chat_messages lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_damage_taken"); // Call callbacks lua_pushinteger(L, damage_amount); runCallbacks(1, RUN_CALLBACKS_MODE_OR_SC); } void ScriptApiClient::on_hp_modification(int32_t newhp) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_chat_messages lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_hp_modification"); // Call callbacks lua_pushinteger(L, newhp); runCallbacks(1, RUN_CALLBACKS_MODE_OR_SC); } void ScriptApiClient::on_death() { SCRIPTAPI_PRECHECKHEADER // Get registered shutdown hooks lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_death"); // Call callbacks runCallbacks(0, RUN_CALLBACKS_MODE_FIRST); } void ScriptApiClient::environment_step(float dtime) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_globalsteps lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_globalsteps"); // Call callbacks lua_pushnumber(L, dtime); try { runCallbacks(1, RUN_CALLBACKS_MODE_FIRST); } catch (LuaError &e) { getClient()->setFatalError(std::string("Client environment_step: ") + e.what() + "\n" + script_get_backtrace(L)); } } void ScriptApiClient::on_formspec_input(const std::string &formname, const StringMap &fields) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_chat_messages lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_formspec_input"); // Call callbacks // param 1 lua_pushstring(L, formname.c_str()); // param 2 lua_newtable(L); StringMap::const_iterator it; for (it = fields.begin(); it != fields.end(); ++it) { const std::string &name = it->first; const std::string &value = it->second; lua_pushstring(L, name.c_str()); lua_pushlstring(L, value.c_str(), value.size()); lua_settable(L, -3); } runCallbacks(2, RUN_CALLBACKS_MODE_OR_SC); } bool ScriptApiClient::on_dignode(v3s16 p, MapNode node) { SCRIPTAPI_PRECHECKHEADER const NodeDefManager *ndef = getClient()->ndef(); // Get core.registered_on_dignode lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_dignode"); // Push data push_v3s16(L, p); pushnode(L, node, ndef); // Call functions runCallbacks(2, RUN_CALLBACKS_MODE_OR); return lua_toboolean(L, -1); } bool ScriptApiClient::on_punchnode(v3s16 p, MapNode node) { SCRIPTAPI_PRECHECKHEADER const NodeDefManager *ndef = getClient()->ndef(); // Get core.registered_on_punchgnode lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_punchnode"); // Push data push_v3s16(L, p); pushnode(L, node, ndef); // Call functions runCallbacks(2, RUN_CALLBACKS_MODE_OR); return readParam<bool>(L, -1); } bool ScriptApiClient::on_placenode(const PointedThing &pointed, const ItemDefinition &item) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_placenode lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_placenode"); // Push data push_pointed_thing(L, pointed, true); push_item_definition(L, item); // Call functions runCallbacks(2, RUN_CALLBACKS_MODE_OR); return readParam<bool>(L, -1); } bool ScriptApiClient::on_item_use(const ItemStack &item, const PointedThing &pointed) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_item_use lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_item_use"); // Push data LuaItemStack::create(L, item); push_pointed_thing(L, pointed, true); // Call functions runCallbacks(2, RUN_CALLBACKS_MODE_OR); return readParam<bool>(L, -1); } bool ScriptApiClient::on_inventory_open(Inventory *inventory) { SCRIPTAPI_PRECHECKHEADER lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_inventory_open"); std::vector<const InventoryList*> lists = inventory->getLists(); std::vector<const InventoryList*>::iterator iter = lists.begin(); lua_createtable(L, 0, lists.size()); for (; iter != lists.end(); iter++) { const char* name = (*iter)->getName().c_str(); lua_pushstring(L, name); push_inventory_list(L, inventory, name); lua_rawset(L, -3); } runCallbacks(1, RUN_CALLBACKS_MODE_OR); return readParam<bool>(L, -1); } void ScriptApiClient::setEnv(ClientEnvironment *env) { ScriptApiBase::setEnv(env); }