From 11330c32d7cb733b669aecc1386e6225b3d0c8bb Mon Sep 17 00:00:00 2001 From: Omnistudent Date: Thu, 12 Sep 2013 11:31:38 +0200 Subject: [PATCH] hhh --- client/serverlist/.gitignore | 2 + client/shaders/bumpmaps_liquids/base.txt | 1 + .../bumpmaps_liquids/opengl_fragment.glsl | 46 + .../bumpmaps_liquids/opengl_vertex.glsl | 98 + client/shaders/bumpmaps_solids/base.txt | 1 + .../bumpmaps_solids/opengl_fragment.glsl | 45 + .../bumpmaps_solids/opengl_vertex.glsl | 98 + client/shaders/test_shader_1/base.txt | 1 + .../test_shader_1/opengl_fragment.glsl | 25 + .../shaders/test_shader_1/opengl_vertex.glsl | 58 + client/shaders/test_shader_2/base.txt | 1 + .../test_shader_2/opengl_fragment.glsl | 23 + .../shaders/test_shader_2/opengl_vertex.glsl | 51 + client/shaders/test_shader_3/base.txt | 1 + .../test_shader_3/opengl_fragment.glsl | 25 + .../shaders/test_shader_3/opengl_vertex.glsl | 51 + cmake/Modules/FindCURL.cmake | 42 + cmake/Modules/FindGettextLib.cmake | 72 + cmake/Modules/FindIrrlicht.cmake | 94 + cmake/Modules/FindJson.cmake | 18 + cmake/Modules/FindJthread.cmake | 18 + cmake/Modules/FindOpenGLES2.cmake | 130 + cmake/Modules/FindSqlite3.cmake | 18 + cmake/Modules/FindVorbis.cmake | 46 + cmake/Modules/misc.cmake | 21 + doc/gpl-2.0.txt | 339 + doc/lua_api.txt | 2284 + doc/mapformat.txt | 583 + doc/menu_lua_api.txt | 190 + doc/minetest.6 | 98 + doc/minetestserver.6 | 74 + doc/protocol.txt | 108 + fonts/DroidSansFallbackFull.ttf | Bin 0 -> 4529044 bytes fonts/fontdejavusansmono.png | Bin 0 -> 8511 bytes fonts/fontlucida.png | Bin 0 -> 7719 bytes fonts/liberationmono.ttf | Bin 0 -> 333636 bytes fonts/liberationsans.ttf | Bin 0 -> 133828 bytes games/minimal/game.conf | 2 + games/minimal/menu/background.png | Bin 0 -> 392 bytes games/minimal/menu/icon.png | Bin 0 -> 218 bytes games/minimal/mods/bucket/depends.txt | 2 + games/minimal/mods/bucket/init.lua | 95 + games/minimal/mods/bucket/textures/bucket.png | Bin 0 -> 182 bytes .../mods/bucket/textures/bucket_lava.png | Bin 0 -> 183 bytes .../mods/bucket/textures/bucket_water.png | Bin 0 -> 180 bytes games/minimal/mods/default/init.lua | 1693 + games/minimal/mods/default/mapgen.lua | 137 + .../sounds/default_grass_footstep.1.ogg | Bin 0 -> 7014 bytes .../minimal/mods/default/textures/bubble.png | Bin 0 -> 273 bytes .../mods/default/textures/crack_anylength.png | Bin 0 -> 255 bytes .../mods/default/textures/default_apple.png | Bin 0 -> 109 bytes .../mods/default/textures/default_book.png | Bin 0 -> 157 bytes .../default/textures/default_bookshelf.png | Bin 0 -> 515 bytes .../mods/default/textures/default_brick.png | Bin 0 -> 457 bytes .../default/textures/default_cactus_side.png | Bin 0 -> 144 bytes .../default/textures/default_cactus_top.png | Bin 0 -> 121 bytes .../default/textures/default_chest_front.png | Bin 0 -> 114 bytes .../default/textures/default_chest_lock.png | Bin 0 -> 145 bytes .../default/textures/default_chest_side.png | Bin 0 -> 98 bytes .../default/textures/default_chest_top.png | Bin 0 -> 93 bytes .../mods/default/textures/default_clay.png | Bin 0 -> 318 bytes .../default/textures/default_clay_brick.png | Bin 0 -> 173 bytes .../default/textures/default_clay_lump.png | Bin 0 -> 140 bytes .../mods/default/textures/default_cloud.png | Bin 0 -> 83 bytes .../default/textures/default_coal_lump.png | Bin 0 -> 138 bytes .../mods/default/textures/default_cobble.png | Bin 0 -> 374 bytes .../mods/default/textures/default_dirt.png | Bin 0 -> 1586 bytes .../mods/default/textures/default_fence.png | Bin 0 -> 480 bytes .../textures/default_furnace_fire_bg.png | Bin 0 -> 220 bytes .../textures/default_furnace_fire_fg.png | Bin 0 -> 719 bytes .../textures/default_furnace_front.png | Bin 0 -> 159 bytes .../textures/default_furnace_front_active.png | Bin 0 -> 283 bytes .../default/textures/default_furnace_side.png | Bin 0 -> 125 bytes .../mods/default/textures/default_glass.png | Bin 0 -> 210 bytes .../mods/default/textures/default_grass.png | Bin 0 -> 782 bytes .../textures/default_grass_footsteps.png | Bin 0 -> 771 bytes .../default/textures/default_grass_side.png | Bin 0 -> 878 bytes .../mods/default/textures/default_gravel.png | Bin 0 -> 172 bytes .../default/textures/default_iron_lump.png | Bin 0 -> 140 bytes .../default/textures/default_junglegrass.png | Bin 0 -> 237 bytes .../default/textures/default_jungletree.png | Bin 0 -> 210 bytes .../textures/default_jungletree_top.png | Bin 0 -> 205 bytes .../mods/default/textures/default_ladder.png | Bin 0 -> 368 bytes .../mods/default/textures/default_lava.png | Bin 0 -> 172 bytes .../default_lava_flowing_animated.png | Bin 0 -> 7818 bytes .../textures/default_lava_source_animated.png | Bin 0 -> 2902 bytes .../mods/default/textures/default_leaves.png | Bin 0 -> 1683 bytes .../mods/default/textures/default_mese.png | Bin 0 -> 129 bytes .../default/textures/default_mineral_coal.png | Bin 0 -> 142 bytes .../default/textures/default_mineral_iron.png | Bin 0 -> 922 bytes .../default/textures/default_mossycobble.png | Bin 0 -> 603 bytes .../mods/default/textures/default_nc_back.png | Bin 0 -> 186 bytes .../default/textures/default_nc_front.png | Bin 0 -> 204 bytes .../mods/default/textures/default_nc_rb.png | Bin 0 -> 137 bytes .../mods/default/textures/default_nc_side.png | Bin 0 -> 148 bytes .../mods/default/textures/default_paper.png | Bin 0 -> 139 bytes .../mods/default/textures/default_papyrus.png | Bin 0 -> 165 bytes .../mods/default/textures/default_rail.png | Bin 0 -> 437 bytes .../textures/default_rail_crossing.png | Bin 0 -> 388 bytes .../default/textures/default_rail_curved.png | Bin 0 -> 375 bytes .../textures/default_rail_t_junction.png | Bin 0 -> 374 bytes .../mods/default/textures/default_sand.png | Bin 0 -> 762 bytes .../default/textures/default_sandstone.png | Bin 0 -> 744 bytes .../mods/default/textures/default_sapling.png | Bin 0 -> 328 bytes .../textures/default_scorched_stuff.png | Bin 0 -> 164 bytes .../default/textures/default_sign_wall.png | Bin 0 -> 416 bytes .../default/textures/default_steel_block.png | Bin 0 -> 128 bytes .../default/textures/default_steel_ingot.png | Bin 0 -> 144 bytes .../mods/default/textures/default_stick.png | Bin 0 -> 120 bytes .../mods/default/textures/default_stone.png | Bin 0 -> 389 bytes .../default/textures/default_tnt_bottom.png | Bin 0 -> 98 bytes .../default/textures/default_tnt_side.png | Bin 0 -> 129 bytes .../mods/default/textures/default_tnt_top.png | Bin 0 -> 146 bytes .../textures/default_tool_mesepick.png | Bin 0 -> 155 bytes .../textures/default_tool_steelaxe.png | Bin 0 -> 140 bytes .../textures/default_tool_steelpick.png | Bin 0 -> 163 bytes .../textures/default_tool_steelshovel.png | Bin 0 -> 144 bytes .../textures/default_tool_steelsword.png | Bin 0 -> 169 bytes .../textures/default_tool_stoneaxe.png | Bin 0 -> 141 bytes .../textures/default_tool_stonepick.png | Bin 0 -> 155 bytes .../textures/default_tool_stoneshovel.png | Bin 0 -> 144 bytes .../textures/default_tool_stonesword.png | Bin 0 -> 168 bytes .../default/textures/default_tool_woodaxe.png | Bin 0 -> 134 bytes .../textures/default_tool_woodpick.png | Bin 0 -> 149 bytes .../textures/default_tool_woodshovel.png | Bin 0 -> 135 bytes .../textures/default_tool_woodsword.png | Bin 0 -> 147 bytes .../mods/default/textures/default_torch.png | Bin 0 -> 146 bytes .../textures/default_torch_on_ceiling.png | Bin 0 -> 137 bytes .../textures/default_torch_on_floor.png | Bin 0 -> 138 bytes .../mods/default/textures/default_tree.png | Bin 0 -> 1445 bytes .../default/textures/default_tree_top.png | Bin 0 -> 177 bytes .../mods/default/textures/default_water.png | Bin 0 -> 302 bytes .../mods/default/textures/default_wood.png | Bin 0 -> 1400 bytes games/minimal/mods/default/textures/heart.png | Bin 0 -> 248 bytes .../minimal/mods/default/textures/player.png | Bin 0 -> 157 bytes .../mods/default/textures/player_back.png | Bin 0 -> 149 bytes .../mods/default/textures/treeprop.png | Bin 0 -> 757 bytes .../mods/default/textures/wieldhand.png | Bin 0 -> 212 bytes games/minimal/mods/experimental/depends.txt | 2 + games/minimal/mods/experimental/init.lua | 592 + .../textures/experimental_dummyball.png | Bin 0 -> 399 bytes .../textures/experimental_tester_tool_1.png | Bin 0 -> 160 bytes .../mods/give_initial_stuff/depends.txt | 2 + .../minimal/mods/give_initial_stuff/init.lua | 16 + games/minimal/mods/legacy/depends.txt | 2 + games/minimal/mods/legacy/init.lua | 128 + .../mods/legacy/textures/apple_iron.png | Bin 0 -> 119 bytes .../mods/legacy/textures/cooked_rat.png | Bin 0 -> 145 bytes .../mods/legacy/textures/dungeon_master.png | Bin 0 -> 3007 bytes .../minimal/mods/legacy/textures/fireball.png | Bin 0 -> 279 bytes .../minimal/mods/legacy/textures/firefly.png | Bin 0 -> 99 bytes .../minimal/mods/legacy/textures/oerkki1.png | Bin 0 -> 165 bytes .../mods/legacy/textures/oerkki1_damaged.png | Bin 0 -> 210 bytes games/minimal/mods/legacy/textures/rat.png | Bin 0 -> 141 bytes games/minimal/mods/stairs/depends.txt | 1 + games/minimal/mods/stairs/init.lua | 93 + games/minimal/mods/test/init.lua | 11 + minetest.conf.example | 400 + misc/minetest-icon-24x24.png | Bin 0 -> 587 bytes misc/minetest-icon.ico | Bin 0 -> 9662 bytes misc/minetest-icon.svg | 183 + misc/minetest.desktop | 11 + misc/winresource.rc | 5 + mods/mods_here.txt | 4 + old/ancient_main_comment.txt | 345 + old/changelog.txt | 147 + old/minetest.sln | 20 + old/minetest.vcproj | 424 + po/da/minetest.po | 1058 + po/de/minetest.po | 1049 + po/es/minetest.po | 1046 + po/et/minetest.po | 1051 + po/fr/minetest.po | 1065 + po/hu/minetest.po | 1020 + po/it/minetest.po | 1055 + po/ja/minetest.po | 1058 + po/ko/minetest.po | 940 + po/ky/minetest.po | 1042 + po/minetest.pot | 940 + po/nb/minetest.po | 969 + po/nl/minetest.po | 1050 + po/pl/minetest.po | 1053 + po/pt/minetest.po | 1048 + po/pt_BR/minetest.po | 1063 + po/ro/minetest.po | 940 + po/ru/minetest.po | 1051 + po/uk/minetest.po | 1045 + po/zh_CN/minetest.po | 1050 + src/CMakeLists.txt | 644 + src/activeobject.h | 71 + src/ban.cpp | 165 + src/ban.h | 51 + src/base64.cpp | 131 + src/base64.h | 10 + src/biome.cpp | 205 + src/biome.h | 96 + src/camera.cpp | 637 + src/camera.h | 189 + src/cavegen.cpp | 557 + src/cavegen.h | 118 + src/cguittfont/CGUITTFont.cpp | 1146 + src/cguittfont/CGUITTFont.h | 377 + src/cguittfont/CMakeLists.txt | 17 + src/cguittfont/irrUString.h | 3877 + src/cguittfont/xCGUITTFont.cpp | 5 + src/cguittfont/xCGUITTFont.h | 7 + src/chat.cpp | 769 + src/chat.h | 274 + src/client.cpp | 2988 + src/client.h | 552 + src/clientmap.cpp | 893 + src/clientmap.h | 157 + src/clientobject.cpp | 70 + src/clientobject.h | 122 + src/clientserver.h | 734 + src/clientsimpleobject.h | 38 + src/clouds.cpp | 349 + src/clouds.h | 84 + src/cmake_config.h.in | 24 + src/collision.cpp | 639 + src/collision.h | 104 + src/config.h | 45 + src/connection.cpp | 1707 + src/connection.h | 642 + src/constants.h | 93 + src/content_abm.cpp | 386 + src/content_abm.h | 33 + src/content_cao.cpp | 1832 + src/content_cao.h | 24 + src/content_cso.cpp | 92 + src/content_cso.h | 30 + src/content_mapblock.cpp | 1397 + src/content_mapblock.h | 29 + src/content_mapnode.cpp | 249 + src/content_mapnode.h | 44 + src/content_nodemeta.cpp | 200 + src/content_nodemeta.h | 40 + src/content_object.h | 39 + src/content_sao.cpp | 1535 + src/content_sao.h | 337 + src/convert_json.cpp | 420 + src/convert_json.h | 34 + src/craftdef.cpp | 1078 + src/craftdef.h | 400 + src/database-dummy.cpp | 165 + src/database-dummy.h | 44 + src/database-leveldb.cpp | 173 + src/database-leveldb.h | 49 + src/database-sqlite3.cpp | 330 + src/database-sqlite3.h | 59 + src/database.cpp | 52 + src/database.h | 42 + src/daynightratio.h | 69 + src/debug.cpp | 332 + src/debug.h | 171 + src/defaultsettings.cpp | 298 + src/defaultsettings.h | 29 + src/dungeongen.cpp | 634 + src/dungeongen.h | 128 + src/emerge.cpp | 579 + src/emerge.h | 133 + src/environment.cpp | 2580 + src/environment.h | 510 + src/event.h | 72 + src/event_manager.h | 115 + src/exceptions.h | 184 + src/filecache.cpp | 120 + src/filecache.h | 49 + src/filesys.cpp | 712 + src/filesys.h | 106 + src/game.cpp | 3468 + src/game.h | 146 + src/gamedef.h | 82 + src/genericobject.cpp | 168 + src/genericobject.h | 75 + src/gettext.h | 94 + src/gettime.h | 63 + src/guiChatConsole.cpp | 579 + src/guiChatConsole.h | 132 + src/guiDeathScreen.cpp | 183 + src/guiDeathScreen.h | 60 + src/guiEngine.cpp | 577 + src/guiEngine.h | 298 + src/guiFileSelectMenu.cpp | 127 + src/guiFileSelectMenu.h | 80 + src/guiFormSpecMenu.cpp | 2650 + src/guiFormSpecMenu.h | 369 + src/guiKeyChangeMenu.cpp | 417 + src/guiKeyChangeMenu.h | 79 + src/guiMainMenu.h | 63 + src/guiMessageMenu.cpp | 174 + src/guiMessageMenu.h | 60 + src/guiPasswordChange.cpp | 272 + src/guiPasswordChange.h | 54 + src/guiPauseMenu.cpp | 281 + src/guiPauseMenu.h | 61 + src/guiTextInputMenu.cpp | 230 + src/guiTextInputMenu.h | 56 + src/guiVolumeChange.cpp | 185 + src/guiVolumeChange.h | 53 + src/hex.h | 49 + src/hud.cpp | 477 + src/hud.h | 143 + src/intlGUIEditBox.cpp | 1508 + src/intlGUIEditBox.h | 178 + src/inventory.cpp | 1013 + src/inventory.h | 289 + src/inventorymanager.cpp | 802 + src/inventorymanager.h | 248 + src/irr_aabb3d.h | 30 + src/irr_v2d.h | 34 + src/irr_v3d.h | 32 + src/irrlichttypes.h | 42 + src/irrlichttypes_bloated.h | 32 + src/irrlichttypes_extrabloated.h | 39 + src/itemdef.cpp | 670 + src/itemdef.h | 161 + src/itemgroup.h | 38 + src/json/CMakeLists.txt | 14 + src/json/UPDATING | 16 + src/json/json.h | 1914 + src/json/jsoncpp.cpp | 4367 + src/jthread/CMakeLists.txt | 16 + src/jthread/LICENSE.MIT | 20 + src/jthread/jmutex.h | 132 + src/jthread/jmutexautolock.h | 43 + src/jthread/jthread.h | 78 + src/jthread/pthread/jmutex.cpp | 67 + src/jthread/pthread/jthread.cpp | 185 + src/jthread/win32/jmutex.cpp | 83 + src/jthread/win32/jthread.cpp | 182 + src/keycode.cpp | 363 + src/keycode.h | 69 + src/light.cpp | 326 + src/light.h | 119 + src/localplayer.cpp | 581 + src/localplayer.h | 82 + src/log.cpp | 163 + src/log.h | 78 + src/logoutputbuffer.h | 58 + src/lua/CMakeLists.txt | 114 + src/lua/COPYRIGHT | 34 + src/lua/src/CMakeLists.txt | 63 + src/lua/src/lapi.c | 1087 + src/lua/src/lapi.h | 16 + src/lua/src/lauxlib.c | 652 + src/lua/src/lauxlib.h | 174 + src/lua/src/lbaselib.c | 653 + src/lua/src/lcode.c | 839 + src/lua/src/lcode.h | 76 + src/lua/src/ldblib.c | 397 + src/lua/src/ldebug.c | 638 + src/lua/src/ldebug.h | 33 + src/lua/src/ldo.c | 518 + src/lua/src/ldo.h | 57 + src/lua/src/ldump.c | 164 + src/lua/src/lfunc.c | 174 + src/lua/src/lfunc.h | 34 + src/lua/src/lgc.c | 711 + src/lua/src/lgc.h | 110 + src/lua/src/linit.c | 38 + src/lua/src/liolib.c | 553 + src/lua/src/llex.c | 461 + src/lua/src/llex.h | 81 + src/lua/src/llimits.h | 128 + src/lua/src/lmathlib.c | 263 + src/lua/src/lmem.c | 86 + src/lua/src/lmem.h | 49 + src/lua/src/loadlib.c | 666 + src/lua/src/lobject.c | 214 + src/lua/src/lobject.h | 381 + src/lua/src/lopcodes.c | 102 + src/lua/src/lopcodes.h | 268 + src/lua/src/loslib.c | 243 + src/lua/src/lparser.c | 1339 + src/lua/src/lparser.h | 82 + src/lua/src/lstate.c | 214 + src/lua/src/lstate.h | 169 + src/lua/src/lstring.c | 111 + src/lua/src/lstring.h | 31 + src/lua/src/lstrlib.c | 869 + src/lua/src/ltable.c | 588 + src/lua/src/ltable.h | 40 + src/lua/src/ltablib.c | 287 + src/lua/src/ltm.c | 75 + src/lua/src/ltm.h | 54 + src/lua/src/lua.c | 392 + src/lua/src/lua.h | 388 + src/lua/src/luac.c | 200 + src/lua/src/luaconf.h | 763 + src/lua/src/lualib.h | 53 + src/lua/src/lundump.c | 227 + src/lua/src/lundump.h | 36 + src/lua/src/lvm.c | 763 + src/lua/src/lvm.h | 36 + src/lua/src/lzio.c | 82 + src/lua/src/lzio.h | 67 + src/lua/src/print.c | 227 + src/luaentity_common.h | 30 + src/main.cpp | 1870 + src/main.h | 61 + src/mainmenumanager.h | 141 + src/map.cpp | 4251 + src/map.h | 559 + src/mapblock.cpp | 1110 + src/mapblock.h | 630 + src/mapblock_mesh.cpp | 1462 + src/mapblock_mesh.h | 180 + src/mapchunk.h | 77 + src/mapgen.cpp | 1136 + src/mapgen.h | 307 + src/mapgen_indev.cpp | 398 + src/mapgen_indev.h | 163 + src/mapgen_math.cpp | 368 + src/mapgen_math.h | 68 + src/mapgen_singlenode.cpp | 103 + src/mapgen_singlenode.h | 55 + src/mapgen_v6.cpp | 943 + src/mapgen_v6.h | 171 + src/mapgen_v7.cpp | 718 + src/mapgen_v7.h | 143 + src/mapnode.cpp | 657 + src/mapnode.h | 265 + src/mapsector.cpp | 257 + src/mapsector.h | 138 + src/mesh.cpp | 410 + src/mesh.h | 72 + src/modalMenu.h | 140 + src/modifiedstate.h | 37 + src/mods.cpp | 369 + src/mods.h | 230 + src/nameidmapping.cpp | 51 + src/nameidmapping.h | 82 + src/nodedef.cpp | 997 + src/nodedef.h | 333 + src/nodemetadata.cpp | 193 + src/nodemetadata.h | 117 + src/nodetimer.cpp | 154 + src/nodetimer.h | 91 + src/noise.cpp | 619 + src/noise.h | 166 + src/object_properties.cpp | 152 + src/object_properties.h | 59 + src/particles.cpp | 467 + src/particles.h | 161 + src/pathfinder.cpp | 1084 + src/pathfinder.h | 350 + src/player.cpp | 260 + src/player.h | 330 + src/porting.cpp | 491 + src/porting.h | 248 + src/profiler.h | 235 + src/quicktune.cpp | 106 + src/quicktune.h | 104 + src/quicktune_shortcutter.h | 83 + src/rollback.cpp | 364 + src/rollback.h | 54 + src/rollback_interface.cpp | 416 + src/rollback_interface.h | 156 + src/script/CMakeLists.txt | 19 + src/script/common/CMakeLists.txt | 11 + src/script/common/c_content.cpp | 1090 + src/script/common/c_content.h | 156 + src/script/common/c_converter.cpp | 345 + src/script/common/c_converter.h | 96 + src/script/common/c_internal.cpp | 148 + src/script/common/c_internal.h | 72 + src/script/common/c_types.cpp | 40 + src/script/common/c_types.h | 70 + src/script/cpp_api/CMakeLists.txt | 17 + src/script/cpp_api/s_base.cpp | 279 + src/script/cpp_api/s_base.h | 95 + src/script/cpp_api/s_entity.cpp | 265 + src/script/cpp_api/s_entity.h | 50 + src/script/cpp_api/s_env.cpp | 157 + src/script/cpp_api/s_env.h | 43 + src/script/cpp_api/s_internal.h | 63 + src/script/cpp_api/s_inventory.cpp | 261 + src/script/cpp_api/s_inventory.h | 71 + src/script/cpp_api/s_item.cpp | 167 + src/script/cpp_api/s_item.h | 55 + src/script/cpp_api/s_mainmenu.cpp | 80 + src/script/cpp_api/s_mainmenu.h | 49 + src/script/cpp_api/s_node.cpp | 254 + src/script/cpp_api/s_node.h | 64 + src/script/cpp_api/s_nodemeta.cpp | 259 + src/script/cpp_api/s_nodemeta.h | 67 + src/script/cpp_api/s_player.cpp | 130 + src/script/cpp_api/s_player.h | 47 + src/script/cpp_api/s_server.cpp | 151 + src/script/cpp_api/s_server.h | 52 + src/script/lua_api/CMakeLists.txt | 24 + src/script/lua_api/l_base.cpp | 56 + src/script/lua_api/l_base.h | 62 + src/script/lua_api/l_craft.cpp | 464 + src/script/lua_api/l_craft.h | 50 + src/script/lua_api/l_env.cpp | 819 + src/script/lua_api/l_env.h | 195 + src/script/lua_api/l_internal.h | 43 + src/script/lua_api/l_inventory.cpp | 478 + src/script/lua_api/l_inventory.h | 129 + src/script/lua_api/l_item.cpp | 497 + src/script/lua_api/l_item.h | 135 + src/script/lua_api/l_mainmenu.cpp | 1022 + src/script/lua_api/l_mainmenu.h | 139 + src/script/lua_api/l_mapgen.cpp | 574 + src/script/lua_api/l_mapgen.h | 62 + src/script/lua_api/l_nodemeta.cpp | 332 + src/script/lua_api/l_nodemeta.h | 90 + src/script/lua_api/l_nodetimer.cpp | 167 + src/script/lua_api/l_nodetimer.h | 67 + src/script/lua_api/l_noise.cpp | 415 + src/script/lua_api/l_noise.h | 127 + src/script/lua_api/l_object.cpp | 1170 + src/script/lua_api/l_object.h | 238 + src/script/lua_api/l_particles.cpp | 143 + src/script/lua_api/l_particles.h | 37 + src/script/lua_api/l_rollback.cpp | 80 + src/script/lua_api/l_rollback.h | 37 + src/script/lua_api/l_server.cpp | 347 + src/script/lua_api/l_server.h | 90 + src/script/lua_api/l_settings.cpp | 216 + src/script/lua_api/l_settings.h | 73 + src/script/lua_api/l_util.cpp | 259 + src/script/lua_api/l_util.h | 82 + src/script/lua_api/l_vmanip.cpp | 303 + src/script/lua_api/l_vmanip.h | 69 + src/script/scripting_game.cpp | 101 + src/script/scripting_game.h | 53 + src/script/scripting_mainmenu.cpp | 69 + src/script/scripting_mainmenu.h | 45 + src/serialization.cpp | 269 + src/serialization.h | 91 + src/server.cpp | 5509 + src/server.h | 832 + src/serverlist.cpp | 251 + src/serverlist.h | 47 + src/serverobject.cpp | 102 + src/serverobject.h | 244 + src/settings.h | 968 + src/sha1.cpp | 207 + src/sha1.h | 51 + src/shader.cpp | 780 + src/shader.h | 107 + src/sky.cpp | 511 + src/sky.h | 84 + src/socket.cpp | 572 + src/socket.h | 135 + src/sound.cpp | 25 + src/sound.h | 101 + src/sound_openal.cpp | 550 + src/sound_openal.h | 28 + src/sqlite/CMakeLists.txt | 16 + src/sqlite/sqlite3.c | 128416 +++++++++++++++ src/sqlite/sqlite3.h | 6731 + src/staticobject.cpp | 92 + src/staticobject.h | 105 + src/strfnd.h | 176 + src/subgame.cpp | 251 + src/subgame.h | 105 + src/test.cpp | 2029 + src/test.h | 26 + src/threads.h | 41 + src/tile.cpp | 1691 + src/tile.h | 245 + src/tool.cpp | 214 + src/tool.h | 146 + src/treegen.cpp | 614 + src/treegen.h | 85 + src/util/CMakeLists.txt | 8 + src/util/container.h | 337 + src/util/directiontables.cpp | 101 + src/util/directiontables.h | 34 + src/util/mathconstants.h | 7 + src/util/numeric.cpp | 204 + src/util/numeric.h | 359 + src/util/pointedthing.cpp | 126 + src/util/pointedthing.h | 51 + src/util/pointer.h | 299 + src/util/serialize.cpp | 221 + src/util/serialize.h | 405 + src/util/string.cpp | 138 + src/util/string.h | 326 + src/util/thread.h | 227 + src/util/timetaker.cpp | 62 + src/util/timetaker.h | 54 + src/voxel.cpp | 693 + src/voxel.h | 597 + src/voxelalgorithms.cpp | 157 + src/voxelalgorithms.h | 58 + textures/base/pack/logo.png | Bin 0 -> 12190 bytes textures/base/pack/menu_header.png | Bin 0 -> 133115 bytes textures/base/pack/no_screenshot.png | Bin 0 -> 2446 bytes textures/base/pack/smoke_puff.png | Bin 0 -> 1334 bytes textures/base/pack/sunrisebg.png | Bin 0 -> 4587 bytes textures/base/pack/unknown_item.png | Bin 0 -> 294 bytes textures/base/pack/unknown_node.png | Bin 0 -> 193 bytes textures/base/pack/unknown_object.png | Bin 0 -> 254 bytes textures/texture_packs_here.txt | 1 + util/buildbot/buildwin32.sh | 132 + util/buildbot/toolchain_mingw.cmake | 18 + util/colors.txt | 78 + util/generate-texture-normals.sh | 255 + util/master/index.html | 11 + util/master/list.js | 95 + util/master/master.cgi | 275 + util/master/style.css | 32 + util/minetestmapper.py | 752 + util/sectors2sqlite.py | 132 + util/test_multiplayer.sh | 43 + util/updatepo.sh | 65 + util/wireshark/minetest.lua | 1329 + 612 files changed, 306791 insertions(+) create mode 100644 client/serverlist/.gitignore create mode 100644 client/shaders/bumpmaps_liquids/base.txt create mode 100644 client/shaders/bumpmaps_liquids/opengl_fragment.glsl create mode 100644 client/shaders/bumpmaps_liquids/opengl_vertex.glsl create mode 100644 client/shaders/bumpmaps_solids/base.txt create mode 100644 client/shaders/bumpmaps_solids/opengl_fragment.glsl create mode 100644 client/shaders/bumpmaps_solids/opengl_vertex.glsl create mode 100644 client/shaders/test_shader_1/base.txt create mode 100644 client/shaders/test_shader_1/opengl_fragment.glsl create mode 100644 client/shaders/test_shader_1/opengl_vertex.glsl create mode 100644 client/shaders/test_shader_2/base.txt create mode 100644 client/shaders/test_shader_2/opengl_fragment.glsl create mode 100644 client/shaders/test_shader_2/opengl_vertex.glsl create mode 100644 client/shaders/test_shader_3/base.txt create mode 100644 client/shaders/test_shader_3/opengl_fragment.glsl create mode 100644 client/shaders/test_shader_3/opengl_vertex.glsl create mode 100644 cmake/Modules/FindCURL.cmake create mode 100644 cmake/Modules/FindGettextLib.cmake create mode 100644 cmake/Modules/FindIrrlicht.cmake create mode 100644 cmake/Modules/FindJson.cmake create mode 100644 cmake/Modules/FindJthread.cmake create mode 100644 cmake/Modules/FindOpenGLES2.cmake create mode 100644 cmake/Modules/FindSqlite3.cmake create mode 100644 cmake/Modules/FindVorbis.cmake create mode 100644 cmake/Modules/misc.cmake create mode 100644 doc/gpl-2.0.txt create mode 100644 doc/lua_api.txt create mode 100644 doc/mapformat.txt create mode 100644 doc/menu_lua_api.txt create mode 100644 doc/minetest.6 create mode 100644 doc/minetestserver.6 create mode 100644 doc/protocol.txt create mode 100644 fonts/DroidSansFallbackFull.ttf create mode 100644 fonts/fontdejavusansmono.png create mode 100644 fonts/fontlucida.png create mode 100644 fonts/liberationmono.ttf create mode 100644 fonts/liberationsans.ttf create mode 100644 games/minimal/game.conf create mode 100644 games/minimal/menu/background.png create mode 100644 games/minimal/menu/icon.png create mode 100644 games/minimal/mods/bucket/depends.txt create mode 100644 games/minimal/mods/bucket/init.lua create mode 100644 games/minimal/mods/bucket/textures/bucket.png create mode 100644 games/minimal/mods/bucket/textures/bucket_lava.png create mode 100644 games/minimal/mods/bucket/textures/bucket_water.png create mode 100644 games/minimal/mods/default/init.lua create mode 100644 games/minimal/mods/default/mapgen.lua create mode 100644 games/minimal/mods/default/sounds/default_grass_footstep.1.ogg create mode 100644 games/minimal/mods/default/textures/bubble.png create mode 100644 games/minimal/mods/default/textures/crack_anylength.png create mode 100644 games/minimal/mods/default/textures/default_apple.png create mode 100644 games/minimal/mods/default/textures/default_book.png create mode 100644 games/minimal/mods/default/textures/default_bookshelf.png create mode 100644 games/minimal/mods/default/textures/default_brick.png create mode 100644 games/minimal/mods/default/textures/default_cactus_side.png create mode 100644 games/minimal/mods/default/textures/default_cactus_top.png create mode 100644 games/minimal/mods/default/textures/default_chest_front.png create mode 100644 games/minimal/mods/default/textures/default_chest_lock.png create mode 100644 games/minimal/mods/default/textures/default_chest_side.png create mode 100644 games/minimal/mods/default/textures/default_chest_top.png create mode 100644 games/minimal/mods/default/textures/default_clay.png create mode 100644 games/minimal/mods/default/textures/default_clay_brick.png create mode 100644 games/minimal/mods/default/textures/default_clay_lump.png create mode 100644 games/minimal/mods/default/textures/default_cloud.png create mode 100644 games/minimal/mods/default/textures/default_coal_lump.png create mode 100644 games/minimal/mods/default/textures/default_cobble.png create mode 100644 games/minimal/mods/default/textures/default_dirt.png create mode 100644 games/minimal/mods/default/textures/default_fence.png create mode 100644 games/minimal/mods/default/textures/default_furnace_fire_bg.png create mode 100644 games/minimal/mods/default/textures/default_furnace_fire_fg.png create mode 100644 games/minimal/mods/default/textures/default_furnace_front.png create mode 100644 games/minimal/mods/default/textures/default_furnace_front_active.png create mode 100644 games/minimal/mods/default/textures/default_furnace_side.png create mode 100644 games/minimal/mods/default/textures/default_glass.png create mode 100644 games/minimal/mods/default/textures/default_grass.png create mode 100644 games/minimal/mods/default/textures/default_grass_footsteps.png create mode 100644 games/minimal/mods/default/textures/default_grass_side.png create mode 100644 games/minimal/mods/default/textures/default_gravel.png create mode 100644 games/minimal/mods/default/textures/default_iron_lump.png create mode 100644 games/minimal/mods/default/textures/default_junglegrass.png create mode 100644 games/minimal/mods/default/textures/default_jungletree.png create mode 100644 games/minimal/mods/default/textures/default_jungletree_top.png create mode 100644 games/minimal/mods/default/textures/default_ladder.png create mode 100644 games/minimal/mods/default/textures/default_lava.png create mode 100644 games/minimal/mods/default/textures/default_lava_flowing_animated.png create mode 100644 games/minimal/mods/default/textures/default_lava_source_animated.png create mode 100644 games/minimal/mods/default/textures/default_leaves.png create mode 100644 games/minimal/mods/default/textures/default_mese.png create mode 100644 games/minimal/mods/default/textures/default_mineral_coal.png create mode 100644 games/minimal/mods/default/textures/default_mineral_iron.png create mode 100644 games/minimal/mods/default/textures/default_mossycobble.png create mode 100644 games/minimal/mods/default/textures/default_nc_back.png create mode 100644 games/minimal/mods/default/textures/default_nc_front.png create mode 100644 games/minimal/mods/default/textures/default_nc_rb.png create mode 100644 games/minimal/mods/default/textures/default_nc_side.png create mode 100644 games/minimal/mods/default/textures/default_paper.png create mode 100644 games/minimal/mods/default/textures/default_papyrus.png create mode 100644 games/minimal/mods/default/textures/default_rail.png create mode 100644 games/minimal/mods/default/textures/default_rail_crossing.png create mode 100644 games/minimal/mods/default/textures/default_rail_curved.png create mode 100644 games/minimal/mods/default/textures/default_rail_t_junction.png create mode 100644 games/minimal/mods/default/textures/default_sand.png create mode 100644 games/minimal/mods/default/textures/default_sandstone.png create mode 100644 games/minimal/mods/default/textures/default_sapling.png create mode 100644 games/minimal/mods/default/textures/default_scorched_stuff.png create mode 100644 games/minimal/mods/default/textures/default_sign_wall.png create mode 100644 games/minimal/mods/default/textures/default_steel_block.png create mode 100644 games/minimal/mods/default/textures/default_steel_ingot.png create mode 100644 games/minimal/mods/default/textures/default_stick.png create mode 100644 games/minimal/mods/default/textures/default_stone.png create mode 100644 games/minimal/mods/default/textures/default_tnt_bottom.png create mode 100644 games/minimal/mods/default/textures/default_tnt_side.png create mode 100644 games/minimal/mods/default/textures/default_tnt_top.png create mode 100644 games/minimal/mods/default/textures/default_tool_mesepick.png create mode 100644 games/minimal/mods/default/textures/default_tool_steelaxe.png create mode 100644 games/minimal/mods/default/textures/default_tool_steelpick.png create mode 100644 games/minimal/mods/default/textures/default_tool_steelshovel.png create mode 100644 games/minimal/mods/default/textures/default_tool_steelsword.png create mode 100644 games/minimal/mods/default/textures/default_tool_stoneaxe.png create mode 100644 games/minimal/mods/default/textures/default_tool_stonepick.png create mode 100644 games/minimal/mods/default/textures/default_tool_stoneshovel.png create mode 100644 games/minimal/mods/default/textures/default_tool_stonesword.png create mode 100644 games/minimal/mods/default/textures/default_tool_woodaxe.png create mode 100644 games/minimal/mods/default/textures/default_tool_woodpick.png create mode 100644 games/minimal/mods/default/textures/default_tool_woodshovel.png create mode 100644 games/minimal/mods/default/textures/default_tool_woodsword.png create mode 100644 games/minimal/mods/default/textures/default_torch.png create mode 100644 games/minimal/mods/default/textures/default_torch_on_ceiling.png create mode 100644 games/minimal/mods/default/textures/default_torch_on_floor.png create mode 100644 games/minimal/mods/default/textures/default_tree.png create mode 100644 games/minimal/mods/default/textures/default_tree_top.png create mode 100644 games/minimal/mods/default/textures/default_water.png create mode 100644 games/minimal/mods/default/textures/default_wood.png create mode 100644 games/minimal/mods/default/textures/heart.png create mode 100644 games/minimal/mods/default/textures/player.png create mode 100644 games/minimal/mods/default/textures/player_back.png create mode 100644 games/minimal/mods/default/textures/treeprop.png create mode 100644 games/minimal/mods/default/textures/wieldhand.png create mode 100644 games/minimal/mods/experimental/depends.txt create mode 100644 games/minimal/mods/experimental/init.lua create mode 100644 games/minimal/mods/experimental/textures/experimental_dummyball.png create mode 100644 games/minimal/mods/experimental/textures/experimental_tester_tool_1.png create mode 100644 games/minimal/mods/give_initial_stuff/depends.txt create mode 100644 games/minimal/mods/give_initial_stuff/init.lua create mode 100644 games/minimal/mods/legacy/depends.txt create mode 100644 games/minimal/mods/legacy/init.lua create mode 100644 games/minimal/mods/legacy/textures/apple_iron.png create mode 100644 games/minimal/mods/legacy/textures/cooked_rat.png create mode 100644 games/minimal/mods/legacy/textures/dungeon_master.png create mode 100644 games/minimal/mods/legacy/textures/fireball.png create mode 100644 games/minimal/mods/legacy/textures/firefly.png create mode 100644 games/minimal/mods/legacy/textures/oerkki1.png create mode 100644 games/minimal/mods/legacy/textures/oerkki1_damaged.png create mode 100644 games/minimal/mods/legacy/textures/rat.png create mode 100644 games/minimal/mods/stairs/depends.txt create mode 100644 games/minimal/mods/stairs/init.lua create mode 100644 games/minimal/mods/test/init.lua create mode 100644 minetest.conf.example create mode 100644 misc/minetest-icon-24x24.png create mode 100644 misc/minetest-icon.ico create mode 100644 misc/minetest-icon.svg create mode 100644 misc/minetest.desktop create mode 100644 misc/winresource.rc create mode 100644 mods/mods_here.txt create mode 100644 old/ancient_main_comment.txt create mode 100644 old/changelog.txt create mode 100644 old/minetest.sln create mode 100644 old/minetest.vcproj create mode 100644 po/da/minetest.po create mode 100644 po/de/minetest.po create mode 100644 po/es/minetest.po create mode 100644 po/et/minetest.po create mode 100644 po/fr/minetest.po create mode 100644 po/hu/minetest.po create mode 100644 po/it/minetest.po create mode 100644 po/ja/minetest.po create mode 100644 po/ko/minetest.po create mode 100644 po/ky/minetest.po create mode 100644 po/minetest.pot create mode 100644 po/nb/minetest.po create mode 100644 po/nl/minetest.po create mode 100644 po/pl/minetest.po create mode 100644 po/pt/minetest.po create mode 100644 po/pt_BR/minetest.po create mode 100644 po/ro/minetest.po create mode 100644 po/ru/minetest.po create mode 100644 po/uk/minetest.po create mode 100644 po/zh_CN/minetest.po create mode 100644 src/CMakeLists.txt create mode 100644 src/activeobject.h create mode 100644 src/ban.cpp create mode 100644 src/ban.h create mode 100644 src/base64.cpp create mode 100644 src/base64.h create mode 100644 src/biome.cpp create mode 100644 src/biome.h create mode 100644 src/camera.cpp create mode 100644 src/camera.h create mode 100644 src/cavegen.cpp create mode 100644 src/cavegen.h create mode 100644 src/cguittfont/CGUITTFont.cpp create mode 100644 src/cguittfont/CGUITTFont.h create mode 100644 src/cguittfont/CMakeLists.txt create mode 100644 src/cguittfont/irrUString.h create mode 100644 src/cguittfont/xCGUITTFont.cpp create mode 100644 src/cguittfont/xCGUITTFont.h create mode 100644 src/chat.cpp create mode 100644 src/chat.h create mode 100644 src/client.cpp create mode 100644 src/client.h create mode 100644 src/clientmap.cpp create mode 100644 src/clientmap.h create mode 100644 src/clientobject.cpp create mode 100644 src/clientobject.h create mode 100644 src/clientserver.h create mode 100644 src/clientsimpleobject.h create mode 100644 src/clouds.cpp create mode 100644 src/clouds.h create mode 100644 src/cmake_config.h.in create mode 100644 src/collision.cpp create mode 100644 src/collision.h create mode 100644 src/config.h create mode 100644 src/connection.cpp create mode 100644 src/connection.h create mode 100644 src/constants.h create mode 100644 src/content_abm.cpp create mode 100644 src/content_abm.h create mode 100644 src/content_cao.cpp create mode 100644 src/content_cao.h create mode 100644 src/content_cso.cpp create mode 100644 src/content_cso.h create mode 100644 src/content_mapblock.cpp create mode 100644 src/content_mapblock.h create mode 100644 src/content_mapnode.cpp create mode 100644 src/content_mapnode.h create mode 100644 src/content_nodemeta.cpp create mode 100644 src/content_nodemeta.h create mode 100644 src/content_object.h create mode 100644 src/content_sao.cpp create mode 100644 src/content_sao.h create mode 100644 src/convert_json.cpp create mode 100644 src/convert_json.h create mode 100644 src/craftdef.cpp create mode 100644 src/craftdef.h create mode 100644 src/database-dummy.cpp create mode 100644 src/database-dummy.h create mode 100644 src/database-leveldb.cpp create mode 100644 src/database-leveldb.h create mode 100644 src/database-sqlite3.cpp create mode 100644 src/database-sqlite3.h create mode 100644 src/database.cpp create mode 100644 src/database.h create mode 100644 src/daynightratio.h create mode 100644 src/debug.cpp create mode 100644 src/debug.h create mode 100644 src/defaultsettings.cpp create mode 100644 src/defaultsettings.h create mode 100644 src/dungeongen.cpp create mode 100644 src/dungeongen.h create mode 100644 src/emerge.cpp create mode 100644 src/emerge.h create mode 100644 src/environment.cpp create mode 100644 src/environment.h create mode 100644 src/event.h create mode 100644 src/event_manager.h create mode 100644 src/exceptions.h create mode 100644 src/filecache.cpp create mode 100644 src/filecache.h create mode 100644 src/filesys.cpp create mode 100644 src/filesys.h create mode 100644 src/game.cpp create mode 100644 src/game.h create mode 100644 src/gamedef.h create mode 100644 src/genericobject.cpp create mode 100644 src/genericobject.h create mode 100644 src/gettext.h create mode 100644 src/gettime.h create mode 100644 src/guiChatConsole.cpp create mode 100644 src/guiChatConsole.h create mode 100644 src/guiDeathScreen.cpp create mode 100644 src/guiDeathScreen.h create mode 100644 src/guiEngine.cpp create mode 100644 src/guiEngine.h create mode 100644 src/guiFileSelectMenu.cpp create mode 100644 src/guiFileSelectMenu.h create mode 100644 src/guiFormSpecMenu.cpp create mode 100644 src/guiFormSpecMenu.h create mode 100644 src/guiKeyChangeMenu.cpp create mode 100644 src/guiKeyChangeMenu.h create mode 100644 src/guiMainMenu.h create mode 100644 src/guiMessageMenu.cpp create mode 100644 src/guiMessageMenu.h create mode 100644 src/guiPasswordChange.cpp create mode 100644 src/guiPasswordChange.h create mode 100644 src/guiPauseMenu.cpp create mode 100644 src/guiPauseMenu.h create mode 100644 src/guiTextInputMenu.cpp create mode 100644 src/guiTextInputMenu.h create mode 100644 src/guiVolumeChange.cpp create mode 100644 src/guiVolumeChange.h create mode 100644 src/hex.h create mode 100644 src/hud.cpp create mode 100644 src/hud.h create mode 100644 src/intlGUIEditBox.cpp create mode 100644 src/intlGUIEditBox.h create mode 100644 src/inventory.cpp create mode 100644 src/inventory.h create mode 100644 src/inventorymanager.cpp create mode 100644 src/inventorymanager.h create mode 100644 src/irr_aabb3d.h create mode 100644 src/irr_v2d.h create mode 100644 src/irr_v3d.h create mode 100644 src/irrlichttypes.h create mode 100644 src/irrlichttypes_bloated.h create mode 100644 src/irrlichttypes_extrabloated.h create mode 100644 src/itemdef.cpp create mode 100644 src/itemdef.h create mode 100644 src/itemgroup.h create mode 100644 src/json/CMakeLists.txt create mode 100644 src/json/UPDATING create mode 100644 src/json/json.h create mode 100644 src/json/jsoncpp.cpp create mode 100644 src/jthread/CMakeLists.txt create mode 100644 src/jthread/LICENSE.MIT create mode 100644 src/jthread/jmutex.h create mode 100644 src/jthread/jmutexautolock.h create mode 100644 src/jthread/jthread.h create mode 100644 src/jthread/pthread/jmutex.cpp create mode 100644 src/jthread/pthread/jthread.cpp create mode 100644 src/jthread/win32/jmutex.cpp create mode 100644 src/jthread/win32/jthread.cpp create mode 100644 src/keycode.cpp create mode 100644 src/keycode.h create mode 100644 src/light.cpp create mode 100644 src/light.h create mode 100644 src/localplayer.cpp create mode 100644 src/localplayer.h create mode 100644 src/log.cpp create mode 100644 src/log.h create mode 100644 src/logoutputbuffer.h create mode 100644 src/lua/CMakeLists.txt create mode 100644 src/lua/COPYRIGHT create mode 100644 src/lua/src/CMakeLists.txt create mode 100644 src/lua/src/lapi.c create mode 100644 src/lua/src/lapi.h create mode 100644 src/lua/src/lauxlib.c create mode 100644 src/lua/src/lauxlib.h create mode 100644 src/lua/src/lbaselib.c create mode 100644 src/lua/src/lcode.c create mode 100644 src/lua/src/lcode.h create mode 100644 src/lua/src/ldblib.c create mode 100644 src/lua/src/ldebug.c create mode 100644 src/lua/src/ldebug.h create mode 100644 src/lua/src/ldo.c create mode 100644 src/lua/src/ldo.h create mode 100644 src/lua/src/ldump.c create mode 100644 src/lua/src/lfunc.c create mode 100644 src/lua/src/lfunc.h create mode 100644 src/lua/src/lgc.c create mode 100644 src/lua/src/lgc.h create mode 100644 src/lua/src/linit.c create mode 100644 src/lua/src/liolib.c create mode 100644 src/lua/src/llex.c create mode 100644 src/lua/src/llex.h create mode 100644 src/lua/src/llimits.h create mode 100644 src/lua/src/lmathlib.c create mode 100644 src/lua/src/lmem.c create mode 100644 src/lua/src/lmem.h create mode 100644 src/lua/src/loadlib.c create mode 100644 src/lua/src/lobject.c create mode 100644 src/lua/src/lobject.h create mode 100644 src/lua/src/lopcodes.c create mode 100644 src/lua/src/lopcodes.h create mode 100644 src/lua/src/loslib.c create mode 100644 src/lua/src/lparser.c create mode 100644 src/lua/src/lparser.h create mode 100644 src/lua/src/lstate.c create mode 100644 src/lua/src/lstate.h create mode 100644 src/lua/src/lstring.c create mode 100644 src/lua/src/lstring.h create mode 100644 src/lua/src/lstrlib.c create mode 100644 src/lua/src/ltable.c create mode 100644 src/lua/src/ltable.h create mode 100644 src/lua/src/ltablib.c create mode 100644 src/lua/src/ltm.c create mode 100644 src/lua/src/ltm.h create mode 100644 src/lua/src/lua.c create mode 100644 src/lua/src/lua.h create mode 100644 src/lua/src/luac.c create mode 100644 src/lua/src/luaconf.h create mode 100644 src/lua/src/lualib.h create mode 100644 src/lua/src/lundump.c create mode 100644 src/lua/src/lundump.h create mode 100644 src/lua/src/lvm.c create mode 100644 src/lua/src/lvm.h create mode 100644 src/lua/src/lzio.c create mode 100644 src/lua/src/lzio.h create mode 100644 src/lua/src/print.c create mode 100644 src/luaentity_common.h create mode 100644 src/main.cpp create mode 100644 src/main.h create mode 100644 src/mainmenumanager.h create mode 100644 src/map.cpp create mode 100644 src/map.h create mode 100644 src/mapblock.cpp create mode 100644 src/mapblock.h create mode 100644 src/mapblock_mesh.cpp create mode 100644 src/mapblock_mesh.h create mode 100644 src/mapchunk.h create mode 100644 src/mapgen.cpp create mode 100644 src/mapgen.h create mode 100644 src/mapgen_indev.cpp create mode 100644 src/mapgen_indev.h create mode 100644 src/mapgen_math.cpp create mode 100644 src/mapgen_math.h create mode 100644 src/mapgen_singlenode.cpp create mode 100644 src/mapgen_singlenode.h create mode 100644 src/mapgen_v6.cpp create mode 100644 src/mapgen_v6.h create mode 100644 src/mapgen_v7.cpp create mode 100644 src/mapgen_v7.h create mode 100644 src/mapnode.cpp create mode 100644 src/mapnode.h create mode 100644 src/mapsector.cpp create mode 100644 src/mapsector.h create mode 100644 src/mesh.cpp create mode 100644 src/mesh.h create mode 100644 src/modalMenu.h create mode 100644 src/modifiedstate.h create mode 100644 src/mods.cpp create mode 100644 src/mods.h create mode 100644 src/nameidmapping.cpp create mode 100644 src/nameidmapping.h create mode 100644 src/nodedef.cpp create mode 100644 src/nodedef.h create mode 100644 src/nodemetadata.cpp create mode 100644 src/nodemetadata.h create mode 100644 src/nodetimer.cpp create mode 100644 src/nodetimer.h create mode 100644 src/noise.cpp create mode 100644 src/noise.h create mode 100644 src/object_properties.cpp create mode 100644 src/object_properties.h create mode 100644 src/particles.cpp create mode 100644 src/particles.h create mode 100644 src/pathfinder.cpp create mode 100644 src/pathfinder.h create mode 100644 src/player.cpp create mode 100644 src/player.h create mode 100644 src/porting.cpp create mode 100644 src/porting.h create mode 100644 src/profiler.h create mode 100644 src/quicktune.cpp create mode 100644 src/quicktune.h create mode 100644 src/quicktune_shortcutter.h create mode 100644 src/rollback.cpp create mode 100644 src/rollback.h create mode 100644 src/rollback_interface.cpp create mode 100644 src/rollback_interface.h create mode 100644 src/script/CMakeLists.txt create mode 100644 src/script/common/CMakeLists.txt create mode 100644 src/script/common/c_content.cpp create mode 100644 src/script/common/c_content.h create mode 100644 src/script/common/c_converter.cpp create mode 100644 src/script/common/c_converter.h create mode 100644 src/script/common/c_internal.cpp create mode 100644 src/script/common/c_internal.h create mode 100644 src/script/common/c_types.cpp create mode 100644 src/script/common/c_types.h create mode 100644 src/script/cpp_api/CMakeLists.txt create mode 100644 src/script/cpp_api/s_base.cpp create mode 100644 src/script/cpp_api/s_base.h create mode 100644 src/script/cpp_api/s_entity.cpp create mode 100644 src/script/cpp_api/s_entity.h create mode 100644 src/script/cpp_api/s_env.cpp create mode 100644 src/script/cpp_api/s_env.h create mode 100644 src/script/cpp_api/s_internal.h create mode 100644 src/script/cpp_api/s_inventory.cpp create mode 100644 src/script/cpp_api/s_inventory.h create mode 100644 src/script/cpp_api/s_item.cpp create mode 100644 src/script/cpp_api/s_item.h create mode 100644 src/script/cpp_api/s_mainmenu.cpp create mode 100644 src/script/cpp_api/s_mainmenu.h create mode 100644 src/script/cpp_api/s_node.cpp create mode 100644 src/script/cpp_api/s_node.h create mode 100644 src/script/cpp_api/s_nodemeta.cpp create mode 100644 src/script/cpp_api/s_nodemeta.h create mode 100644 src/script/cpp_api/s_player.cpp create mode 100644 src/script/cpp_api/s_player.h create mode 100644 src/script/cpp_api/s_server.cpp create mode 100644 src/script/cpp_api/s_server.h create mode 100644 src/script/lua_api/CMakeLists.txt create mode 100644 src/script/lua_api/l_base.cpp create mode 100644 src/script/lua_api/l_base.h create mode 100644 src/script/lua_api/l_craft.cpp create mode 100644 src/script/lua_api/l_craft.h create mode 100644 src/script/lua_api/l_env.cpp create mode 100644 src/script/lua_api/l_env.h create mode 100644 src/script/lua_api/l_internal.h create mode 100644 src/script/lua_api/l_inventory.cpp create mode 100644 src/script/lua_api/l_inventory.h create mode 100644 src/script/lua_api/l_item.cpp create mode 100644 src/script/lua_api/l_item.h create mode 100644 src/script/lua_api/l_mainmenu.cpp create mode 100644 src/script/lua_api/l_mainmenu.h create mode 100644 src/script/lua_api/l_mapgen.cpp create mode 100644 src/script/lua_api/l_mapgen.h create mode 100644 src/script/lua_api/l_nodemeta.cpp create mode 100644 src/script/lua_api/l_nodemeta.h create mode 100644 src/script/lua_api/l_nodetimer.cpp create mode 100644 src/script/lua_api/l_nodetimer.h create mode 100644 src/script/lua_api/l_noise.cpp create mode 100644 src/script/lua_api/l_noise.h create mode 100644 src/script/lua_api/l_object.cpp create mode 100644 src/script/lua_api/l_object.h create mode 100644 src/script/lua_api/l_particles.cpp create mode 100644 src/script/lua_api/l_particles.h create mode 100644 src/script/lua_api/l_rollback.cpp create mode 100644 src/script/lua_api/l_rollback.h create mode 100644 src/script/lua_api/l_server.cpp create mode 100644 src/script/lua_api/l_server.h create mode 100644 src/script/lua_api/l_settings.cpp create mode 100644 src/script/lua_api/l_settings.h create mode 100644 src/script/lua_api/l_util.cpp create mode 100644 src/script/lua_api/l_util.h create mode 100644 src/script/lua_api/l_vmanip.cpp create mode 100644 src/script/lua_api/l_vmanip.h create mode 100644 src/script/scripting_game.cpp create mode 100644 src/script/scripting_game.h create mode 100644 src/script/scripting_mainmenu.cpp create mode 100644 src/script/scripting_mainmenu.h create mode 100644 src/serialization.cpp create mode 100644 src/serialization.h create mode 100644 src/server.cpp create mode 100644 src/server.h create mode 100644 src/serverlist.cpp create mode 100644 src/serverlist.h create mode 100644 src/serverobject.cpp create mode 100644 src/serverobject.h create mode 100644 src/settings.h create mode 100644 src/sha1.cpp create mode 100644 src/sha1.h create mode 100644 src/shader.cpp create mode 100644 src/shader.h create mode 100644 src/sky.cpp create mode 100644 src/sky.h create mode 100644 src/socket.cpp create mode 100644 src/socket.h create mode 100644 src/sound.cpp create mode 100644 src/sound.h create mode 100644 src/sound_openal.cpp create mode 100644 src/sound_openal.h create mode 100644 src/sqlite/CMakeLists.txt create mode 100644 src/sqlite/sqlite3.c create mode 100644 src/sqlite/sqlite3.h create mode 100644 src/staticobject.cpp create mode 100644 src/staticobject.h create mode 100644 src/strfnd.h create mode 100644 src/subgame.cpp create mode 100644 src/subgame.h create mode 100644 src/test.cpp create mode 100644 src/test.h create mode 100644 src/threads.h create mode 100644 src/tile.cpp create mode 100644 src/tile.h create mode 100644 src/tool.cpp create mode 100644 src/tool.h create mode 100644 src/treegen.cpp create mode 100644 src/treegen.h create mode 100644 src/util/CMakeLists.txt create mode 100644 src/util/container.h create mode 100644 src/util/directiontables.cpp create mode 100644 src/util/directiontables.h create mode 100644 src/util/mathconstants.h create mode 100644 src/util/numeric.cpp create mode 100644 src/util/numeric.h create mode 100644 src/util/pointedthing.cpp create mode 100644 src/util/pointedthing.h create mode 100644 src/util/pointer.h create mode 100644 src/util/serialize.cpp create mode 100644 src/util/serialize.h create mode 100644 src/util/string.cpp create mode 100644 src/util/string.h create mode 100644 src/util/thread.h create mode 100644 src/util/timetaker.cpp create mode 100644 src/util/timetaker.h create mode 100644 src/voxel.cpp create mode 100644 src/voxel.h create mode 100644 src/voxelalgorithms.cpp create mode 100644 src/voxelalgorithms.h create mode 100644 textures/base/pack/logo.png create mode 100644 textures/base/pack/menu_header.png create mode 100644 textures/base/pack/no_screenshot.png create mode 100644 textures/base/pack/smoke_puff.png create mode 100644 textures/base/pack/sunrisebg.png create mode 100644 textures/base/pack/unknown_item.png create mode 100644 textures/base/pack/unknown_node.png create mode 100644 textures/base/pack/unknown_object.png create mode 100644 textures/texture_packs_here.txt create mode 100755 util/buildbot/buildwin32.sh create mode 100644 util/buildbot/toolchain_mingw.cmake create mode 100644 util/colors.txt create mode 100755 util/generate-texture-normals.sh create mode 100644 util/master/index.html create mode 100644 util/master/list.js create mode 100755 util/master/master.cgi create mode 100644 util/master/style.css create mode 100755 util/minetestmapper.py create mode 100755 util/sectors2sqlite.py create mode 100755 util/test_multiplayer.sh create mode 100755 util/updatepo.sh create mode 100644 util/wireshark/minetest.lua diff --git a/client/serverlist/.gitignore b/client/serverlist/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/client/serverlist/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/client/shaders/bumpmaps_liquids/base.txt b/client/shaders/bumpmaps_liquids/base.txt new file mode 100644 index 0000000..1c26471 --- /dev/null +++ b/client/shaders/bumpmaps_liquids/base.txt @@ -0,0 +1 @@ +trans_alphach diff --git a/client/shaders/bumpmaps_liquids/opengl_fragment.glsl b/client/shaders/bumpmaps_liquids/opengl_fragment.glsl new file mode 100644 index 0000000..bf6bbf0 --- /dev/null +++ b/client/shaders/bumpmaps_liquids/opengl_fragment.glsl @@ -0,0 +1,46 @@ + +uniform sampler2D myTexture; +uniform sampler2D normalTexture; + +uniform vec4 skyBgColor; +uniform float fogDistance; + +varying vec3 vPosition; + +varying vec3 viewVec; + +void main (void) +{ + vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0])); + float alpha = col.a; + vec2 uv = gl_TexCoord[0].st; + vec4 base = texture2D(myTexture, uv); + vec4 final_color = vec4(0.2, 0.2, 0.2, 1.0) * base; + vec3 vVec = normalize(viewVec); + vec3 bump = normalize(texture2D(normalTexture, uv).xyz * 2.0 - 1.0); + vec3 R = reflect(-vVec, bump); + vec3 lVec = normalize(vec3(0.0, -0.4, 0.5)); + float diffuse = max(dot(lVec, bump), 0.0); + + vec3 color = diffuse * texture2D(myTexture, gl_TexCoord[0].st).rgb; + + + float specular = pow(clamp(dot(R, lVec), 0.0, 1.0),1.0); + color += vec3(0.2*specular*diffuse); + + + col = vec4(color.r, color.g, color.b, alpha); + col *= gl_Color; + col = col * col; // SRGB -> Linear + col *= 1.8; + col.r = 1.0 - exp(1.0 - col.r) / exp(1.0); + col.g = 1.0 - exp(1.0 - col.g) / exp(1.0); + col.b = 1.0 - exp(1.0 - col.b) / exp(1.0); + col = sqrt(col); // Linear -> SRGB + if(fogDistance != 0.0){ + float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); + alpha = mix(alpha, 0.0, d); + } + + gl_FragColor = vec4(col.r, col.g, col.b, alpha); +} diff --git a/client/shaders/bumpmaps_liquids/opengl_vertex.glsl b/client/shaders/bumpmaps_liquids/opengl_vertex.glsl new file mode 100644 index 0000000..99c208b --- /dev/null +++ b/client/shaders/bumpmaps_liquids/opengl_vertex.glsl @@ -0,0 +1,98 @@ + +uniform mat4 mWorldViewProj; +uniform mat4 mInvWorld; +uniform mat4 mTransWorld; +uniform float dayNightRatio; + +varying vec3 vPosition; +varying vec3 viewVec; + +void main(void) +{ + gl_Position = mWorldViewProj * gl_Vertex; + + vPosition = (mWorldViewProj * gl_Vertex).xyz; + + vec3 tangent; + vec3 binormal; + + vec3 c1 = cross( gl_Normal, vec3(0.0, 0.0, 1.0) ); + vec3 c2 = cross( gl_Normal, vec3(0.0, 1.0, 0.0) ); + + if( length(c1)>length(c2) ) + { + tangent = c1; + } + else + { + tangent = c2; + } + + tangent = normalize(tangent); + +//binormal = cross(gl_Normal, tangent); +//binormal = normalize(binormal); + + vec4 color; + //color = vec4(1.0, 1.0, 1.0, 1.0); + + float day = gl_Color.r; + float night = gl_Color.g; + float light_source = gl_Color.b; + + /*color.r = mix(night, day, dayNightRatio); + color.g = color.r; + color.b = color.r;*/ + + float rg = mix(night, day, dayNightRatio); + rg += light_source * 1.5; // Make light sources brighter + float b = rg; + + // Moonlight is blue + b += (day - night) / 13.0; + rg -= (day - night) / 13.0; + + // Emphase blue a bit in darker places + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025); + + // Artificial light is yellow-ish + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065); + + color.r = rg; + color.g = rg; + color.b = b; + + // Make sides and bottom darker than the top + color = color * color; // SRGB -> Linear + if(gl_Normal.y <= 0.5) + color *= 0.6; + //color *= 0.7; + color = sqrt(color); // Linear -> SRGB + + color.a = gl_Color.a; + + gl_FrontColor = gl_BackColor = color; + + gl_TexCoord[0] = gl_MultiTexCoord0; + + vec3 n1 = normalize(gl_NormalMatrix * gl_Normal); + vec4 tangent1 = vec4(tangent.x, tangent.y, tangent.z, 0); + //vec3 t1 = normalize(gl_NormalMatrix * tangent1); + //vec3 b1 = cross(n1, t1); + + vec3 v; + vec3 vVertex = vec3(gl_ModelViewMatrix * gl_Vertex); + vec3 vVec = -vVertex; + //v.x = dot(vVec, t1); + //v.y = dot(vVec, b1); + //v.z = dot(vVec, n1); + //viewVec = vVec; + viewVec = normalize(vec3(0.0, -0.4, 0.5)); + //Vector representing the 0th texture coordinate passed to fragment shader +//gl_TexCoord[0] = vec2(gl_MultiTexCoord0); + +// Transform the current vertex +//gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} diff --git a/client/shaders/bumpmaps_solids/base.txt b/client/shaders/bumpmaps_solids/base.txt new file mode 100644 index 0000000..080df30 --- /dev/null +++ b/client/shaders/bumpmaps_solids/base.txt @@ -0,0 +1 @@ +trans_alphach_ref diff --git a/client/shaders/bumpmaps_solids/opengl_fragment.glsl b/client/shaders/bumpmaps_solids/opengl_fragment.glsl new file mode 100644 index 0000000..c72e8cb --- /dev/null +++ b/client/shaders/bumpmaps_solids/opengl_fragment.glsl @@ -0,0 +1,45 @@ + +uniform sampler2D myTexture; +uniform sampler2D normalTexture; + +uniform vec4 skyBgColor; +uniform float fogDistance; + +varying vec3 vPosition; + +varying vec3 viewVec; + +void main (void) +{ + vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0])); + float alpha = col.a; + vec2 uv = gl_TexCoord[0].st; + vec4 base = texture2D(myTexture, uv); + vec4 final_color = vec4(0.2, 0.2, 0.2, 1.0) * base; + vec3 vVec = normalize(viewVec); + vec3 bump = normalize(texture2D(normalTexture, uv).xyz * 2.0 - 1.0); + vec3 R = reflect(-vVec, bump); + vec3 lVec = normalize(vec3(0.0, -0.4, 0.5)); + float diffuse = max(dot(lVec, bump), 0.0); + + vec3 color = diffuse * texture2D(myTexture, gl_TexCoord[0].st).rgb; + + + float specular = pow(clamp(dot(R, lVec), 0.0, 1.0),1.0); + color += vec3(0.2*specular*diffuse); + + + col = vec4(color.r, color.g, color.b, alpha); + col *= gl_Color; + col = col * col; // SRGB -> Linear + col *= 1.8; + col.r = 1.0 - exp(1.0 - col.r) / exp(1.0); + col.g = 1.0 - exp(1.0 - col.g) / exp(1.0); + col.b = 1.0 - exp(1.0 - col.b) / exp(1.0); + col = sqrt(col); // Linear -> SRGB + if(fogDistance != 0.0){ + float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); + col = mix(col, skyBgColor, d); + } + gl_FragColor = vec4(col.r, col.g, col.b, alpha); +} diff --git a/client/shaders/bumpmaps_solids/opengl_vertex.glsl b/client/shaders/bumpmaps_solids/opengl_vertex.glsl new file mode 100644 index 0000000..99c208b --- /dev/null +++ b/client/shaders/bumpmaps_solids/opengl_vertex.glsl @@ -0,0 +1,98 @@ + +uniform mat4 mWorldViewProj; +uniform mat4 mInvWorld; +uniform mat4 mTransWorld; +uniform float dayNightRatio; + +varying vec3 vPosition; +varying vec3 viewVec; + +void main(void) +{ + gl_Position = mWorldViewProj * gl_Vertex; + + vPosition = (mWorldViewProj * gl_Vertex).xyz; + + vec3 tangent; + vec3 binormal; + + vec3 c1 = cross( gl_Normal, vec3(0.0, 0.0, 1.0) ); + vec3 c2 = cross( gl_Normal, vec3(0.0, 1.0, 0.0) ); + + if( length(c1)>length(c2) ) + { + tangent = c1; + } + else + { + tangent = c2; + } + + tangent = normalize(tangent); + +//binormal = cross(gl_Normal, tangent); +//binormal = normalize(binormal); + + vec4 color; + //color = vec4(1.0, 1.0, 1.0, 1.0); + + float day = gl_Color.r; + float night = gl_Color.g; + float light_source = gl_Color.b; + + /*color.r = mix(night, day, dayNightRatio); + color.g = color.r; + color.b = color.r;*/ + + float rg = mix(night, day, dayNightRatio); + rg += light_source * 1.5; // Make light sources brighter + float b = rg; + + // Moonlight is blue + b += (day - night) / 13.0; + rg -= (day - night) / 13.0; + + // Emphase blue a bit in darker places + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025); + + // Artificial light is yellow-ish + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065); + + color.r = rg; + color.g = rg; + color.b = b; + + // Make sides and bottom darker than the top + color = color * color; // SRGB -> Linear + if(gl_Normal.y <= 0.5) + color *= 0.6; + //color *= 0.7; + color = sqrt(color); // Linear -> SRGB + + color.a = gl_Color.a; + + gl_FrontColor = gl_BackColor = color; + + gl_TexCoord[0] = gl_MultiTexCoord0; + + vec3 n1 = normalize(gl_NormalMatrix * gl_Normal); + vec4 tangent1 = vec4(tangent.x, tangent.y, tangent.z, 0); + //vec3 t1 = normalize(gl_NormalMatrix * tangent1); + //vec3 b1 = cross(n1, t1); + + vec3 v; + vec3 vVertex = vec3(gl_ModelViewMatrix * gl_Vertex); + vec3 vVec = -vVertex; + //v.x = dot(vVec, t1); + //v.y = dot(vVec, b1); + //v.z = dot(vVec, n1); + //viewVec = vVec; + viewVec = normalize(vec3(0.0, -0.4, 0.5)); + //Vector representing the 0th texture coordinate passed to fragment shader +//gl_TexCoord[0] = vec2(gl_MultiTexCoord0); + +// Transform the current vertex +//gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} diff --git a/client/shaders/test_shader_1/base.txt b/client/shaders/test_shader_1/base.txt new file mode 100644 index 0000000..080df30 --- /dev/null +++ b/client/shaders/test_shader_1/base.txt @@ -0,0 +1 @@ +trans_alphach_ref diff --git a/client/shaders/test_shader_1/opengl_fragment.glsl b/client/shaders/test_shader_1/opengl_fragment.glsl new file mode 100644 index 0000000..ebf943c --- /dev/null +++ b/client/shaders/test_shader_1/opengl_fragment.glsl @@ -0,0 +1,25 @@ + +uniform sampler2D myTexture; +uniform vec4 skyBgColor; +uniform float fogDistance; + +varying vec3 vPosition; + +void main (void) +{ + //vec4 col = vec4(1.0, 0.0, 0.0, 1.0); + vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0])); + float a = col.a; + col *= gl_Color; + col = col * col; // SRGB -> Linear + col *= 1.8; + col.r = 1.0 - exp(1.0 - col.r) / exp(1.0); + col.g = 1.0 - exp(1.0 - col.g) / exp(1.0); + col.b = 1.0 - exp(1.0 - col.b) / exp(1.0); + col = sqrt(col); // Linear -> SRGB + if(fogDistance != 0.0){ + float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); + col = mix(col, skyBgColor, d); + } + gl_FragColor = vec4(col.r, col.g, col.b, a); +} diff --git a/client/shaders/test_shader_1/opengl_vertex.glsl b/client/shaders/test_shader_1/opengl_vertex.glsl new file mode 100644 index 0000000..3cf1f12 --- /dev/null +++ b/client/shaders/test_shader_1/opengl_vertex.glsl @@ -0,0 +1,58 @@ + +uniform mat4 mWorldViewProj; +uniform mat4 mInvWorld; +uniform mat4 mTransWorld; +uniform float dayNightRatio; + +varying vec3 vPosition; + +void main(void) +{ + gl_Position = mWorldViewProj * gl_Vertex; + + vPosition = (mWorldViewProj * gl_Vertex).xyz; + + vec4 color; + //color = vec4(1.0, 1.0, 1.0, 1.0); + + float day = gl_Color.r; + float night = gl_Color.g; + float light_source = gl_Color.b; + + /*color.r = mix(night, day, dayNightRatio); + color.g = color.r; + color.b = color.r;*/ + + float rg = mix(night, day, dayNightRatio); + rg += light_source * 1.0; // Make light sources brighter + float b = rg; + + // Moonlight is blue + b += (day - night) / 13.0; + rg -= (day - night) / 13.0; + + // Emphase blue a bit in darker places + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025); + + // Artificial light is yellow-ish + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065); + + color.r = rg; + color.g = rg; + color.b = b; + + // Make sides and bottom darker than the top + color = color * color; // SRGB -> Linear + if(gl_Normal.y <= 0.5) + color *= 0.6; + //color *= 0.7; + color = sqrt(color); // Linear -> SRGB + + color.a = gl_Color.a; + + gl_FrontColor = gl_BackColor = color; + + gl_TexCoord[0] = gl_MultiTexCoord0; +} diff --git a/client/shaders/test_shader_2/base.txt b/client/shaders/test_shader_2/base.txt new file mode 100644 index 0000000..1c26471 --- /dev/null +++ b/client/shaders/test_shader_2/base.txt @@ -0,0 +1 @@ +trans_alphach diff --git a/client/shaders/test_shader_2/opengl_fragment.glsl b/client/shaders/test_shader_2/opengl_fragment.glsl new file mode 100644 index 0000000..38bc943 --- /dev/null +++ b/client/shaders/test_shader_2/opengl_fragment.glsl @@ -0,0 +1,23 @@ + +uniform sampler2D myTexture; +uniform float fogDistance; + +varying vec3 vPosition; + +void main (void) +{ + vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0])); + col *= gl_Color; + float a = gl_Color.a; + col = col * col; // SRGB -> Linear + col *= 1.8; + col.r = 1.0 - exp(1.0 - col.r) / exp(1.0); + col.g = 1.0 - exp(1.0 - col.g) / exp(1.0); + col.b = 1.0 - exp(1.0 - col.b) / exp(1.0); + col = sqrt(col); // Linear -> SRGB + if(fogDistance != 0.0){ + float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); + a = mix(a, 0.0, d); + } + gl_FragColor = vec4(col.r, col.g, col.b, a); +} diff --git a/client/shaders/test_shader_2/opengl_vertex.glsl b/client/shaders/test_shader_2/opengl_vertex.glsl new file mode 100644 index 0000000..2881bad --- /dev/null +++ b/client/shaders/test_shader_2/opengl_vertex.glsl @@ -0,0 +1,51 @@ + +uniform mat4 mWorldViewProj; +uniform mat4 mInvWorld; +uniform mat4 mTransWorld; +uniform float dayNightRatio; + +varying vec3 vPosition; + +void main(void) +{ + gl_Position = mWorldViewProj * gl_Vertex; + + vPosition = (mWorldViewProj * gl_Vertex).xyz; + + vec4 color; + //color = vec4(1.0, 1.0, 1.0, 1.0); + + float day = gl_Color.r; + float night = gl_Color.g; + float light_source = gl_Color.b; + + /*color.r = mix(night, day, dayNightRatio); + color.g = color.r; + color.b = color.r;*/ + + float rg = mix(night, day, dayNightRatio); + rg += light_source * 1.0; // Make light sources brighter + float b = rg; + + // Moonlight is blue + b += (day - night) / 13.0; + rg -= (day - night) / 13.0; + + // Emphase blue a bit in darker places + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025); + + // Artificial light is yellow-ish + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065); + + color.r = rg; + color.g = rg; + color.b = b; + + color.a = gl_Color.a; + + gl_FrontColor = gl_BackColor = color; + + gl_TexCoord[0] = gl_MultiTexCoord0; +} diff --git a/client/shaders/test_shader_3/base.txt b/client/shaders/test_shader_3/base.txt new file mode 100644 index 0000000..1c26471 --- /dev/null +++ b/client/shaders/test_shader_3/base.txt @@ -0,0 +1 @@ +trans_alphach diff --git a/client/shaders/test_shader_3/opengl_fragment.glsl b/client/shaders/test_shader_3/opengl_fragment.glsl new file mode 100644 index 0000000..535774c --- /dev/null +++ b/client/shaders/test_shader_3/opengl_fragment.glsl @@ -0,0 +1,25 @@ + +uniform sampler2D myTexture; +uniform float fogDistance; + +varying vec3 vPosition; + +void main (void) +{ + vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0])); + col *= gl_Color; + float a = col.a; + col = col * col; // SRGB -> Linear + col *= 1.8; + col.r = 1.0 - exp(1.0 - col.r) / exp(1.0); + col.g = 1.0 - exp(1.0 - col.g) / exp(1.0); + col.b = 1.0 - exp(1.0 - col.b) / exp(1.0); + col = sqrt(col); // Linear -> SRGB + + if(fogDistance != 0.0){ + float d = max(0.0, min(vPosition.z / fogDistance * 1.5 - 0.6, 1.0)); + a = mix(a, 0.0, d); + } + + gl_FragColor = vec4(col.r, col.g, col.b, a); +} diff --git a/client/shaders/test_shader_3/opengl_vertex.glsl b/client/shaders/test_shader_3/opengl_vertex.glsl new file mode 100644 index 0000000..2881bad --- /dev/null +++ b/client/shaders/test_shader_3/opengl_vertex.glsl @@ -0,0 +1,51 @@ + +uniform mat4 mWorldViewProj; +uniform mat4 mInvWorld; +uniform mat4 mTransWorld; +uniform float dayNightRatio; + +varying vec3 vPosition; + +void main(void) +{ + gl_Position = mWorldViewProj * gl_Vertex; + + vPosition = (mWorldViewProj * gl_Vertex).xyz; + + vec4 color; + //color = vec4(1.0, 1.0, 1.0, 1.0); + + float day = gl_Color.r; + float night = gl_Color.g; + float light_source = gl_Color.b; + + /*color.r = mix(night, day, dayNightRatio); + color.g = color.r; + color.b = color.r;*/ + + float rg = mix(night, day, dayNightRatio); + rg += light_source * 1.0; // Make light sources brighter + float b = rg; + + // Moonlight is blue + b += (day - night) / 13.0; + rg -= (day - night) / 13.0; + + // Emphase blue a bit in darker places + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + b += max(0.0, (1.0 - abs(b - 0.13)/0.17) * 0.025); + + // Artificial light is yellow-ish + // See C++ implementation in mapblock_mesh.cpp finalColorBlend() + rg += max(0.0, (1.0 - abs(rg - 0.85)/0.15) * 0.065); + + color.r = rg; + color.g = rg; + color.b = b; + + color.a = gl_Color.a; + + gl_FrontColor = gl_BackColor = color; + + gl_TexCoord[0] = gl_MultiTexCoord0; +} diff --git a/cmake/Modules/FindCURL.cmake b/cmake/Modules/FindCURL.cmake new file mode 100644 index 0000000..3644d19 --- /dev/null +++ b/cmake/Modules/FindCURL.cmake @@ -0,0 +1,42 @@ +# - Find curl +# Find the native CURL headers and libraries. +# +# CURL_INCLUDE_DIR - where to find curl/curl.h, etc. +# CURL_LIBRARY - List of libraries when using curl. +# CURL_FOUND - True if curl found. + +if( UNIX ) + FIND_PATH(CURL_INCLUDE_DIR NAMES curl.h + PATHS + /usr/local/include/curl + /usr/include/curl + ) + + FIND_LIBRARY(CURL_LIBRARY NAMES curl + PATHS + /usr/local/lib + /usr/lib + ) +else( UNIX ) + FIND_PATH(CURL_INCLUDE_DIR NAMES curl/curl.h) # Look for the header file. + FIND_LIBRARY(CURL_LIBRARY NAMES curl) # Look for the library. + INCLUDE(FindPackageHandleStandardArgs) # handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if + FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL DEFAULT_MSG CURL_LIBRARY CURL_INCLUDE_DIR) # all listed variables are TRUE +endif( UNIX ) + +if( WIN32 ) + if( CURL_LIBRARY AND CURL_INCLUDE_DIR AND CURL_DLL ) # libcurl.dll is required on Windows + SET(CURL_FOUND TRUE) + else( CURL_LIBRARY AND CURL_INCLUDE_DIR AND CURL_DLL ) + SET(CURL_FOUND FALSE) + endif( CURL_LIBRARY AND CURL_INCLUDE_DIR AND CURL_DLL ) +else ( WIN32 ) + if( CURL_LIBRARY AND CURL_INCLUDE_DIR ) + SET(CURL_FOUND TRUE) + else( CURL_LIBRARY AND CURL_INCLUDE_DIR ) + SET(CURL_FOUND FALSE) + endif( CURL_LIBRARY AND CURL_INCLUDE_DIR ) +endif ( WIN32 ) + +MESSAGE(STATUS "CURL_INCLUDE_DIR = ${CURL_INCLUDE_DIR}") +MESSAGE(STATUS "CURL_LIBRARY = ${CURL_LIBRARY}") diff --git a/cmake/Modules/FindGettextLib.cmake b/cmake/Modules/FindGettextLib.cmake new file mode 100644 index 0000000..bc7ea36 --- /dev/null +++ b/cmake/Modules/FindGettextLib.cmake @@ -0,0 +1,72 @@ +# Package finder for gettext libs and include files + +SET(CUSTOM_GETTEXT_PATH "${PROJECT_SOURCE_DIR}/../../gettext" + CACHE FILEPATH "path to custom gettext") + +# by default +SET(GETTEXT_FOUND FALSE) + +FIND_PATH(GETTEXT_INCLUDE_DIR + NAMES libintl.h + PATHS "${CUSTOM_GETTEXT_PATH}/include" + DOC "gettext include directory") + +FIND_PROGRAM(GETTEXT_MSGFMT + NAMES msgfmt + PATHS "${CUSTOM_GETTEXT_PATH}/bin" + DOC "path to msgfmt") + +# modern Linux, as well as Mac, seem to not need require special linking +# they do not because gettext is part of glibc +# TODO check the requirements on other BSDs and older Linux +IF (WIN32) + IF(MSVC) + SET(GETTEXT_LIB_NAMES + libintl.lib intl.lib libintl3.lib intl3.lib) + ELSE() + SET(GETTEXT_LIB_NAMES + libintl.dll.a intl.dll.a libintl3.dll.a intl3.dll.a) + ENDIF() + FIND_LIBRARY(GETTEXT_LIBRARY + NAMES ${GETTEXT_LIB_NAMES} + PATHS "${CUSTOM_GETTEXT_PATH}/lib" + DOC "gettext *intl*.lib") + FIND_FILE(GETTEXT_DLL + NAMES libintl.dll intl.dll libintl3.dll intl3.dll + PATHS "${CUSTOM_GETTEXT_PATH}/bin" "${CUSTOM_GETTEXT_PATH}/lib" + DOC "gettext *intl*.dll") + FIND_FILE(GETTEXT_ICONV_DLL + NAMES libiconv2.dll + PATHS "${CUSTOM_GETTEXT_PATH}/bin" "${CUSTOM_GETTEXT_PATH}/lib" + DOC "gettext *iconv*.lib") +ENDIF(WIN32) + +IF(GETTEXT_INCLUDE_DIR AND GETTEXT_MSGFMT) + IF (WIN32) + # in the Win32 case check also for the extra linking requirements + IF(GETTEXT_LIBRARY AND GETTEXT_DLL AND GETTEXT_ICONV_DLL) + SET(GETTEXT_FOUND TRUE) + ENDIF() + ELSE(WIN32) + # *BSD variants require special linkage as they don't use glibc + IF(${CMAKE_SYSTEM_NAME} MATCHES "BSD") + SET(GETTEXT_LIBRARY "intl") + ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "BSD") + SET(GETTEXT_FOUND TRUE) + ENDIF(WIN32) +ENDIF() + +IF(GETTEXT_FOUND) + SET(GETTEXT_PO_PATH ${CMAKE_SOURCE_DIR}/po) + SET(GETTEXT_MO_BUILD_PATH ${CMAKE_BINARY_DIR}/locale//LC_MESSAGES) + SET(GETTEXT_MO_DEST_PATH ${LOCALEDIR}//LC_MESSAGES) + FILE(GLOB GETTEXT_AVAILABLE_LOCALES RELATIVE ${GETTEXT_PO_PATH} "${GETTEXT_PO_PATH}/*") + LIST(REMOVE_ITEM GETTEXT_AVAILABLE_LOCALES minetest.pot) + MACRO(SET_MO_PATHS _buildvar _destvar _locale) + STRING(REPLACE "" ${_locale} ${_buildvar} ${GETTEXT_MO_BUILD_PATH}) + STRING(REPLACE "" ${_locale} ${_destvar} ${GETTEXT_MO_DEST_PATH}) + ENDMACRO(SET_MO_PATHS) +ELSE() + SET(GETTEXT_INCLUDE_DIR "") + SET(GETTEXT_LIBRARY "") +ENDIF() diff --git a/cmake/Modules/FindIrrlicht.cmake b/cmake/Modules/FindIrrlicht.cmake new file mode 100644 index 0000000..bd00422 --- /dev/null +++ b/cmake/Modules/FindIrrlicht.cmake @@ -0,0 +1,94 @@ +#FindIrrlicht.cmake + +set(IRRLICHT_SOURCE_DIR "" CACHE PATH "Path to irrlicht source directory (optional)") + +if( UNIX ) + # Unix +else( UNIX ) + # Windows +endif( UNIX ) + +# Find include directory + +if(NOT IRRLICHT_SOURCE_DIR STREQUAL "") + set(IRRLICHT_SOURCE_DIR_INCLUDE + "${IRRLICHT_SOURCE_DIR}/include" + ) + + set(IRRLICHT_LIBRARY_NAMES libIrrlicht.a Irrlicht Irrlicht.lib) + + if(WIN32) + if(MSVC) + set(IRRLICHT_SOURCE_DIR_LIBS "${IRRLICHT_SOURCE_DIR}/lib/Win32-visualstudio") + set(IRRLICHT_LIBRARY_NAMES Irrlicht.lib) + else() + set(IRRLICHT_SOURCE_DIR_LIBS "${IRRLICHT_SOURCE_DIR}/lib/Win32-gcc") + set(IRRLICHT_LIBRARY_NAMES libIrrlicht.a libIrrlicht.dll.a) + endif() + else() + set(IRRLICHT_SOURCE_DIR_LIBS "${IRRLICHT_SOURCE_DIR}/lib/Linux") + set(IRRLICHT_LIBRARY_NAMES libIrrlicht.a) + endif() + + FIND_PATH(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h + PATHS + ${IRRLICHT_SOURCE_DIR_INCLUDE} + NO_DEFAULT_PATH + ) + + FIND_LIBRARY(IRRLICHT_LIBRARY NAMES ${IRRLICHT_LIBRARY_NAMES} + PATHS + ${IRRLICHT_SOURCE_DIR_LIBS} + NO_DEFAULT_PATH + ) + +else() + + FIND_PATH(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h + PATHS + /usr/local/include/irrlicht + /usr/include/irrlicht + ) + + FIND_LIBRARY(IRRLICHT_LIBRARY NAMES libIrrlicht.a Irrlicht + PATHS + /usr/local/lib + /usr/lib + ) +endif() + +MESSAGE(STATUS "IRRLICHT_SOURCE_DIR = ${IRRLICHT_SOURCE_DIR}") +MESSAGE(STATUS "IRRLICHT_INCLUDE_DIR = ${IRRLICHT_INCLUDE_DIR}") +MESSAGE(STATUS "IRRLICHT_LIBRARY = ${IRRLICHT_LIBRARY}") + +# On windows, find the dll for installation +if(WIN32) + if(MSVC) + FIND_FILE(IRRLICHT_DLL NAMES Irrlicht.dll + PATHS + "${IRRLICHT_SOURCE_DIR}/bin/Win32-VisualStudio" + DOC "Path of the Irrlicht dll (for installation)" + ) + else() + FIND_FILE(IRRLICHT_DLL NAMES Irrlicht.dll + PATHS + "${IRRLICHT_SOURCE_DIR}/bin/Win32-gcc" + DOC "Path of the Irrlicht dll (for installation)" + ) + endif() + MESSAGE(STATUS "IRRLICHT_DLL = ${IRRLICHT_DLL}") +endif(WIN32) + +# handle the QUIETLY and REQUIRED arguments and set IRRLICHT_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(IRRLICHT DEFAULT_MSG IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR) + +IF(IRRLICHT_FOUND) + SET(IRRLICHT_LIBRARIES ${IRRLICHT_LIBRARY}) +ELSE(IRRLICHT_FOUND) + SET(IRRLICHT_LIBRARIES) +ENDIF(IRRLICHT_FOUND) + +MARK_AS_ADVANCED(IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR IRRLICHT_DLL) + diff --git a/cmake/Modules/FindJson.cmake b/cmake/Modules/FindJson.cmake new file mode 100644 index 0000000..a9178a2 --- /dev/null +++ b/cmake/Modules/FindJson.cmake @@ -0,0 +1,18 @@ +# Look for json, use our own if not found + +#FIND_PATH(JSON_INCLUDE_DIR json.h) + +#FIND_LIBRARY(JSON_LIBRARY NAMES jsoncpp) + +#IF(JSON_LIBRARY AND JSON_INCLUDE_DIR) +# SET( JSON_FOUND TRUE ) +#ENDIF(JSON_LIBRARY AND JSON_INCLUDE_DIR) + +#IF(JSON_FOUND) +# MESSAGE(STATUS "Found system jsoncpp header file in ${JSON_INCLUDE_DIR}") +# MESSAGE(STATUS "Found system jsoncpp library ${JSON_LIBRARY}") +#ELSE(JSON_FOUND) + SET(JSON_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/json) + SET(JSON_LIBRARY jsoncpp) + MESSAGE(STATUS "Using project jsoncpp library") +#ENDIF(JSON_FOUND) diff --git a/cmake/Modules/FindJthread.cmake b/cmake/Modules/FindJthread.cmake new file mode 100644 index 0000000..302a3c2 --- /dev/null +++ b/cmake/Modules/FindJthread.cmake @@ -0,0 +1,18 @@ +# Look for jthread, use our own if not found + +FIND_PATH(JTHREAD_INCLUDE_DIR jthread.h) + +FIND_LIBRARY(JTHREAD_LIBRARY NAMES jthread) + +IF(JTHREAD_LIBRARY AND JTHREAD_INCLUDE_DIR) + SET( JTHREAD_FOUND TRUE ) +ENDIF(JTHREAD_LIBRARY AND JTHREAD_INCLUDE_DIR) + +IF(JTHREAD_FOUND) + MESSAGE(STATUS "Found system jthread header file in ${JTHREAD_INCLUDE_DIR}") + MESSAGE(STATUS "Found system jthread library ${JTHREAD_LIBRARY}") +ELSE(JTHREAD_FOUND) + SET(JTHREAD_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/jthread) + SET(JTHREAD_LIBRARY jthread) + MESSAGE(STATUS "Using project jthread library") +ENDIF(JTHREAD_FOUND) diff --git a/cmake/Modules/FindOpenGLES2.cmake b/cmake/Modules/FindOpenGLES2.cmake new file mode 100644 index 0000000..42d31c8 --- /dev/null +++ b/cmake/Modules/FindOpenGLES2.cmake @@ -0,0 +1,130 @@ +#------------------------------------------------------------------- +# This file is stolen from part of the CMake build system for OGRE (Object-oriented Graphics Rendering Engine) http://www.ogre3d.org/ +# +# The contents of this file are placed in the public domain. Feel +# free to make use of it in any way you like. +#------------------------------------------------------------------- + +# - Try to find OpenGLES and EGL +# Once done this will define +# +# OPENGLES2_FOUND - system has OpenGLES +# OPENGLES2_INCLUDE_DIR - the GL include directory +# OPENGLES2_LIBRARIES - Link these to use OpenGLES +# +# EGL_FOUND - system has EGL +# EGL_INCLUDE_DIR - the EGL include directory +# EGL_LIBRARIES - Link these to use EGL + +# win32, apple, android NOT TESED +# linux tested and works + +IF (WIN32) + IF (CYGWIN) + + FIND_PATH(OPENGLES2_INCLUDE_DIR GLES2/gl2.h ) + + FIND_LIBRARY(OPENGLES2_gl_LIBRARY libGLESv2 ) + + ELSE (CYGWIN) + + IF(BORLAND) + SET (OPENGLES2_gl_LIBRARY import32 CACHE STRING "OpenGL ES 2.x library for win32") + ELSE(BORLAND) + # todo + # SET (OPENGLES_gl_LIBRARY ${SOURCE_DIR}/Dependencies/lib/release/libGLESv2.lib CACHE STRING "OpenGL ES 2.x library for win32" + ENDIF(BORLAND) + + ENDIF (CYGWIN) + +ELSE (WIN32) + + IF (APPLE) + + create_search_paths(/Developer/Platforms) + findpkg_framework(OpenGLES2) + set(OPENGLES2_gl_LIBRARY "-framework OpenGLES") + + ELSE(APPLE) + + FIND_PATH(OPENGLES2_INCLUDE_DIR GLES2/gl2.h + /usr/openwin/share/include + /opt/graphics/OpenGL/include /usr/X11R6/include + /usr/include + ) + + FIND_LIBRARY(OPENGLES2_gl_LIBRARY + NAMES GLESv2 + PATHS /opt/graphics/OpenGL/lib + /usr/openwin/lib + /usr/shlib /usr/X11R6/lib + /usr/lib + ) + + IF (NOT BUILD_ANDROID) + FIND_PATH(EGL_INCLUDE_DIR EGL/egl.h + /usr/openwin/share/include + /opt/graphics/OpenGL/include /usr/X11R6/include + /usr/include + ) + + FIND_LIBRARY(EGL_egl_LIBRARY + NAMES EGL + PATHS /opt/graphics/OpenGL/lib + /usr/openwin/lib + /usr/shlib /usr/X11R6/lib + /usr/lib + ) + + # On Unix OpenGL most certainly always requires X11. + # Feel free to tighten up these conditions if you don't + # think this is always true. + # It's not true on OSX. + + IF (OPENGLES2_gl_LIBRARY) + IF(NOT X11_FOUND) + INCLUDE(FindX11) + ENDIF(NOT X11_FOUND) + IF (X11_FOUND) + IF (NOT APPLE) + SET (OPENGLES2_LIBRARIES ${X11_LIBRARIES}) + ENDIF (NOT APPLE) + ENDIF (X11_FOUND) + ENDIF (OPENGLES2_gl_LIBRARY) + ENDIF () + + ENDIF(APPLE) +ENDIF (WIN32) + +#SET( OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY} ${OPENGLES2_LIBRARIES}) + +IF (BUILD_ANDROID) + IF(OPENGLES2_gl_LIBRARY) + SET( OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY} ${OPENGLES2_LIBRARIES}) + SET( EGL_LIBRARIES) + SET( OPENGLES2_FOUND "YES" ) + ENDIF(OPENGLES2_gl_LIBRARY) +ELSE () + + SET( OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY} ${OPENGLES2_LIBRARIES}) + + IF(OPENGLES2_gl_LIBRARY AND EGL_egl_LIBRARY) + SET( OPENGLES2_LIBRARIES ${OPENGLES2_gl_LIBRARY} ${OPENGLES2_LIBRARIES}) + SET( EGL_LIBRARIES ${EGL_egl_LIBRARY} ${EGL_LIBRARIES}) + SET( OPENGLES2_FOUND "YES" ) + ENDIF(OPENGLES2_gl_LIBRARY AND EGL_egl_LIBRARY) + +ENDIF () + +MARK_AS_ADVANCED( + OPENGLES2_INCLUDE_DIR + OPENGLES2_gl_LIBRARY + EGL_INCLUDE_DIR + EGL_egl_LIBRARY +) + +IF(OPENGLES2_FOUND) + MESSAGE(STATUS "Found system opengles2 library ${OPENGLES2_LIBRARIES}") +ELSE () + SET(OPENGLES2_LIBRARIES "") +ENDIF () diff --git a/cmake/Modules/FindSqlite3.cmake b/cmake/Modules/FindSqlite3.cmake new file mode 100644 index 0000000..ecce6e3 --- /dev/null +++ b/cmake/Modules/FindSqlite3.cmake @@ -0,0 +1,18 @@ +# Look for sqlite3, use our own if not found + +FIND_PATH(SQLITE3_INCLUDE_DIR sqlite3.h) + +FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3) + +IF(SQLITE3_LIBRARY AND SQLITE3_INCLUDE_DIR) + SET( SQLITE3_FOUND TRUE ) +ENDIF(SQLITE3_LIBRARY AND SQLITE3_INCLUDE_DIR) + +IF(SQLITE3_FOUND) + MESSAGE(STATUS "Found system sqlite3 header file in ${SQLITE3_INCLUDE_DIR}") + MESSAGE(STATUS "Found system sqlite3 library ${SQLITE3_LIBRARY}") +ELSE(SQLITE3_FOUND) + SET(SQLITE3_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/sqlite) + SET(SQLITE3_LIBRARY sqlite3) + MESSAGE(STATUS "Using project sqlite3 library") +ENDIF(SQLITE3_FOUND) diff --git a/cmake/Modules/FindVorbis.cmake b/cmake/Modules/FindVorbis.cmake new file mode 100644 index 0000000..8f38136 --- /dev/null +++ b/cmake/Modules/FindVorbis.cmake @@ -0,0 +1,46 @@ +# - Find vorbis +# Find the native vorbis includes and libraries +# +# VORBIS_INCLUDE_DIR - where to find vorbis.h, etc. +# OGG_INCLUDE_DIR - where to find ogg/ogg.h, etc. +# VORBIS_LIBRARIES - List of libraries when using vorbis(file). +# VORBIS_FOUND - True if vorbis found. + +if(NOT GP2XWIZ) + if(VORBIS_INCLUDE_DIR) + # Already in cache, be silent + set(VORBIS_FIND_QUIETLY TRUE) + endif(VORBIS_INCLUDE_DIR) + find_path(OGG_INCLUDE_DIR ogg/ogg.h) + find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h) + # MSVC built ogg/vorbis may be named ogg_static and vorbis_static + find_library(OGG_LIBRARY NAMES ogg ogg_static) + find_library(VORBIS_LIBRARY NAMES vorbis vorbis_static) + find_library(VORBISFILE_LIBRARY NAMES vorbisfile vorbisfile_static) + # Handle the QUIETLY and REQUIRED arguments and set VORBIS_FOUND + # to TRUE if all listed variables are TRUE. + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(VORBIS DEFAULT_MSG + OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR + OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY) +else(NOT GP2XWIZ) + find_path(VORBIS_INCLUDE_DIR tremor/ivorbisfile.h) + find_library(VORBIS_LIBRARY NAMES vorbis_dec) + find_package_handle_standard_args(VORBIS DEFAULT_MSG + VORBIS_INCLUDE_DIR VORBIS_LIBRARY) +endif(NOT GP2XWIZ) + +if(VORBIS_FOUND) + if(NOT GP2XWIZ) + set(VORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} + ${OGG_LIBRARY}) + else(NOT GP2XWIZ) + set(VORBIS_LIBRARIES ${VORBIS_LIBRARY}) + endif(NOT GP2XWIZ) +else(VORBIS_FOUND) + set(VORBIS_LIBRARIES) +endif(VORBIS_FOUND) + +mark_as_advanced(OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR) +mark_as_advanced(OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY) + diff --git a/cmake/Modules/misc.cmake b/cmake/Modules/misc.cmake new file mode 100644 index 0000000..0bd2e3f --- /dev/null +++ b/cmake/Modules/misc.cmake @@ -0,0 +1,21 @@ +# +# Random macros +# + +# Not used ATM + +MACRO (GETDATETIME RESULT) + IF (WIN32) + EXECUTE_PROCESS(COMMAND "cmd" /C echo %date% %time% OUTPUT_VARIABLE ${RESULT}) + string(REGEX REPLACE "\n" "" ${RESULT} "${${RESULT}}") + ELSEIF(UNIX) + EXECUTE_PROCESS(COMMAND "date" "+%Y-%m-%d_%H:%M:%S" OUTPUT_VARIABLE ${RESULT}) + string(REGEX REPLACE "\n" "" ${RESULT} "${${RESULT}}") + ELSE (WIN32) + MESSAGE(SEND_ERROR "date not implemented") + SET(${RESULT} "Unknown") + ENDIF (WIN32) + + string(REGEX REPLACE " " "_" ${RESULT} "${${RESULT}}") +ENDMACRO (GETDATETIME) + diff --git a/doc/gpl-2.0.txt b/doc/gpl-2.0.txt new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/doc/gpl-2.0.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU 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. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/doc/lua_api.txt b/doc/lua_api.txt new file mode 100644 index 0000000..c63ea29 --- /dev/null +++ b/doc/lua_api.txt @@ -0,0 +1,2284 @@ +Minetest Lua Modding API Reference 0.4.7 +======================================== +More information at http://www.minetest.net/ +Developer Wiki: http://dev.minetest.net/ + +Introduction +------------- +Content and functionality can be added to Minetest 0.4 by using Lua +scripting in run-time loaded mods. + +A mod is a self-contained bunch of scripts, textures and other related +things that is loaded by and interfaces with Minetest. + +Mods are contained and ran solely on the server side. Definitions and media +files are automatically transferred to the client. + +If you see a deficiency in the API, feel free to attempt to add the +functionality in the engine and API. You can send such improvements as +source code patches to . + +Programming in Lua +------------------- +If you have any difficulty in understanding this, please read: + http://www.lua.org/pil/ + +Startup +-------- +Mods are loaded during server startup from the mod load paths by running +the init.lua scripts in a shared environment. + +Paths +----- +RUN_IN_PLACE=1: (Windows release, local build) + $path_user: Linux: + Windows: + $path_share: Linux: + Windows: + +RUN_IN_PLACE=0: (Linux release) + $path_share: Linux: /usr/share/minetest + Windows: /minetest-0.4.x + $path_user: Linux: ~/.minetest + Windows: C:/users//AppData/minetest (maybe) + +Games +----- +Games are looked up from: + $path_share/games/gameid/ + $path_user/games/gameid/ +where gameid is unique to each game. + +The game directory contains the file game.conf, which contains these fields: + name = +eg. + name = Minetest + +The game directory can contain the file minetest.conf, which will be used +to set default settings when running the particular game. + +Mod load path +------------- +Generic: + $path_share/games/gameid/mods/ + $path_share/mods/ + $path_user/games/gameid/mods/ + $path_user/mods/ <-- User-installed mods + $worldpath/worldmods/ + +In a run-in-place version (eg. the distributed windows version): + minetest-0.4.x/games/gameid/mods/ + minetest-0.4.x/mods/gameid/ <-- User-installed mods + minetest-0.4.x/worlds/worldname/worldmods/ + +On an installed version on linux: + /usr/share/minetest/games/gameid/mods/ + ~/.minetest/mods/gameid/ <-- User-installed mods + ~/.minetest/worlds/worldname/worldmods + +Mod load path for world-specific games +-------------------------------------- +It is possible to include a game in a world; in this case, no mods or +games are loaded or checked from anywhere else. + +This is useful for eg. adventure worlds. + +This happens if the following directory exists: + $world/game/ + +Mods should be then be placed in: + $world/game/mods/ + +Modpack support +---------------- +Mods can be put in a subdirectory, if the parent directory, which otherwise +should be a mod, contains a file named modpack.txt. This file shall be +empty, except for lines starting with #, which are comments. + +Mod directory structure +------------------------ +mods +|-- modname +| |-- depends.txt +| |-- init.lua +| |-- textures +| | |-- modname_stuff.png +| | `-- modname_something_else.png +| |-- sounds +| |-- media +| `-- +`-- another + +modname: + The location of this directory can be fetched by using + minetest.get_modpath(modname) + +depends.txt: + List of mods that have to be loaded before loading this mod. + A single line contains a single modname. + + Optional dependencies can be defined by appending a question mark + to a single modname. Their meaning is that if the specified mod + is missing, that does not prevent this mod from being loaded. + +optdepends.txt: + An alternative way of specifying optional dependencies. + Like depends.txt, a single line contains a single modname. + + NOTE: This file exists for compatibility purposes only and + support for it will be removed from the engine by the end of 2013. + +init.lua: + The main Lua script. Running this script should register everything it + wants to register. Subsequent execution depends on minetest calling the + registered callbacks. + + minetest.setting_get(name) and minetest.setting_getbool(name) can be used + to read custom or existing settings at load time, if necessary. + +textures, sounds, media: + Media files (textures, sounds, whatever) that will be transferred to the + client and will be available for use by the mod. + +Naming convention for registered textual names +---------------------------------------------- +Registered names should generally be in this format: + "modname:" ( can have characters a-zA-Z0-9_) + +This is to prevent conflicting names from corrupting maps and is +enforced by the mod loader. + +Example: mod "experimental", ideal item/node/entity name "tnt": + -> the name should be "experimental:tnt". + +Enforcement can be overridden by prefixing the name with ":". This can +be used for overriding the registrations of some other mod. + +Example: Any mod can redefine experimental:tnt by using the name + ":experimental:tnt" when registering it. +(also that mod is required to have "experimental" as a dependency) + +The ":" prefix can also be used for maintaining backwards compatibility. + +Aliases +------- +Aliases can be added by using minetest.register_alias(name, convert_to) + +This will make Minetest to convert things called name to things called +convert_to. + +This can be used for maintaining backwards compatibility. + +This can be also used for setting quick access names for things, eg. if +you have an item called epiclylongmodname:stuff, you could do + minetest.register_alias("stuff", "epiclylongmodname:stuff") +and be able to use "/giveme stuff". + +Textures +-------- +Mods should generally prefix their textures with modname_, eg. given +the mod name "foomod", a texture could be called + "foomod_foothing.png" + +Textures are referred to by their complete name, or alternatively by +stripping out the file extension: + eg. foomod_foothing.png + eg. foomod_foothing + +Sounds +------- +Only OGG files are supported. + +For positional playing of sounds, only single-channel (mono) files are +supported. Otherwise OpenAL will play them non-positionally. + +Mods should generally prefix their sounds with modname_, eg. given +the mod name "foomod", a sound could be called + "foomod_foosound.ogg" + +Sounds are referred to by their name with a dot, a single digit and the +file extension stripped out. When a sound is played, the actual sound file +is chosen randomly from the matching sounds. + +When playing the sound "foomod_foosound", the sound is chosen randomly +from the available ones of the following files: + foomod_foosound.ogg + foomod_foosound.0.ogg + foomod_foosound.1.ogg + ... + foomod_foosound.9.ogg + +Examples of sound parameter tables: +-- Play locationless on all clients +{ + gain = 1.0, -- default +} +-- Play locationless to a player +{ + to_player = name, + gain = 1.0, -- default +} +-- Play in a location +{ + pos = {x=1,y=2,z=3}, + gain = 1.0, -- default + max_hear_distance = 32, -- default +} +-- Play connected to an object, looped +{ + object = , + gain = 1.0, -- default + max_hear_distance = 32, -- default + loop = true, -- only sounds connected to objects can be looped +} + +SimpleSoundSpec: +eg. "" +eg. "default_place_node" +eg. {} +eg. {name="default_place_node"} +eg. {name="default_place_node", gain=1.0} + +Registered definitions of stuff +-------------------------------- +Anything added using certain minetest.register_* functions get added to +the global minetest.registered_* tables. + +minetest.register_entity(name, prototype table) + -> minetest.registered_entities[name] + +minetest.register_node(name, node definition) + -> minetest.registered_items[name] + -> minetest.registered_nodes[name] + +minetest.register_tool(name, item definition) + -> minetest.registered_items[name] + +minetest.register_craftitem(name, item definition) + -> minetest.registered_items[name] + +Note that in some cases you will stumble upon things that are not contained +in these tables (eg. when a mod has been removed). Always check for +existence before trying to access the fields. + +Example: If you want to check the drawtype of a node, you could do: + +local function get_nodedef_field(nodename, fieldname) + if not minetest.registered_nodes[nodename] then + return nil + end + return minetest.registered_nodes[nodename][fieldname] +end +local drawtype = get_nodedef_field(nodename, "drawtype") + +Example: minetest.get_item_group(name, group) has been implemented as: + +function minetest.get_item_group(name, group) + if not minetest.registered_items[name] or not + minetest.registered_items[name].groups[group] then + return 0 + end + return minetest.registered_items[name].groups[group] +end + +Nodes +------ +Nodes are the bulk data of the world: cubes and other things that take the +space of a cube. Huge amounts of them are handled efficiently, but they +are quite static. + +The definition of a node is stored and can be accessed by name in + minetest.registered_nodes[node.name] +See "Registered definitions of stuff". + +Nodes are passed by value between Lua and the engine. +They are represented by a table: + {name="name", param1=num, param2=num} + +param1 and param2 are 8 bit integers. The engine uses them for certain +automated functions. If you don't use these functions, you can use them to +store arbitrary values. + +The functions of param1 and param2 are determined by certain fields in the +node definition: +param1 is reserved for the engine when paramtype != "none": + paramtype = "light" + ^ The value stores light with and without sun in it's + upper and lower 4 bits. +param2 is reserved for the engine when any of these are used: + liquidtype == "flowing" + ^ The level and some flags of the liquid is stored in param2 + drawtype == "flowingliquid" + ^ The drawn liquid level is read from param2 + drawtype == "torchlike" + drawtype == "signlike" + paramtype2 == "wallmounted" + ^ The rotation of the node is stored in param2. You can make this value + by using minetest.dir_to_wallmounted(). + paramtype2 == "facedir" + ^ The rotation of the node is stored in param2. Furnaces and chests are + rotated this way. Can be made by using minetest.dir_to_facedir(). + Values range 0 - 23 + facedir modulo 4 = axisdir + 0 = y+ 1 = z+ 2 = z- 3 = x+ 4 = x- 5 = y- + facedir's two less significant bits are rotation around the axis + paramtype2 == "leveled" + ^ The drawn node level is read from param2, like flowingliquid + +Nodes can also contain extra data. See "Node Metadata". + +Node drawtypes +--------------- +There are a bunch of different looking node types. These are mostly just +copied from Minetest 0.3; more may be made in the future. + +Look for examples in games/minimal or games/minetest_game. + +- normal +- airlike +- liquid +- flowingliquid +- glasslike +- glasslike_framed +- allfaces +- allfaces_optional +- torchlike +- signlike +- plantlike +- fencelike +- raillike +- nodebox -- See below. EXPERIMENTAL + +Node boxes +----------- +Node selection boxes are defined using "node boxes" + +The "nodebox" node drawtype allows defining visual of nodes consisting of +arbitrary number of boxes. It allows defining stuff like stairs. Only the +"fixed" and "leveled" box type is supported for these. +^ Please note that this is still experimental, and may be incompatibly + changed in the future. + +A nodebox is defined as any of: +{ + -- A normal cube; the default in most things + type = "regular" +} +{ + -- A fixed box (facedir param2 is used, if applicable) + type = "fixed", + fixed = box OR {box1, box2, ...} +} +{ + -- A box like the selection box for torches + -- (wallmounted param2 is used, if applicable) + type = "wallmounted", + wall_top = box, + wall_bottom = box, + wall_side = box +} + +A box is defined as: + {x1, y1, z1, x2, y2, z2} +A box of a regular node would look like: + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + +type = "leveled" is same as "fixed", but y2 will be automaticaly setted to level from param2 + +Ore types +--------------- +These tell in what manner the ore is generated. +All default ores are of the uniformly-distributed scatter type. + +- scatter + Randomly chooses a location and generates a cluster of ore. + If noise_params is specified, the ore will be placed if the 3d perlin noise at + that point is greater than the noise_threshhold, giving the ability to create a non-equal + distribution of ore. +- sheet + Creates a sheet of ore in a blob shape according to the 2d perlin noise described by noise_params. + The relative height of the sheet can be controlled by the same perlin noise as well, by specifying + a non-zero 'scale' parameter in noise_params. IMPORTANT: The noise is not transformed by offset or + scale when comparing against the noise threshhold, but scale is used to determine relative height. + The height of the blob is randomly scattered, with a maximum height of clust_size. + clust_scarcity and clust_num_ores are ignored. + This is essentially an improved version of the so-called "stratus" ore seen in some unofficial mods. +- claylike - NOT YET IMPLEMENTED + Places ore if there are no more than clust_scarcity number of specified nodes within a Von Neumann + neighborhood of clust_size radius. + +Ore attributes +------------------- +Currently supported flags: absheight + - absheight + Also produce this same ore between the height range of -height_max and -height_min. + Useful for having ore in sky realms without having to duplicate ore entries. + +Decoration types +------------------- +The varying types of decorations that can be placed. +The default value is simple, and is currently the only type supported. + +- simple + Creates a 1xHx1 column of a specified node (or a random node from a list, if a decoration + list is specified). Can specify a certain node it must spawn next to, such as water or lava, + for example. Can also generate a decoration of random height between a specified lower and + upper bound. This type of decoration is intended for placement of grass, flowers, cacti, + papyrus, and so on. +- schematic + Copies a box of MapNodes from a specified schematic file (or raw description). Can specify a + probability of a node randomly appearing when placed. This decoration type is intended to be used + for multi-node sized discrete structures, such as trees, cave spikes, rocks, and so on. + +Schematic specifier +-------------------- + A schematic specifier identifies a schematic by either a filename to a Minetest Schematic file (.mts) +or through raw data supplied through Lua, in the form of a table. This table must specify two fields: + - The 'size' field is a 3d vector containing the dimensions of the provided schematic. + - The 'data' field is a flat table of MapNodes making up the schematic, in the order of [z [y [x]]]. +Important: The default value for param1 in MapNodes here is 255, which represents "always place". + +In the bulk MapNode data, param1, instead of the typical light values, instead represents the +probability of that node appearing in the structure. +When passed to minetest.create_schematic, probability is an integer value ranging from 0 to 255: + - A probability value of 0 means that node will never appear (0% chance). + - A probability value of 255 means the node will always appear (100% chance). + - If the probability value p is greater than 0, then there is a (p / 256 * 100)% chance that node + will appear when the schematic is placed on the map. + +Important note: Node aliases cannot be used for a raw schematic provided when registering as a decoration. + +Schematic attributes +--------------------- +Currently supported flags: place_center_x, place_center_y, place_center_z + - place_center_x + Placement of this decoration is centered along the X axis. + - place_center_y + Placement of this decoration is centered along the Y axis. + - place_center_z + Placement of this decoration is centered along the Z axis. + +HUD element types +------------------- +The position field is used for all element types. +To account for differing resolutions, the position coordinates are the percentage of the screen, +ranging in value from 0 to 1. +The name field is not yet used, but should contain a description of what the HUD element represents. +The direction field is the direction in which something is drawn. +0 draws from left to right, 1 draws from right to left, 2 draws from top to bottom, and 3 draws from bottom to top. +The alignment field specifies how the item will be aligned. It ranges from -1 to 1, +with 0 being the center, -1 is moved to the left/up, and 1 is to the right/down. Fractional +values can be used. +The offset field specifies a pixel offset from the position. Contrary to position, +the offset is not scaled to screen size. This allows for some precisely-positioned +items in the HUD. +Below are the specific uses for fields in each type; fields not listed for that type are ignored. + +Note: Future revisions to the HUD API may be incompatible; the HUD API is still in the experimental stages. + +- image + Displays an image on the HUD. + - scale: The scale of the image, with 1 being the original texture size. + Only the X coordinate scale is used. + - text: The name of the texture that is displayed. + - alignment: The alignment of the image. + - offset: offset in pixels from position. +- text + Displays text on the HUD. + - scale: Defines the bounding rectangle of the text. + A value such as {x=100, y=100} should work. + - text: The text to be displayed in the HUD element. + - number: An integer containing the RGB value of the color used to draw the text. + Specify 0xFFFFFF for white text, 0xFF0000 for red, and so on. + - alignment: The alignment of the text. + - offset: offset in pixels from position. +- statbar + Displays a horizontal bar made up of half-images. + - text: The name of the texture that is used. + - number: The number of half-textures that are displayed. + If odd, will end with a vertically center-split texture. + - direction + - offset: offset in pixels from position. +- inventory + - text: The name of the inventory list to be displayed. + - number: Number of items in the inventory to be displayed. + - item: Position of item that is selected. + - direction + +Representations of simple things +-------------------------------- +Position/vector: + {x=num, y=num, z=num} +For helper functions see "Vector helpers". + +pointed_thing: + {type="nothing"} + {type="node", under=pos, above=pos} + {type="object", ref=ObjectRef} + +Items +------ +Node (register_node): + A node from the world +Tool (register_tool): + A tool/weapon that can dig and damage things according to tool_capabilities +Craftitem (register_craftitem): + A miscellaneous item + +Items and item stacks can exist in three formats: + +Serialized; This is called stackstring or itemstring: +eg. 'default:dirt 5' +eg. 'default:pick_wood 21323' +eg. 'default:apple' + +Table format: +eg. {name="default:dirt", count=5, wear=0, metadata=""} + ^ 5 dirt nodes +eg. {name="default:pick_wood", count=1, wear=21323, metadata=""} + ^ a wooden pick about 1/3 weared out +eg. {name="default:apple", count=1, wear=0, metadata=""} + ^ an apple. + +ItemStack: +C++ native format with many helper methods. Useful for converting between +formats. See the Class reference section for details. + +When an item must be passed to a function, it can usually be in any of +these formats. + +Groups +------- +In a number of places, there is a group table. Groups define the +properties of a thing (item, node, armor of entity, capabilities of +tool) in such a way that the engine and other mods can can interact with +the thing without actually knowing what the thing is. + +Usage: +- Groups are stored in a table, having the group names with keys and the + group ratings as values. For example: + groups = {crumbly=3, soil=1} + ^ Default dirt + groups = {crumbly=2, soil=1, level=2, outerspace=1} + ^ A more special dirt-kind of thing +- Groups always have a rating associated with them. If there is no + useful meaning for a rating for an enabled group, it shall be 1. +- When not defined, the rating of a group defaults to 0. Thus when you + read groups, you must interpret nil and 0 as the same value, 0. + +You can read the rating of a group for an item or a node by using + minetest.get_item_group(itemname, groupname) + +Groups of items +---------------- +Groups of items can define what kind of an item it is (eg. wool). + +Groups of nodes +---------------- +In addition to the general item things, groups are used to define whether +a node is destroyable and how long it takes to destroy by a tool. + +Groups of entities +------------------- +For entities, groups are, as of now, used only for calculating damage. +The rating is the percentage of damage caused by tools with this damage group. +See "Entity damage mechanism". + +object.get_armor_groups() -> a group-rating table (eg. {fleshy=100}) +object.set_armor_groups({fleshy=30, cracky=80}) + +Groups of tools +---------------- +Groups in tools define which groups of nodes and entities they are +effective towards. + +Groups in crafting recipes +--------------------------- +An example: Make meat soup from any meat, any water and any bowl +{ + output = 'food:meat_soup_raw', + recipe = { + {'group:meat'}, + {'group:water'}, + {'group:bowl'}, + }, + -- preserve = {'group:bowl'}, -- Not implemented yet (TODO) +} +An another example: Make red wool from white wool and red dye +{ + type = 'shapeless', + output = 'wool:red', + recipe = {'wool:white', 'group:dye,basecolor_red'}, +} + +Special groups +--------------- +- immortal: Disables the group damage system for an entity +- level: Can be used to give an additional sense of progression in the game. + - A larger level will cause eg. a weapon of a lower level make much less + damage, and get weared out much faster, or not be able to get drops + from destroyed nodes. + - 0 is something that is directly accessible at the start of gameplay + - There is no upper limit +- dig_immediate: (player can always pick up node without tool wear) + - 2: node is removed without tool wear after 0.5 seconds or so + (rail, sign) + - 3: node is removed without tool wear immediately (torch) +- disable_jump: Player (and possibly other things) cannot jump from node +- fall_damage_add_percent: damage speed = speed * (1 + value/100) +- bouncy: value is bounce speed in percent +- falling_node: if there is no walkable block under the node it will fall +- attached_node: if the node under it is not a walkable block the node will be + dropped as an item. If the node is wallmounted the + wallmounted direction is checked. +- soil: saplings will grow on nodes in this group +- connect_to_raillike: makes nodes of raillike drawtype connect to + other group members with same drawtype + +Known damage and digging time defining groups +---------------------------------------------- +- crumbly: dirt, sand +- cracky: tough but crackable stuff like stone. +- snappy: something that can be cut using fine tools; eg. leaves, small + plants, wire, sheets of metal +- choppy: something that can be cut using force; eg. trees, wooden planks +- fleshy: Living things like animals and the player. This could imply + some blood effects when hitting. +- explody: Especially prone to explosions +- oddly_breakable_by_hand: + Can be added to nodes that shouldn't logically be breakable by the + hand but are. Somewhat similar to dig_immediate, but times are more + like {[1]=3.50,[2]=2.00,[3]=0.70} and this does not override the + speed of a tool if the tool can dig at a faster speed than this + suggests for the hand. + +Examples of custom groups +-------------------------- +Item groups are often used for defining, well, //groups of items//. +- meat: any meat-kind of a thing (rating might define the size or healing + ability or be irrelevant - it is not defined as of yet) +- eatable: anything that can be eaten. Rating might define HP gain in half + hearts. +- flammable: can be set on fire. Rating might define the intensity of the + fire, affecting eg. the speed of the spreading of an open fire. +- wool: any wool (any origin, any color) +- metal: any metal +- weapon: any weapon +- heavy: anything considerably heavy + +Digging time calculation specifics +----------------------------------- +Groups such as **crumbly**, **cracky** and **snappy** are used for this +purpose. Rating is 1, 2 or 3. A higher rating for such a group implies +faster digging time. + +The **level** group is used to limit the toughness of nodes a tool can dig +and to scale the digging times / damage to a greater extent. + +^ PLEASE DO UNDERSTAND THIS, otherwise you cannot use the system to it's + full potential. + +Tools define their properties by a list of parameters for groups. They +cannot dig other groups; thus it is important to use a standard bunch of +groups to enable interaction with tools. + +**Tools define:** + * Full punch interval + * Maximum drop level + * For an arbitrary list of groups: + * Uses (until the tool breaks) + * Maximum level (usually 0, 1, 2 or 3) + * Digging times + * Damage groups + +**Full punch interval**: +When used as a weapon, the tool will do full damage if this time is spent +between punches. If eg. half the time is spent, the tool will do half +damage. + +**Maximum drop level** +Suggests the maximum level of node, when dug with the tool, that will drop +it's useful item. (eg. iron ore to drop a lump of iron). +- This is not automated; it is the responsibility of the node definition + to implement this + +**Uses** +Determines how many uses the tool has when it is used for digging a node, +of this group, of the maximum level. For lower leveled nodes, the use count +is multiplied by 3^leveldiff. +- uses=10, leveldiff=0 -> actual uses: 10 +- uses=10, leveldiff=1 -> actual uses: 30 +- uses=10, leveldiff=2 -> actual uses: 90 + +**Maximum level** +Tells what is the maximum level of a node of this group that the tool will +be able to dig. + +**Digging times** +List of digging times for different ratings of the group, for nodes of the +maximum level. + * For example, as a lua table, ''times={2=2.00, 3=0.70}''. This would + result in the tool to be able to dig nodes that have a rating of 2 or 3 + for this group, and unable to dig the rating 1, which is the toughest. + Unless there is a matching group that enables digging otherwise. + +**Damage groups** +List of damage for groups of entities. See "Entity damage mechanism". + +Example definition of the capabilities of a tool +------------------------------------------------- +tool_capabilities = { + full_punch_interval=1.5, + max_drop_level=1, + groupcaps={ + crumbly={maxlevel=2, uses=20, times={[1]=1.60, [2]=1.20, [3]=0.80}} + } + damage_groups = {fleshy=2}, +} + +This makes the tool be able to dig nodes that fullfill both of these: +- Have the **crumbly** group +- Have a **level** group less or equal to 2 + +Table of resulting digging times: +crumbly 0 1 2 3 4 <- level + -> 0 - - - - - + 1 0.80 1.60 1.60 - - + 2 0.60 1.20 1.20 - - + 3 0.40 0.80 0.80 - - + +level diff: 2 1 0 -1 -2 + +Table of resulting tool uses: + -> 0 - - - - - + 1 180 60 20 - - + 2 180 60 20 - - + 3 180 60 20 - - + +Notes: +- At crumbly=0, the node is not diggable. +- At crumbly=3, the level difference digging time divider kicks in and makes + easy nodes to be quickly breakable. +- At level > 2, the node is not diggable, because it's level > maxlevel + +Entity damage mechanism +------------------------ +Damage calculation: +damage = 0 +foreach group in cap.damage_groups: + damage += cap.damage_groups[group] * limit(actual_interval / cap.full_punch_interval, 0.0, 1.0) + * (object.armor_groups[group] / 100.0) + -- Where object.armor_groups[group] is 0 for inexisting values +return damage + +Client predicts damage based on damage groups. Because of this, it is able to +give an immediate response when an entity is damaged or dies; the response is +pre-defined somehow (eg. by defining a sprite animation) (not implemented; +TODO). +- Currently a smoke puff will appear when an entity dies. + +The group **immortal** completely disables normal damage. + +Entities can define a special armor group, which is **punch_operable**. This +group disables the regular damage mechanism for players punching it by hand or +a non-tool item, so that it can do something else than take damage. + +On the Lua side, every punch calls ''entity:on_punch(puncher, +time_from_last_punch, tool_capabilities, direction)''. This should never be +called directly, because damage is usually not handled by the entity itself. + * ''puncher'' is the object performing the punch. Can be nil. Should never be + accessed unless absolutely required, to encourage interoperability. + * ''time_from_last_punch'' is time from last punch (by puncher) or nil. + * ''tool_capabilities'' can be nil. + * ''direction'' is a unit vector, pointing from the source of the punch to + the punched object. + +To punch an entity/object in Lua, call ''object:punch(puncher, +time_from_last_punch, tool_capabilities, direction)''. + * Return value is tool wear. + * Parameters are equal to the above callback. + * If ''direction'' is nil and ''puncher'' is not nil, ''direction'' will be + automatically filled in based on the location of ''puncher''. + +Node Metadata +------------- +The instance of a node in the world normally only contains the three values +mentioned in "Nodes". However, it is possible to insert extra data into a +node. It is called "node metadata"; See "NodeMetaRef". + +Metadata contains two things: +- A key-value store +- An inventory + +Some of the values in the key-value store are handled specially: +- formspec: Defines a right-click inventory menu. See "Formspec". +- infotext: Text shown on the screen when the node is pointed at + +Example stuff: + +local meta = minetest.get_meta(pos) +meta:set_string("formspec", + "invsize[8,9;]".. + "list[context;main;0,0;8,4;]".. + "list[current_player;main;0,5;8,4;]") +meta:set_string("infotext", "Chest"); +local inv = meta:get_inventory() +inv:set_size("main", 8*4) +print(dump(meta:to_table())) +meta:from_table({ + inventory = { + main = {[1] = "default:dirt", [2] = "", [3] = "", [4] = "", [5] = "", [6] = "", [7] = "", [8] = "", [9] = "", [10] = "", [11] = "", [12] = "", [13] = "", [14] = "default:cobble", [15] = "", [16] = "", [17] = "", [18] = "", [19] = "", [20] = "default:cobble", [21] = "", [22] = "", [23] = "", [24] = "", [25] = "", [26] = "", [27] = "", [28] = "", [29] = "", [30] = "", [31] = "", [32] = ""} + }, + fields = { + formspec = "invsize[8,9;]list[context;main;0,0;8,4;]list[current_player;main;0,5;8,4;]", + infotext = "Chest" + } +}) + +Formspec +-------- +Formspec defines a menu. Currently not much else than inventories are +supported. It is a string, with a somewhat strange format. + +Spaces and newlines can be inserted between the blocks, as is used in the +examples. + +Examples: +- Chest: + invsize[8,9;] + list[context;main;0,0;8,4;] + list[current_player;main;0,5;8,4;] +- Furnace: + invsize[8,9;] + list[context;fuel;2,3;1,1;] + list[context;src;2,1;1,1;] + list[context;dst;5,1;2,2;] + list[current_player;main;0,5;8,4;] +- Minecraft-like player inventory + invsize[8,7.5;] + image[1,0.6;1,2;player.png] + list[current_player;main;0,3.5;8,4;] + list[current_player;craft;3,0;3,3;] + list[current_player;craftpreview;7,1;1,1;] + +Elements: + +size[,] +^ Define the size of the menu in inventory slots +^ deprecated: invsize[,;] + +list[;;,;,;] +list[;;,;,;] +^ Show an inventory list + +image[,;,;] +^ Show an image +^ Position and size units are inventory slots + +item_image[,;,;] +^ Show an inventory image of registered item/node +^ Position and size units are inventory slots + +background[,;,;] +^ Use a background. Inventory rectangles are not drawn then. +^ Position and size units are inventory slots +^ Example for formspec 8x4 in 16x resolution: image shall be sized 8*16px x 4*16px + +pwdfield[,;,;;