From 843ffba567d9b9cb170e9d9cc76469e796ca93cb Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sat, 28 May 2011 02:17:19 +0200 Subject: [PATCH 001/158] + sandstone --- data/sandstone.png | Bin 0 -> 772 bytes src/mapnode.cpp | 8 ++++++++ src/mapnode.h | 1 + src/materials.cpp | 1 + src/server.cpp | 16 ++++++++++++++++ src/tile.cpp | 1 + 6 files changed, 27 insertions(+) create mode 100644 data/sandstone.png diff --git a/data/sandstone.png b/data/sandstone.png new file mode 100644 index 0000000000000000000000000000000000000000..c4759b4d0289346f97ba69c44230d34b409c2a1d GIT binary patch literal 772 zcmV+f1N;1mP)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RW1sfMI6;LOBPXGV{mPtfGR4C5{ z!E18bH~;`(OP2f$et=CNWJ^K{G-;>P8}#>{aZl6C3N>(IRF3nVOcihLMV#DDE)GOzgR96 zDKXX{1ZkQ;sD@!ko5u4zP1AxPXifw{MXBn#s%u866e3O%+qP%3SzZ)U%BE??5F*VqXD_u7XL*GW*G)peVV~p`?wWf@&*Xz5x_pe1+Rh5cV z#Jg_4j}b<;WpeHU)lsA<53dkHP19P&eBb~5`+4zhxmvx@hQcrm!XWS*=jYQe#uz)D zo}ZpCFD{i%wu}khA%tAV$@6^BA7ojITGnDsGjx402yEMWdHLn}ZXCxdQu~&lw7kp< zLQaE0KpQ%JGlh&X!!!`a^@;5Fe_Gz1**!vt>$nIZ+qPTIgD{-W=f3Yp+X$Mb>GYiD zbmA?~i@dHYP1D-8MHuis_ground_content = true; f->dug_item = std::string("MaterialItem ")+itos(i)+" 1"; + i = CONTENT_SANDSTONE; + f = &g_content_features[i]; + f->setAllTextures("sandstone.png"); + f->setInventoryTextureCube("sandstone.png", "sandstone.png", "sandstone.png"); + f->param_type = CPT_MINERAL; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem ")+itos(CONTENT_SAND)+" 1"; + i = CONTENT_TREE; f = &g_content_features[i]; f->setAllTextures("tree.png"); diff --git a/src/mapnode.h b/src/mapnode.h index 57382aa..ad25658 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -101,6 +101,7 @@ void init_content_inventory_texture_paths(); #define CONTENT_STEEL 19 #define CONTENT_GLASS 20 #define CONTENT_FENCE 21 +#define CONTENT_SANDSTONE 22 /* Content feature list diff --git a/src/materials.cpp b/src/materials.cpp index 841f1d6..60c1894 100644 --- a/src/materials.cpp +++ b/src/materials.cpp @@ -59,6 +59,7 @@ void initializeMaterialProperties() */ setStoneLikeDiggingProperties(CONTENT_STONE, 1.0); + setStoneLikeDiggingProperties(CONTENT_SANDSTONE, 1.0); setStoneLikeDiggingProperties(CONTENT_MESE, 0.5); setStoneLikeDiggingProperties(CONTENT_COALSTONE, 1.5); setStoneLikeDiggingProperties(CONTENT_FURNACE, 3.0); diff --git a/src/server.cpp b/src/server.cpp index 9248e62..c7b64f4 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -3972,6 +3972,21 @@ void Server::UpdateCrafting(u16 peer_id) found = true; } } + + // Sandstone + if(!found) + { + ItemSpec specs[9]; + specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND); + specs[4] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND); + specs[6] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND); + specs[7] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND); + if(checkItemCombination(items, specs)) + { + rlist->addItem(new MaterialItem(CONTENT_SANDSTONE, 1)); + found = true; + } + } } } // if creative_mode == false @@ -4060,6 +4075,7 @@ void setCreativeInventory(Player *player) CONTENT_MUD, CONTENT_STONE, CONTENT_SAND, + CONTENT_SANDSTONE, CONTENT_TREE, CONTENT_LEAVES, CONTENT_GLASS, diff --git a/src/tile.cpp b/src/tile.cpp index dabc1dc..8b0c3f2 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -506,6 +506,7 @@ void TextureSource::buildMainAtlas() sourcelist.push_back("stone.png"); sourcelist.push_back("mud.png"); sourcelist.push_back("sand.png"); + sourcelist.push_back("sandstone.png"); sourcelist.push_back("grass.png"); sourcelist.push_back("grass_footsteps.png"); sourcelist.push_back("tree.png"); From 2176f4d69787e11033dd08fc4377a60b67682a88 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sun, 29 May 2011 18:45:50 +0200 Subject: [PATCH 002/158] * better player graphics --- data/player.png | Bin 212 -> 652 bytes data/player_back.png | Bin 201 -> 292 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/data/player.png b/data/player.png index 90adf97476ecd3442dcd435201658ebfaef9d7ab..60ac4854ba00dc30c692e4fafdd6a0810d0806fb 100644 GIT binary patch delta 615 zcmV-t0+{{O0gMHZ91;O+j>uX70004VQb$4nuFf3kks%m=2XskIMF-mj8Wt-G&1bc8 z0006WNkl za=B9FRR7YO=47|M4gl=;>I{HoZ9@B^V9|zNoh@5`FaVHc3*K+GGgCGJfGJ3a_+?QG zX_HhRx4&v9XTw$y^81d) zAnha>yo=2RB@qfcE+raX_;Q(WuSuj)>f-e2AX>csR?`{O#Y{~lnkAc}HcPb`&0+`5 zVn^$LB=HNH#mV{+oOgBSUFW3Uvk&K=R+>gxgWK91{{fAO1W^PJsc!%P002ovPDHLkV1jeR B8#n*} delta 172 zcmV;d08{^r1=InM90dRyiTKQsE*O7?Nkl569sGa~0-TA{S>tn2Gi5US)fn%_IB-w+G!_iCux}jBA8FpZ a2p}uF=p{1q#6|1?0000tn$piC43Xx-kl$iBc~N0|PJu@#W4uyc&%2juPR5|Nn^-V_;xl!5R1e|Kp2FxFn;D zy7B+;@>$r;V1zi3@&7-p@+&*jFv9>Pnc~nmnvk$0Bv@z@3V%Rs>R1>U7#PYW=fMTK zo+aRol`^RXaQ-Ul`u07gbEDUgvuFW@QNFkSHW(_ail?>_&f%00000NkvXXu0mjfat}zN From 00763399142cd196e7b4d947485e53409947b559 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sun, 29 May 2011 18:47:40 +0200 Subject: [PATCH 003/158] * enemies are now omsk birds --- data/oerkki1.png | Bin 212 -> 270 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/data/oerkki1.png b/data/oerkki1.png index c32fb99dbc9381cba551ef0c96482624ec72792a..aad2ddb41faada144601bfaaf02cdd814ad4bb97 100644 GIT binary patch delta 242 zcmVNklS|Iv5xjI14-?iy0XBj({-ZRBb+KpkSG&i(`mK=i5o% zd4 i%EWmS7?>p*UNGiaDqB1j Date: Sun, 29 May 2011 18:48:21 +0200 Subject: [PATCH 004/158] * better rat graphics --- data/rat.png | Bin 920 -> 276 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/data/rat.png b/data/rat.png index d1a0e2ae26ad41a751c99ea84e79f45e58c1970b..96d44c3fae171d9d1e59d8137315f0d61697abd5 100644 GIT binary patch delta 249 zcmbQiK80z5ay0vvp$^%if|TqL>4nJa0`Pl zBg3pY5H=O_S>w|46-Jwyp7yIp(&m&jv*T7k4{+2cgR4*%|AZTaa)>iRJ&4! zNE7?K8MES+J&QQRGdX2_fx1WiHHK-*`TMHh@&753X5Fw(U+=nf!;`Q6CArKFp|U|A zDy*10R+}J8FRZr-*8JVbup?^m vlrF`5-K literal 920 zcmZvaJ!n-y5QPULFCirUU?XA`wh*xjSlMWNAr450`asJBZ6q8>WvisK2!UfERspe) z1X7NzKa~VcD-76Jh=uTwfDaMIxi=8reb)=SJA2vL@64Hfy0o}3J$Y_YM5gsd_jazQ za!gEga_&ER{9I&AmTvaua~t)DdWqac^|`y5kp!Tsr4$!25sE-WMM`G1ez}X8kOGLR zl>Z%aaTB8u0u?QJQ!A~F4>KnXpejlU(g9Ot#(=9@2CANON)0zR8bK(uXt6LlVNhy8 zVGs^AEi4GA=ZT`BrOtOBp{dz05abav{W-*@mWrJGws{fePP0r@AWzU8W=duZ_q;y? zbKK%5-<(=)Bsg>TXmBGm~SI56h&E4I5{qp_WweKe$eqQ+98QWd!A3PXr aZfsua$n2l Date: Sun, 29 May 2011 18:48:39 +0200 Subject: [PATCH 005/158] * better glass graphics --- data/glass.png | Bin 1309 -> 381 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/data/glass.png b/data/glass.png index 8598ce670f502802f166eb4b8d07a871b564d263..35ea596d54c5b3e0b55adb0081b71464f665b846 100644 GIT binary patch delta 338 zcmV-Y0j>U>3jG3*87Bq+001BJ|6u?C00DDSM?wIu&K&6g000JJOGiWiE&wzDHfw6~ z&yz_6Ab%SGGB7ZFeSZJ|0R2fsK~y-)rIWu3f>0R6&n>f|KSB@`K~lCf7Ck{j1mSD+ zP>#KVTkTDOLxTiDG(<*O2-UTSY%(*o4A1!8dw(3xcP^1+#YP;(0Z6i9ClFJKf7}F} zdjQ=gPb68fACF+pP;8M;hzHPU6i`iZgwng`;eTpnLRI%KNGJdR`u#do)qrKWka9VT z?UsVlo6i*!WR>T0U>KLpvPtZAXXyIndx(yT#f%5w%nZYd1_)E9Q~Dn;9xpMSuA}$h zJv;#D^=jB`&d{{O?;Z@=0vS!_zDuGgV6iy9dJ?*YN+plkOedcJmQBJmuQ;8qz8)}9 kf*%3^j!Os5N!;)J1a@y_++PjCNdN!<07*qoM6N<$f?NlT-T(jq literal 1309 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstPBjy3;{kN zu0Zi+OHM9Za&G0alPi{;S+(Nq;>A}MExNj7@s+h}Z*ARrcgK!uU~(E|NiU8k3YYD{r&Uj-@kwV zfrgKQ(GVESArKNB#>2qC$WRjG7yN%@1BT%5?5e=H;w Date: Sun, 29 May 2011 18:49:02 +0200 Subject: [PATCH 006/158] * better heart icon --- data/heart.png | Bin 220 -> 258 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/data/heart.png b/data/heart.png index ddd273dd2f09fa7574ebb3f4ec6d802be1d259bb..bea1aefd6b22e3268f88db0eb26188b1cb362f81 100644 GIT binary patch delta 210 zcmV;@04@LA0fGXMBnkm@Qb$4nuFf3kkuey52XskIMF-mj8W%GHKxNM^0001#NklVQ zc5uf$mMgo6z)RnOHGYBE@E2eNX~Qny4B~~m3Xq?rh593L2{H=50gdG}LP=Bz2nYy#2xN$nE*O7)NklQ4)Y42t*%UJUY4k z#EjBnCSU5Z4+b;{L0Gw0?Z)FECC8qnM*(q>F)p6?a(qP a#|;$zH6R>2y-aQZ0000 Date: Sun, 29 May 2011 19:03:05 +0200 Subject: [PATCH 007/158] + README in main directory --- README | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..e3e3a34 --- /dev/null +++ b/README @@ -0,0 +1,14 @@ +Minetest Δ (“Minetest Delta”) is a fork of Minetest-c55 , incorporating experimental features that are not (yet) included in Minetest-c55. + +New bricks: +* Sandstone (crafted from 4 sand) + +Alternate graphics: +* Player +* Omsk birds (instead of Oerkki ghosts) +* Rat +* Glass + +Building on GNU/Linux: + cmake . -DRUN_IN_PLACE=1 + make -j2 From af574e58fe65e230f563f996496f31ce60291dc3 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sun, 29 May 2011 19:08:59 +0200 Subject: [PATCH 008/158] + .gitignore --- .gitignore | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..64ebbef --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +map/* +CMakeFiles/* +src/CMakeFiles/* +src/Makefile +src/cmake_config.h +src/cmake_install.cmake +src/jthread/CMakeFiles/* +src/jthread/Makefile +src/jthread/cmake_config.h +src/jthread/cmake_install.cmake +minetest.conf +bin/ +CMakeCache.txt +CPackConfig.cmake +CPackSourceConfig.cmake +Makefile +cmake_install.cmake +src/jthread/libjthread.a +debug.txt From ca26de72c93c03cbfbd90254f3cb09c86929405a Mon Sep 17 00:00:00 2001 From: teddydestodes Date: Sun, 29 May 2011 19:17:42 +0200 Subject: [PATCH 009/158] fast_move and free_move can now be toggled --- src/defaultsettings.cpp | 2 ++ src/game.cpp | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index f11b0b2..e2ace0f 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -40,6 +40,8 @@ void set_default_settings() g_settings.setDefault("keymap_inventory", "KEY_KEY_I"); g_settings.setDefault("keymap_chat", "KEY_KEY_T"); g_settings.setDefault("keymap_rangeselect", "KEY_KEY_R"); + g_settings.setDefault("keymap_freemove", "KEY_KEY_K"); + g_settings.setDefault("keymap_fastmove", "KEY_KEY_J"); // Some (temporary) keys for debugging g_settings.setDefault("keymap_special1", "KEY_KEY_E"); g_settings.setDefault("keymap_print_debug_stacks", "KEY_KEY_P"); diff --git a/src/game.cpp b/src/game.cpp index 603a86d..7970a6e 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1147,6 +1147,28 @@ void the_game( &g_menumgr, dest, L""))->drop(); } + else if(input->wasKeyDown(getKeySetting("keymap_freemove"))) + { + if(g_settings.getBool("free_move")) + { + g_settings.set("free_move","false"); + } + else + { + g_settings.set("free_move","true"); + } + } + else if(input->wasKeyDown(getKeySetting("keymap_fastmove"))) + { + if(g_settings.getBool("fast_move")) + { + g_settings.set("fast_move","false"); + } + else + { + g_settings.set("fast_move","true"); + } + } // Item selection with mouse wheel { From cf136f19359dd7983cddd3bdf9cac2c4a4bb8139 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Mon, 30 May 2011 01:08:59 +0800 Subject: [PATCH 010/158] + .gitignore --- .gitignore | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..64ebbef --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +map/* +CMakeFiles/* +src/CMakeFiles/* +src/Makefile +src/cmake_config.h +src/cmake_install.cmake +src/jthread/CMakeFiles/* +src/jthread/Makefile +src/jthread/cmake_config.h +src/jthread/cmake_install.cmake +minetest.conf +bin/ +CMakeCache.txt +CPackConfig.cmake +CPackSourceConfig.cmake +Makefile +cmake_install.cmake +src/jthread/libjthread.a +debug.txt From 880aa870a0316d8f2f3081bf117e8237af270405 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Mon, 30 May 2011 14:42:08 +0200 Subject: [PATCH 011/158] + cactii --- data/cactus_side.png | Bin 0 -> 279 bytes data/cactus_top.png | Bin 0 -> 236 bytes src/map.cpp | 34 +++++++++++++++++++++++++++------- src/mapnode.cpp | 10 ++++++++++ src/mapnode.h | 1 + src/materials.cpp | 1 + src/server.cpp | 1 + src/tile.cpp | 2 ++ 8 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 data/cactus_side.png create mode 100644 data/cactus_top.png diff --git a/data/cactus_side.png b/data/cactus_side.png new file mode 100644 index 0000000000000000000000000000000000000000..fc479fde6f9dc859180035ee3974c1ffb198136c GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfZB`jZWp;PomG6K;D?MEtLo7~D4L-=rY{;P;c16+3{n-l% zo~ed;eP=Ez`Yn%(4-t`E_f#~I{kX%e3w8I{TaFg*RY{ut?$eCz{CxZyIx2VPG@9~r zZQ$N`V^(`YhJWbVie+|NxV1vH&%KG{n|R>FnR!nIIRDA$8gwV9DF68PV|r!x+xxa1 z7OQ5aKdf9aEA`u|RHvmWwkM{&$ri5PD)@0z=fB4(7Jq%hlfQ_~?wB+4)Kv-dyH9y{ X24^3`sfZB`jZNz+xuYT`hlI!_nJ5R21mgAWQGP~hmUw3wG%qH+91 z#ors@(R%K#RZo|4aJp!$z24aJ_IBg7*R{{RnoMW&Ft8p7NI$mX y_nodes_max - 6) continue; v3s16 p(x,y,z); - /* - Trees grow only on mud and grass - */ { u32 i = data->vmanip.m_area.index(v3s16(p)); MapNode *n = &data->vmanip.m_data[i]; - if(n->d != CONTENT_MUD && n->d != CONTENT_GRASS) + if(n->d != CONTENT_MUD && n->d != CONTENT_GRASS && n->d != CONTENT_SAND) continue; + // Trees grow only on mud and grass + if(n->d == CONTENT_MUD || n->d == CONTENT_GRASS) + { + p.Y++; + make_tree(data->vmanip, p); + } + // Cactii grow only on sand + if(n->d == CONTENT_SAND) + { + p.Y++; + make_cactus(data->vmanip, p); + } } - p.Y++; - // Make a tree - make_tree(data->vmanip, p); } } /*u32 tree_max = relative_area / 60; diff --git a/src/mapnode.cpp b/src/mapnode.cpp index c006b82..8ceeecf 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -215,6 +215,16 @@ void init_mapnode() } f->dug_item = std::string("MaterialItem ")+itos(i)+" 1"; + i = CONTENT_CACTUS; + f = &g_content_features[i]; + f->setAllTextures("cactus_side.png"); + f->setTexture(0, "cactus_top.png"); + f->setTexture(1, "cactus_top.png"); + f->setInventoryTextureCube("cactus_top.png", "cactus_side.png", "cactus_side.png"); + f->param_type = CPT_MINERAL; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem ")+itos(i)+" 1"; + i = CONTENT_GLASS; f = &g_content_features[i]; f->light_propagates = true; diff --git a/src/mapnode.h b/src/mapnode.h index ad25658..c4dcbfb 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -102,6 +102,7 @@ void init_content_inventory_texture_paths(); #define CONTENT_GLASS 20 #define CONTENT_FENCE 21 #define CONTENT_SANDSTONE 22 +#define CONTENT_CACTUS 23 /* Content feature list diff --git a/src/materials.cpp b/src/materials.cpp index 60c1894..a1d4195 100644 --- a/src/materials.cpp +++ b/src/materials.cpp @@ -73,6 +73,7 @@ void initializeMaterialProperties() setWoodLikeDiggingProperties(CONTENT_TREE, 1.0); setWoodLikeDiggingProperties(CONTENT_LEAVES, 0.15); + setWoodLikeDiggingProperties(CONTENT_CACTUS, 0.75); setWoodLikeDiggingProperties(CONTENT_GLASS, 0.15); setWoodLikeDiggingProperties(CONTENT_FENCE, 0.75); setWoodLikeDiggingProperties(CONTENT_WOOD, 0.75); diff --git a/src/server.cpp b/src/server.cpp index c7b64f4..994e62e 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -4078,6 +4078,7 @@ void setCreativeInventory(Player *player) CONTENT_SANDSTONE, CONTENT_TREE, CONTENT_LEAVES, + CONTENT_CACTUS, CONTENT_GLASS, CONTENT_FENCE, CONTENT_MESE, diff --git a/src/tile.cpp b/src/tile.cpp index 8b0c3f2..2a2d2a7 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -513,6 +513,8 @@ void TextureSource::buildMainAtlas() sourcelist.push_back("tree_top.png"); sourcelist.push_back("water.png"); sourcelist.push_back("leaves.png"); + sourcelist.push_back("cactus_side.png"); + sourcelist.push_back("cactus_top.png"); sourcelist.push_back("glass.png"); sourcelist.push_back("mud.png^grass_side.png"); sourcelist.push_back("cobble.png"); From 0f4c83eb986dd48bf3745266d7cbdb9a4bf19507 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Tue, 31 May 2011 02:56:23 +0200 Subject: [PATCH 012/158] * improved fence dimensions (cuboid side lengths now multiples of 2, textures should fit better) --- src/mapblock.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mapblock.cpp b/src/mapblock.cpp index c448ef2..d98bfaf 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -1563,8 +1563,8 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data) u8 l = decode_light(undiminish_light(n.getLightBlend(data->m_daynight_ratio))); video::SColor c(255,l,l,l); - const f32 post_rad=(f32)BS/10; - const f32 bar_rad=(f32)BS/20; + const f32 post_rad=(f32)BS/(32.0/4.0); + const f32 bar_rad=(f32)BS/(32.0/2.0); const f32 bar_len=(f32)(BS/2)-post_rad; // The post - always present @@ -1581,12 +1581,12 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data) { pos = intToFloat(p+blockpos_nodes, BS); pos.X += BS/2; - pos.Y += BS/4; + pos.Y += 3*bar_rad; makeCuboid(material_wood, &collector, &pa_wood, c, pos, bar_len,bar_rad,bar_rad); - pos.Y -= BS/2; + pos.Y -= 6*bar_rad; makeCuboid(material_wood, &collector, &pa_wood, c, pos, bar_len,bar_rad,bar_rad); @@ -1600,11 +1600,11 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data) { pos = intToFloat(p+blockpos_nodes, BS); pos.Z += BS/2; - pos.Y += BS/4; + pos.Y += 3*bar_rad; makeCuboid(material_wood, &collector, &pa_wood, c, pos, bar_rad,bar_rad,bar_len); - pos.Y -= BS/2; + pos.Y -= 6*bar_rad; makeCuboid(material_wood, &collector, &pa_wood, c, pos, bar_rad,bar_rad,bar_len); From 6c3ca42e0e0096c481aa09da3c78be1901920899 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Tue, 31 May 2011 02:56:41 +0200 Subject: [PATCH 013/158] + fence inventory icon --- data/fence.png | Bin 0 -> 539 bytes src/mapnode.cpp | 1 + 2 files changed, 1 insertion(+) create mode 100644 data/fence.png diff --git a/data/fence.png b/data/fence.png new file mode 100644 index 0000000000000000000000000000000000000000..0b99f0eb5dd6b27c9f478cc1eb8a510b59a97ea6 GIT binary patch literal 539 zcmV+$0_6RPP)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RW1s?%42*8A&2LJ#8tw}^dR5;7c zkw0(KP!vax?dRBmkQAG!NGT}lz<>%W5)uPak&qA)Ux6JlF*7i+AoXjoAXZoyU;_!1 zg|ed{k>I2v#f}@l=YNl(RosSV>cXAxJ@?+bkdv>#bqen>=~C zed1xyAKlYoln_QUl*)Pee#a01zbBd%D@QmAfn2)n-G@&&ZXL&U5yGx6Snr-eTP0-{ zl0=dhkMHUqgCTk9(Dns&x51a*H?Cj1O1wWKj%TDG;G^NX@Vr?v9WuMaq=CC@R3$?-Odape6*CW%BxC|1g6oFqpq^voqG6)i#~g3p5*N zdD|Nw06e=uTPE5BjOAi=q@k5ylqJStp8z=LT|t+MvQ(gprGVR88zfQ@#WN;=`f@YJ&>4Qa#d+Vy5DkK#!9ThMz@1w+ zj_K(K5%IpnEK;1&6xSZ1Gs%Pdo5ys|0gHNe`nyMxRF#EbPaoA?0Y)LN#az#u-uT1} d7Ipt0^%oDf&+9E}8chHI002ovPDHLkV1kTAsetInventoryTexture("fence.png"); f->light_propagates = true; f->param_type = CPT_LIGHT; f->is_ground_content = true; From 461f53945d9d512dc7613a86cd03108dc9530681 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Tue, 31 May 2011 20:52:20 +0200 Subject: [PATCH 014/158] * menulogo now shows minetest delta --- data/menulogo.png | Bin 498 -> 653 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/data/menulogo.png b/data/menulogo.png index 76595c48dc78e626365261633ec9f13b5e5eeaac..cb6983e5c6c2db4b98b810a236cb9df1f9680e4a 100644 GIT binary patch delta 609 zcmV-n0-pWy1C0fcBnkm@Qb$4nuFf3kkuev400(qQO+^RW1s?(j6;-b&w*UYFA4x<( zR9M69SG{T+F%bR)SEh2nE0; zUa+PxwO3NpLMLP*J~`7OZIobs3_@(e{j^!U35jjyPqG`j9;m} zHl#OG2Cv?)P}en@ra@IzaLz@2PeL`c2$51jsfgHB5i%wfJyc;+`u-_}$HW3gm7;6A zh)`T~>2I^SANun31OV{*)psaNwJ8uTHXRlc^eq_=Qf*z=0D#r1C1q7r+erAYrop|H vD4>KSOzvKr4A)W;($pYs^3}B`q1GCA9>Sp3AfMH^00000NkvXXu0mjfK|vn$ delta 453 zcmV;$0XqJT1@Z%sBn<>}LP=Bz2nYy#2xN$nE*F0Rlu1NER9J=WSKW=nAPoMH`gl8J z2?lWA?=1tJZ=lR@48RhZ#P^U=0W}0@Qt5R4BvgVw|B%`c8@%zxSrCZ2ZeW7!!pu4e z01+k6&bg{=Z!Ol(ZD{%$T6w)T^LUQ%t>MT$_U=yuGn-ulBM=B*3qC8d2RP@%IVWMB z|Av3L#xLo&@*e`f6-!<;noi7Vv3Zv795o-Y?jEnz-sxb-eZJYrMei^{x5qjk}awxvf^-tKdIA0RYz8R6v|Ob|oP2 z{Dz)Q;{Sru`-yK8A~LPK(*k7}CI~wuKGuJAO=#9yc<=A?fbIl50xe0X$!^E^@XM^( zWaeT#qgUL>AOGwgUy55J!2pu<6Uh8MV_6og>xyZb;Jr`gAqh=u6QX^{?llo-H6bM% zE%K7hmIfrpo^K6D$1@UljF9XiEXI7*1Cz8a;zojhvi0byU6us^Fwa|3PSXTnI|(iS vMy0)RIz+aEC{IEjy}h$ Date: Tue, 31 May 2011 22:04:09 +0200 Subject: [PATCH 015/158] + brick --- data/brick.png | Bin 0 -> 604 bytes src/mapnode.cpp | 8 ++++++++ src/mapnode.h | 1 + src/materials.cpp | 1 + src/server.cpp | 1 + src/tile.cpp | 1 + 6 files changed, 12 insertions(+) create mode 100644 data/brick.png diff --git a/data/brick.png b/data/brick.png new file mode 100644 index 0000000000000000000000000000000000000000..32d77f34787b079f9df729bc398b780be98e83b1 GIT binary patch literal 604 zcmV-i0;BzjP)Px#32;bRa{vGi!~g&e!~vBn4jTXf00(qQO+^RW1snq+G7BMy;s5{v?ny*JR4C6i z(o1g}WdMcYXD;@5E{@YwP1=eLv?)kz5GorgemW}@ghaRrsvuAmk;-wC#*r`a*q$#l zVG%_-tFwB~s}r5DWX$2;zh8av)d77l0}Xrc-qtU^j98MB&WI@4-+!{9CZeUsiY-mk z)MTI}%_$ggcJ_WtkIRQ9VUK!MH)P~o6aDe_mwwh?E|yuA#c|y4_v1KTE|$H1FN&hJ zZ9@n}QFL905JL1lBW~$EBw_mV5BWFW#k}V^EfFg|Ir}FrxuNTn;|nUNCPb`d7e)x$Z2@Qf@=nw z4H8O5q%j?HhU+y7u6fQ4JxZ$44lW-AMt`3CmiE%=$LVlqm?TME*Kr(YS(X?1X1$qA zKD_$;5Yvy--AB81T}OYhCE=2U0WI0_QS$l?p7D;)_>UEzo}Q#Bfh7qCME9S|`Wpfh z9&<%OMp>2dgg$#<%aj>+-QAYK{WcKsjPvn%S{xtURb{hnUhO}b&1PxWEf>oW!i&l2 qaA!E5&u?$rtl4hXo9i^~b>06UK-MLJs6x^J0000^X literal 0 HcmV?d00001 diff --git a/src/mapnode.cpp b/src/mapnode.cpp index cfb1a49..72cd762 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -189,6 +189,14 @@ void init_mapnode() f->is_ground_content = true; f->dug_item = std::string("MaterialItem ")+itos(CONTENT_SAND)+" 1"; + i = CONTENT_BRICK; + f = &g_content_features[i]; + f->setAllTextures("brick.png"); + f->setInventoryTextureCube("brick.png", "brick.png", "brick.png"); + f->param_type = CPT_MINERAL; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem ")+itos(i)+" 1"; + i = CONTENT_TREE; f = &g_content_features[i]; f->setAllTextures("tree.png"); diff --git a/src/mapnode.h b/src/mapnode.h index c4dcbfb..5022031 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -103,6 +103,7 @@ void init_content_inventory_texture_paths(); #define CONTENT_FENCE 21 #define CONTENT_SANDSTONE 22 #define CONTENT_CACTUS 23 +#define CONTENT_BRICK 24 /* Content feature list diff --git a/src/materials.cpp b/src/materials.cpp index a1d4195..0c744af 100644 --- a/src/materials.cpp +++ b/src/materials.cpp @@ -60,6 +60,7 @@ void initializeMaterialProperties() setStoneLikeDiggingProperties(CONTENT_STONE, 1.0); setStoneLikeDiggingProperties(CONTENT_SANDSTONE, 1.0); + setStoneLikeDiggingProperties(CONTENT_BRICK, 3.0); setStoneLikeDiggingProperties(CONTENT_MESE, 0.5); setStoneLikeDiggingProperties(CONTENT_COALSTONE, 1.5); setStoneLikeDiggingProperties(CONTENT_FURNACE, 3.0); diff --git a/src/server.cpp b/src/server.cpp index 994e62e..dfc05f7 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -4076,6 +4076,7 @@ void setCreativeInventory(Player *player) CONTENT_STONE, CONTENT_SAND, CONTENT_SANDSTONE, + CONTENT_BRICK, CONTENT_TREE, CONTENT_LEAVES, CONTENT_CACTUS, diff --git a/src/tile.cpp b/src/tile.cpp index 2a2d2a7..361de70 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -507,6 +507,7 @@ void TextureSource::buildMainAtlas() sourcelist.push_back("mud.png"); sourcelist.push_back("sand.png"); sourcelist.push_back("sandstone.png"); + sourcelist.push_back("brick.png"); sourcelist.push_back("grass.png"); sourcelist.push_back("grass_footsteps.png"); sourcelist.push_back("tree.png"); From cffd40c5d6c1427d2cce7cbcfe57669da73459c6 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 1 Jun 2011 04:57:46 +0200 Subject: [PATCH 016/158] + clay and associated items --- data/clay.png | Bin 0 -> 613 bytes data/clay_brick.png | Bin 0 -> 249 bytes data/lump_of_clay.png | Bin 0 -> 210 bytes src/inventory.cpp | 8 +++++++- src/map.cpp | 12 +++++++++++- src/mapnode.cpp | 10 +++++++++- src/mapnode.h | 1 + src/materials.cpp | 1 + src/server.cpp | 31 +++++++++++++++++++++++++++++++ src/tile.cpp | 1 + 10 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 data/clay.png create mode 100644 data/clay_brick.png create mode 100644 data/lump_of_clay.png diff --git a/data/clay.png b/data/clay.png new file mode 100644 index 0000000000000000000000000000000000000000..3557429d81f05837cb54ea3a964392bf28b78440 GIT binary patch literal 613 zcmV-r0-F7aP)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RW1sn(m2F^1>Q2+n|_en%SR4C6q zkxOnPF$_d0iTbqKZNLtk`yVB@36MB(+-mDDauxz+$wh(n>WPn!4*;;%T5I=xmr@EL zh)5~5@B8ENaL%1hC#^LR{r>)9@4b}5%prtr+rGcQt+mcMBC^)Ly}gYwnE5ykM0Czc zV~jCojL~~X#LMNfEQ@oll+t_m-UC2u&00Ig007y0mr|ZiCu2;Ek%(f9wboJ!0C?}M zwch)mpPyRmvMe}zd+(V!r6hz1At0jG+BwI}r4&Sbe}6Bf5Rnu@AR;qQbgeZa_TH6J zM06Yn5h3E|=Vz@ICkFtGF~%6y+7JRW=bVi(Qc7m_-k;CsoHGEVlyHo397k)dlrqMc ze9Wwrsnp~nl)`=Ag%ESW|1i^ct(AxXAcQdWx7K9u{q=ga z*0k2Q+igmfQqHh3hKPg^x7%&oHYugtwryS4ZQCaIwr#c6S$&RMYhBlM-}fmLuh(m9 zO(~U9(pod~R58uWVzt)G<)V}V0Ljc#r&3Bv`FK3M_q}&x%=vs4LRf1j`V7nCIGl6y zzTfXDrFC6juUD-V0Ep;%y=tvP2!DTn&*$?W^X_;XQ#;Q+00000NkvXXu0mjfk1-eJ literal 0 HcmV?d00001 diff --git a/data/clay_brick.png b/data/clay_brick.png new file mode 100644 index 0000000000000000000000000000000000000000..e36648e48f68ab3c201132839093a18a7387a72f GIT binary patch literal 249 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRt!3HF+tk*dLq!^2X+?^QKos)S9vL>4nJ z@Bt`9QzT_P~k`sfZB`i$4%x%!rWFB&QaoK8Lo7}wCrGd|^Gg(Z>O^jOV&5Yx zEPU8w3*!l?i;QN?5e1t2YJZyr#w94Z7T4DPt>422R<+SA*|Z_#tOT2hnVHd};F{;> xWZ4!m3r=TSbjh)##N^tFm|Z2B%2$Jx7`FaU%KpTr(hana!PC{xWt~$(69C^6KP~_O literal 0 HcmV?d00001 diff --git a/src/inventory.cpp b/src/inventory.cpp index 47a8d4d..3f83c74 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -160,8 +160,12 @@ video::ITexture * CraftItem::getImage() name = "lump_of_coal.png"; else if(m_subname == "lump_of_iron") name = "lump_of_iron.png"; + else if(m_subname == "lump_of_clay") + name = "lump_of_clay.png"; else if(m_subname == "steel_ingot") name = "steel_ingot.png"; + else if(m_subname == "clay_brick") + name = "clay_brick.png"; else if(m_subname == "rat") name = "rat.png"; else @@ -199,7 +203,7 @@ u16 CraftItem::getDropCount() bool CraftItem::isCookable() { - if(m_subname == "lump_of_iron") + if(m_subname == "lump_of_iron" || m_subname == "lump_of_clay") { return true; } @@ -212,6 +216,8 @@ InventoryItem *CraftItem::createCookResult() { return new CraftItem("steel_ingot", 1); } + else if(m_subname == "lump_of_clay") + return new CraftItem("clay_brick", 1); return NULL; } diff --git a/src/map.cpp b/src/map.cpp index c48599d..bf9f38c 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -3141,6 +3141,13 @@ void makeChunk(ChunkMakeData *data) if(have_sand == false) continue; + // Determine whether to have clay in the sand here + double claynoise = noise2d_perlin( + 0.5+(float)p2d.X/500, 0.5+(float)p2d.Y/500, + data->seed+4321, 8, 0.95); + + bool have_clay = have_sand && (claynoise > 0.95); + // Find ground level s16 surface_y = find_ground_level_clever(data->vmanip, p2d); @@ -3157,7 +3164,10 @@ void makeChunk(ChunkMakeData *data) MapNode *n = &data->vmanip.m_data[i]; if(n->d == CONTENT_MUD || n->d == CONTENT_GRASS) { - n->d = CONTENT_SAND; + if(have_clay && (surface_y == WATER_LEVEL)) + n->d = CONTENT_CLAY; + else + n->d = CONTENT_SAND; } else { diff --git a/src/mapnode.cpp b/src/mapnode.cpp index 72cd762..cef9bbf 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -189,13 +189,21 @@ void init_mapnode() f->is_ground_content = true; f->dug_item = std::string("MaterialItem ")+itos(CONTENT_SAND)+" 1"; + i = CONTENT_CLAY; + f = &g_content_features[i]; + f->setAllTextures("clay.png"); + f->setInventoryTextureCube("clay.png", "clay.png", "clay.png"); + f->param_type = CPT_MINERAL; + f->is_ground_content = true; + f->dug_item = std::string("CraftItem lump_of_clay 4"); + i = CONTENT_BRICK; f = &g_content_features[i]; f->setAllTextures("brick.png"); f->setInventoryTextureCube("brick.png", "brick.png", "brick.png"); f->param_type = CPT_MINERAL; f->is_ground_content = true; - f->dug_item = std::string("MaterialItem ")+itos(i)+" 1"; + f->dug_item = std::string("CraftItem clay_brick 4"); i = CONTENT_TREE; f = &g_content_features[i]; diff --git a/src/mapnode.h b/src/mapnode.h index 5022031..e8cc0ab 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -104,6 +104,7 @@ void init_content_inventory_texture_paths(); #define CONTENT_SANDSTONE 22 #define CONTENT_CACTUS 23 #define CONTENT_BRICK 24 +#define CONTENT_CLAY 25 /* Content feature list diff --git a/src/materials.cpp b/src/materials.cpp index 0c744af..8c23056 100644 --- a/src/materials.cpp +++ b/src/materials.cpp @@ -71,6 +71,7 @@ void initializeMaterialProperties() setDirtLikeDiggingProperties(CONTENT_GRASS, 1.0); setDirtLikeDiggingProperties(CONTENT_GRASS_FOOTSTEPS, 1.0); setDirtLikeDiggingProperties(CONTENT_SAND, 1.0); + setDirtLikeDiggingProperties(CONTENT_CLAY, 1.0); setWoodLikeDiggingProperties(CONTENT_TREE, 1.0); setWoodLikeDiggingProperties(CONTENT_LEAVES, 0.15); diff --git a/src/server.cpp b/src/server.cpp index dfc05f7..17850c5 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -3987,6 +3987,36 @@ void Server::UpdateCrafting(u16 peer_id) found = true; } } + + // Clay + if(!found) + { + ItemSpec specs[9]; + specs[3] = ItemSpec(ITEM_CRAFT, "lump_of_clay"); + specs[4] = ItemSpec(ITEM_CRAFT, "lump_of_clay"); + specs[6] = ItemSpec(ITEM_CRAFT, "lump_of_clay"); + specs[7] = ItemSpec(ITEM_CRAFT, "lump_of_clay"); + if(checkItemCombination(items, specs)) + { + rlist->addItem(new MaterialItem(CONTENT_CLAY, 1)); + found = true; + } + } + + // Brick + if(!found) + { + ItemSpec specs[9]; + specs[3] = ItemSpec(ITEM_CRAFT, "clay_brick"); + specs[4] = ItemSpec(ITEM_CRAFT, "clay_brick"); + specs[6] = ItemSpec(ITEM_CRAFT, "clay_brick"); + specs[7] = ItemSpec(ITEM_CRAFT, "clay_brick"); + if(checkItemCombination(items, specs)) + { + rlist->addItem(new MaterialItem(CONTENT_BRICK, 1)); + found = true; + } + } } } // if creative_mode == false @@ -4076,6 +4106,7 @@ void setCreativeInventory(Player *player) CONTENT_STONE, CONTENT_SAND, CONTENT_SANDSTONE, + CONTENT_CLAY, CONTENT_BRICK, CONTENT_TREE, CONTENT_LEAVES, diff --git a/src/tile.cpp b/src/tile.cpp index 361de70..71e0c96 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -507,6 +507,7 @@ void TextureSource::buildMainAtlas() sourcelist.push_back("mud.png"); sourcelist.push_back("sand.png"); sourcelist.push_back("sandstone.png"); + sourcelist.push_back("clay.png"); sourcelist.push_back("brick.png"); sourcelist.push_back("grass.png"); sourcelist.push_back("grass_footsteps.png"); From c930a92b7222e0228332fb39536d7ff4f3442d1b Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 1 Jun 2011 08:09:28 +0200 Subject: [PATCH 017/158] * clay is rarer now --- src/map.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/map.cpp b/src/map.cpp index bf9f38c..ac5bd7d 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -3144,9 +3144,9 @@ void makeChunk(ChunkMakeData *data) // Determine whether to have clay in the sand here double claynoise = noise2d_perlin( 0.5+(float)p2d.X/500, 0.5+(float)p2d.Y/500, - data->seed+4321, 8, 0.95); + data->seed+4321, 6, 0.95); - bool have_clay = have_sand && (claynoise > 0.95); + bool have_clay = have_sand && (claynoise > 1.25); // Find ground level s16 surface_y = find_ground_level_clever(data->vmanip, p2d); From d2b2c7c09e21fcf728e741e11e6fdabe03036b0e Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Tue, 31 May 2011 08:56:23 +0800 Subject: [PATCH 018/158] * improved fence dimensions (cuboid side lengths now multiples of 2, textures should fit better) --- src/mapblock.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mapblock.cpp b/src/mapblock.cpp index c448ef2..d98bfaf 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -1563,8 +1563,8 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data) u8 l = decode_light(undiminish_light(n.getLightBlend(data->m_daynight_ratio))); video::SColor c(255,l,l,l); - const f32 post_rad=(f32)BS/10; - const f32 bar_rad=(f32)BS/20; + const f32 post_rad=(f32)BS/(32.0/4.0); + const f32 bar_rad=(f32)BS/(32.0/2.0); const f32 bar_len=(f32)(BS/2)-post_rad; // The post - always present @@ -1581,12 +1581,12 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data) { pos = intToFloat(p+blockpos_nodes, BS); pos.X += BS/2; - pos.Y += BS/4; + pos.Y += 3*bar_rad; makeCuboid(material_wood, &collector, &pa_wood, c, pos, bar_len,bar_rad,bar_rad); - pos.Y -= BS/2; + pos.Y -= 6*bar_rad; makeCuboid(material_wood, &collector, &pa_wood, c, pos, bar_len,bar_rad,bar_rad); @@ -1600,11 +1600,11 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data) { pos = intToFloat(p+blockpos_nodes, BS); pos.Z += BS/2; - pos.Y += BS/4; + pos.Y += 3*bar_rad; makeCuboid(material_wood, &collector, &pa_wood, c, pos, bar_rad,bar_rad,bar_len); - pos.Y -= BS/2; + pos.Y -= 6*bar_rad; makeCuboid(material_wood, &collector, &pa_wood, c, pos, bar_rad,bar_rad,bar_len); From 28234f6e54d91dbc8f3ec23b514a6d6ffe3a78a9 Mon Sep 17 00:00:00 2001 From: MrLoom Date: Wed, 1 Jun 2011 14:13:22 +0200 Subject: [PATCH 019/158] MacOSX build support --- CMakeLists.txt | 2 +- src/CMakeLists.txt | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d5b8028..b1803bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,7 +104,7 @@ elseif(APPLE) set(CPACK_BUNDLE_ICON "") set(CPACK_BUNDLE_PLIST "") set(CPACK_BUNDLE_STARTUP_COMMAND "Contents/MacOS/minetest") - set(CPACK_GENERATOR BUNDLE) + set(CPACK_GENERATOR "Bundle") else() set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-linux") set(CPACK_GENERATOR TGZ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 49982d3..617a452 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -35,13 +35,24 @@ else() find_package(JPEG REQUIRED) find_package(BZip2 REQUIRED) find_package(PNG REQUIRED) + if(APPLE) + FIND_LIBRARY(CARBON_LIB Carbon) + FIND_LIBRARY(COCOA_LIB Cocoa) + FIND_LIBRARY(IOKIT_LIB IOKit) + mark_as_advanced( + CARBON_LIB + COCOA_LIB + IOKIT_LIB + ) + SET(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${CARBON_LIB} ${COCOA_LIB} ${IOKIT_LIB}) + endif(APPLE) endif(BUILD_CLIENT) find_package(ZLIB REQUIRED) set(PLATFORM_LIBS -lpthread) #set(CLIENT_PLATFORM_LIBS -lXxf86vm) # This way Xxf86vm is found on OpenBSD too find_library(XXF86VM_LIBRARY Xxf86vm) - set(CLIENT_PLATFORM_LIBS ${XXF86VM_LIBRARY}) + set(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${XXF86VM_LIBRARY}) endif() configure_file( @@ -174,8 +185,14 @@ else() set(WARNING_FLAGS "") endif() - set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-unused-but-set-variable") - + if(NOT APPLE) + set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-unused-but-set-variable") + endif() + if(APPLE) + set(CMAKE_OSX_ARCHITECTURES i386 CACHE STRING "do not build for 64-bit" FORCE) + set(ARCH i386) + endif() + set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${WARNING_FLAGS} -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops") set(CMAKE_CXX_FLAGS_DEBUG "-g -O1 -Wall") From 60578e0950d3235401d3a7504d602d5e398b7122 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 1 Jun 2011 16:46:49 +0200 Subject: [PATCH 020/158] * README updated --- README | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README b/README index e3e3a34..8a557ad 100644 --- a/README +++ b/README @@ -1,7 +1,14 @@ Minetest Δ (“Minetest Delta”) is a fork of Minetest-c55 , incorporating experimental features that are not (yet) included in Minetest-c55. New bricks: -* Sandstone (crafted from 4 sand) +* Sandstone (crafted from 4 sand, yields sand) +* Cactus (plant that grows on sand) +* Clay (found in sand at sea level, yields 4 lumps of clay) +* Brick (made from 4 clay bricks, yields 4 clay bricks) + +New materials: +* Lump of clay +* Clay brick (made from lumps of clay in the furnace) Alternate graphics: * Player From a75c31143a9d26d06e298075dfd02465a9fdce69 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 1 Jun 2011 17:19:28 +0200 Subject: [PATCH 021/158] * README updated --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 8a557ad..70d1104 100644 --- a/README +++ b/README @@ -16,6 +16,6 @@ Alternate graphics: * Rat * Glass -Building on GNU/Linux: +Building on GNU/Linux or OS X: cmake . -DRUN_IN_PLACE=1 make -j2 From 58bc6f3a185712ef68a0f54c178e3124127fa75a Mon Sep 17 00:00:00 2001 From: teddydestodes Date: Wed, 1 Jun 2011 19:44:07 +0200 Subject: [PATCH 022/158] added new submenu for key assignment configwriting/saving isn't complete and will break your config if you use fancy keys --- src/CMakeLists.txt | 1 + src/guiKeyChangeMenu.cpp | 598 +++++++++++++++++++++++++++++++++++++++ src/guiKeyChangeMenu.h | 133 +++++++++ src/guiMainMenu.cpp | 71 +++-- src/guiMainMenu.h | 83 +++--- src/guiMessageMenu.h | 48 ++-- src/keycode.cpp | 78 +++-- src/keycode.h | 4 +- 8 files changed, 913 insertions(+), 103 deletions(-) create mode 100644 src/guiKeyChangeMenu.cpp create mode 100644 src/guiKeyChangeMenu.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 617a452..9d5cf7d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -100,6 +100,7 @@ set(minetest_SRCS clientobject.cpp guiFurnaceMenu.cpp guiMainMenu.cpp + guiKeyChangeMenu.cpp guiMessageMenu.cpp guiTextInputMenu.cpp guiInventoryMenu.cpp diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp new file mode 100644 index 0000000..3e594ae --- /dev/null +++ b/src/guiKeyChangeMenu.cpp @@ -0,0 +1,598 @@ +/* + Minetest-delta + Copyright (C) 2010-11 celeron55, Perttu Ahola + Copyright (C) 2011 Ciaran Gultnieks + Copyright (C) 2011 teddydestodes + + 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. + */ + +#include "guiKeyChangeMenu.h" +#include "debug.h" +#include "serialization.h" +#include "keycode.h" +#include "main.h" +#include + +GUIKeyChangeMenu::GUIKeyChangeMenu(gui::IGUIEnvironment* env, + gui::IGUIElement* parent, s32 id, IMenuManager *menumgr) : + GUIModalMenu(env, parent, id, menumgr) +{ + activeKey = -1; + init_keys(); +} + +GUIKeyChangeMenu::~GUIKeyChangeMenu() +{ + removeChildren(); +} + +void GUIKeyChangeMenu::removeChildren() +{ + const core::list &children = getChildren(); + core::list children_copy; + for (core::list::ConstIterator i = children.begin(); i + != children.end(); i++) + { + children_copy.push_back(*i); + } + for (core::list::Iterator i = children_copy.begin(); i + != children_copy.end(); i++) + { + (*i)->remove(); + } +} + +void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) +{ + /* + Remove stuff + */ + removeChildren(); + + /* + Calculate new sizes and positions + */ + + v2s32 size(620, 430); + + core::rect < s32 > rect(screensize.X / 2 - size.X / 2, + screensize.Y / 2 - size.Y / 2, screensize.X / 2 + size.X / 2, + screensize.Y / 2 + size.Y / 2); + + DesiredRect = rect; + recalculateAbsolutePosition(false); + + v2s32 topleft(0, 0); + + { + core::rect < s32 > rect(0, 0, 125, 20); + rect += topleft + v2s32(25, 3); + const wchar_t *text = L"KEYBINDINGS"; + //gui::IGUIStaticText *t = + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + v2s32 offset(25, 40); + // buttons + + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Forward"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->forward = Environment->addButton(rect, this, + GUI_ID_KEY_FORWARD_BUTTON, + narrow_to_wide(KeyNames[key_forward]).c_str()); + } + + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Backward"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->backward = Environment->addButton(rect, this, + GUI_ID_KEY_BACKWARD_BUTTON, + narrow_to_wide(KeyNames[key_backward]).c_str()); + } + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Left"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->left = Environment->addButton(rect, this, GUI_ID_KEY_LEFT_BUTTON, + narrow_to_wide(KeyNames[key_left]).c_str()); + } + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Right"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->right = Environment->addButton(rect, this, + GUI_ID_KEY_RIGHT_BUTTON, + narrow_to_wide(KeyNames[key_right]).c_str()); + } + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Use"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->use = Environment->addButton(rect, this, GUI_ID_KEY_USE_BUTTON, + narrow_to_wide(KeyNames[key_use]).c_str()); + } + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Sneak"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->sneak = Environment->addButton(rect, this, + GUI_ID_KEY_SNEAK_BUTTON, + narrow_to_wide(KeyNames[key_sneak]).c_str()); + } + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Jump"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->jump = Environment->addButton(rect, this, GUI_ID_KEY_JUMP_BUTTON, + narrow_to_wide(KeyNames[key_jump]).c_str()); + } + + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Inventory"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->inventory = Environment->addButton(rect, this, + GUI_ID_KEY_INVENTORY_BUTTON, + narrow_to_wide(KeyNames[key_inventory]).c_str()); + } + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Chat"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->chat = Environment->addButton(rect, this, GUI_ID_KEY_CHAT_BUTTON, + narrow_to_wide(KeyNames[key_chat]).c_str()); + } + + //next col + offset = v2s32(250, 40); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Toggle fly"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->fly = Environment->addButton(rect, this, GUI_ID_KEY_FLY_BUTTON, + narrow_to_wide(KeyNames[key_fly]).c_str()); + } + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Toggle fast"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->fast = Environment->addButton(rect, this, GUI_ID_KEY_FAST_BUTTON, + narrow_to_wide(KeyNames[key_fast]).c_str()); + } + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Range select"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->range = Environment->addButton(rect, this, + GUI_ID_KEY_RANGE_BUTTON, + narrow_to_wide(KeyNames[key_range]).c_str()); + } + + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Print stacks"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->dump = Environment->addButton(rect, this, GUI_ID_KEY_DUMP_BUTTON, + narrow_to_wide(KeyNames[key_dump]).c_str()); + } + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(size.X - 100 - 20, size.Y - 40); + Environment->addButton(rect, this, GUI_ID_BACK_BUTTON, L"Save"); + } + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(size.X - 100 - 20 - 100 - 20, size.Y - 40); + Environment->addButton(rect, this, GUI_ID_ABORT_BUTTON, L"Cancel"); + } +} + +void GUIKeyChangeMenu::drawMenu() +{ + gui::IGUISkin* skin = Environment->getSkin(); + if (!skin) + return; + video::IVideoDriver* driver = Environment->getVideoDriver(); + + video::SColor bgcolor(140, 0, 0, 0); + + { + core::rect < s32 > rect(0, 0, 620, 620); + rect += AbsoluteRect.UpperLeftCorner; + driver->draw2DRectangle(bgcolor, rect, &AbsoluteClippingRect); + } + + gui::IGUIElement::draw(); +} + +bool GUIKeyChangeMenu::acceptInput() +{ + g_settings.set("keymap_forward", keycode_to_keyname(key_forward)); + g_settings.set("keymap_backward", keycode_to_keyname(key_backward)); + g_settings.set("keymap_left", keycode_to_keyname(key_left)); + g_settings.set("keymap_right", keycode_to_keyname(key_right)); + g_settings.set("keymap_jump", keycode_to_keyname(key_jump)); + g_settings.set("keymap_sneak", keycode_to_keyname(key_sneak)); + g_settings.set("keymap_inventory", keycode_to_keyname(key_inventory)); + g_settings.set("keymap_chat", keycode_to_keyname(key_chat)); + g_settings.set("keymap_rangeselect", keycode_to_keyname(key_range)); + g_settings.set("keymap_freemove", keycode_to_keyname(key_fly)); + g_settings.set("keymap_fastmove", keycode_to_keyname(key_fast)); + g_settings.set("keymap_special1", keycode_to_keyname(key_use)); + g_settings.set("keymap_print_debug_stacks", keycode_to_keyname(key_dump)); + //clearKeyCache(); Y U NO SCOPE?! + return true; +} +void GUIKeyChangeMenu::init_keys() +{ + key_forward = getKeySetting("keymap_forward"); + key_backward = getKeySetting("keymap_backward"); + key_left = getKeySetting("keymap_left"); + key_right = getKeySetting("keymap_right"); + key_jump = getKeySetting("keymap_jump"); + key_sneak = getKeySetting("keymap_sneak"); + key_inventory = getKeySetting("keymap_inventory"); + key_chat = getKeySetting("keymap_chat"); + key_range = getKeySetting("keymap_rangeselect"); + key_fly = getKeySetting("keymap_freemove"); + key_fast = getKeySetting("keymap_fastmove"); + key_use = getKeySetting("keymap_special1"); + key_dump = getKeySetting("keymap_print_debug_stacks"); +} + +bool GUIKeyChangeMenu::resetMenu() +{ + if (activeKey >= 0) + { + switch (activeKey) + { + case GUI_ID_KEY_FORWARD_BUTTON: + this->forward->setText( + narrow_to_wide(KeyNames[key_forward]).c_str()); + break; + case GUI_ID_KEY_BACKWARD_BUTTON: + this->backward->setText( + narrow_to_wide(KeyNames[key_backward]).c_str()); + break; + case GUI_ID_KEY_LEFT_BUTTON: + this->left->setText(narrow_to_wide(KeyNames[key_left]).c_str()); + break; + case GUI_ID_KEY_RIGHT_BUTTON: + this->right->setText(narrow_to_wide(KeyNames[key_right]).c_str()); + break; + case GUI_ID_KEY_JUMP_BUTTON: + this->jump->setText(narrow_to_wide(KeyNames[key_jump]).c_str()); + break; + case GUI_ID_KEY_SNEAK_BUTTON: + this->sneak->setText(narrow_to_wide(KeyNames[key_sneak]).c_str()); + break; + case GUI_ID_KEY_INVENTORY_BUTTON: + this->inventory->setText( + narrow_to_wide(KeyNames[key_inventory]).c_str()); + break; + case GUI_ID_KEY_CHAT_BUTTON: + this->chat->setText(narrow_to_wide(KeyNames[key_chat]).c_str()); + break; + case GUI_ID_KEY_RANGE_BUTTON: + this->range->setText(narrow_to_wide(KeyNames[key_range]).c_str()); + break; + case GUI_ID_KEY_FLY_BUTTON: + this->fly->setText(narrow_to_wide(KeyNames[key_fly]).c_str()); + break; + case GUI_ID_KEY_FAST_BUTTON: + this->fast->setText(narrow_to_wide(KeyNames[key_fast]).c_str()); + break; + case GUI_ID_KEY_USE_BUTTON: + this->use->setText(narrow_to_wide(KeyNames[key_use]).c_str()); + break; + case GUI_ID_KEY_DUMP_BUTTON: + this->dump->setText(narrow_to_wide(KeyNames[key_dump]).c_str()); + break; + } + activeKey = -1; + return false; + } + return true; +} +bool GUIKeyChangeMenu::OnEvent(const SEvent& event) +{ + if (event.EventType == EET_KEY_INPUT_EVENT && activeKey >= 0 + && event.KeyInput.PressedDown) + { + if (activeKey == GUI_ID_KEY_FORWARD_BUTTON) + { + this->forward->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_forward = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_BACKWARD_BUTTON) + { + this->backward->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_backward = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_LEFT_BUTTON) + { + this->left->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_left = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_RIGHT_BUTTON) + { + this->right->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_right = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_JUMP_BUTTON) + { + this->jump->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_jump = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_SNEAK_BUTTON) + { + this->sneak->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_sneak = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_INVENTORY_BUTTON) + { + this->inventory->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_inventory = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_CHAT_BUTTON) + { + this->chat->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_chat = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_RANGE_BUTTON) + { + this->range->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_range = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_FLY_BUTTON) + { + this->fly->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_fly = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_FAST_BUTTON) + { + this->fast->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_fast = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_USE_BUTTON) + { + this->use->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_use = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_DUMP_BUTTON) + { + this->dump->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_dump = event.KeyInput.Key; + } + + activeKey = -1; + return true; + } + if (event.EventType == EET_GUI_EVENT) + { + if (event.GUIEvent.EventType == gui::EGET_ELEMENT_FOCUS_LOST + && isVisible()) + { + if (!canTakeFocus(event.GUIEvent.Element)) + { + dstream << "GUIMainMenu: Not allowing focus change." + << std::endl; + // Returning true disables focus change + return true; + } + } + if (event.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED) + { + switch (event.GUIEvent.Caller->getID()) + { + case GUI_ID_BACK_BUTTON: //back + acceptInput(); + quitMenu(); + return true; + case GUI_ID_ABORT_BUTTON: //abort + quitMenu(); + return true; + case GUI_ID_KEY_FORWARD_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->forward->setText(L"press Key"); + break; + case GUI_ID_KEY_BACKWARD_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->backward->setText(L"press Key"); + break; + case GUI_ID_KEY_LEFT_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->left->setText(L"press Key"); + break; + case GUI_ID_KEY_RIGHT_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->right->setText(L"press Key"); + break; + case GUI_ID_KEY_USE_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->use->setText(L"press Key"); + break; + case GUI_ID_KEY_FLY_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->fly->setText(L"press Key"); + break; + case GUI_ID_KEY_FAST_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->fast->setText(L"press Key"); + break; + case GUI_ID_KEY_JUMP_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->jump->setText(L"press Key"); + break; + case GUI_ID_KEY_CHAT_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->chat->setText(L"press Key"); + break; + case GUI_ID_KEY_SNEAK_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->sneak->setText(L"press Key"); + break; + case GUI_ID_KEY_INVENTORY_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->inventory->setText(L"press Key"); + break; + case GUI_ID_KEY_DUMP_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->dump->setText(L"press Key"); + break; + case GUI_ID_KEY_RANGE_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->range->setText(L"press Key"); + break; + } + //Buttons + + } + } + return Parent ? Parent->OnEvent(event) : false; +} + diff --git a/src/guiKeyChangeMenu.h b/src/guiKeyChangeMenu.h new file mode 100644 index 0000000..389ce7a --- /dev/null +++ b/src/guiKeyChangeMenu.h @@ -0,0 +1,133 @@ +/* + Minetest-delta + Copyright (C) 2010-11 celeron55, Perttu Ahola + Copyright (C) 2011 Ciaran Gultnieks + Copyright (C) 2011 teddydestodes + + 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. + */ + +#ifndef GUIKEYCHANGEMENU_HEADER +#define GUIKEYCHANGEMENU_HEADER + +#include "common_irrlicht.h" +#include "utility.h" +#include "modalMenu.h" +#include "client.h" +#include + +static const char *KeyNames[] = + { "-", "Left Button", "Right Button", "Cancel", "Middle Button", "X Button 1", + "X Button 2", "-", "Back", "Tab", "-", "-", "Clear", "Return", "-", + "-", "Shift", "Control", "Menu", "Pause", "Capital", "Kana", "-", + "Junja", "Final", "Kanji", "-", "Escape", "Convert", "Nonconvert", + "Accept", "Mode Change", "Space", "Priot", "Next", "End", "Home", + "Left", "Up", "Right", "Down", "Select", "Print", "Execute", + "Snapshot", "Insert", "Delete", "Help", "0", "1", "2", "3", "4", "5", + "6", "7", "8", "9", "-", "-", "-", "-", "-", "-", "-", "A", "B", "C", + "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", + "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "Left Windows", + "Right Windows", "Apps", "-", "Sleep", "Numpad 0", "Numpad 1", + "Numpad 2", "Numpad 3", "Numpad 4", "Numpad 5", "Numpad 6", "Numpad 7", + "Numpad 8", "Numpad 9", "Numpad *", "Numpad +", "Numpad /", "Numpad -", + "Numpad .", "Numpad /", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", + "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16", "F17", "F18", + "F19", "F20", "F21", "F22", "F23", "F24", "-", "-", "-", "-", "-", "-", + "-", "-", "Num Lock", "Scroll Lock", "-", "-", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "Left Shift", "Right Shight", + "Left Control", "Right Control", "Left Menu", "Right Menu", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "Plus", "Comma", "Minus", "Period", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "Attn", "CrSel", + "ExSel", "Erase OEF", "Play", "Zoom", "PA1", "OEM Clear", "-" }; + enum + { + GUI_ID_BACK_BUTTON = 101, GUI_ID_ABORT_BUTTON, GUI_ID_SCROLL_BAR, + //buttons + GUI_ID_KEY_FORWARD_BUTTON, + GUI_ID_KEY_BACKWARD_BUTTON, + GUI_ID_KEY_LEFT_BUTTON, + GUI_ID_KEY_RIGHT_BUTTON, + GUI_ID_KEY_USE_BUTTON, + GUI_ID_KEY_FLY_BUTTON, + GUI_ID_KEY_FAST_BUTTON, + GUI_ID_KEY_JUMP_BUTTON, + GUI_ID_KEY_CHAT_BUTTON, + GUI_ID_KEY_SNEAK_BUTTON, + GUI_ID_KEY_INVENTORY_BUTTON, + GUI_ID_KEY_DUMP_BUTTON, + GUI_ID_KEY_RANGE_BUTTON + }; + +class GUIKeyChangeMenu: public GUIModalMenu +{ +public: + GUIKeyChangeMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent, + s32 id, IMenuManager *menumgr); + ~GUIKeyChangeMenu(); + + void removeChildren(); + /* + Remove and re-add (or reposition) stuff + */ + void regenerateGui(v2u32 screensize); + + void drawMenu(); + + bool acceptInput(); + + bool OnEvent(const SEvent& event); + +private: + + void init_keys(); + + bool resetMenu(); + + gui::IGUIButton *forward; + gui::IGUIButton *backward; + gui::IGUIButton *left; + gui::IGUIButton *right; + gui::IGUIButton *use; + gui::IGUIButton *sneak; + gui::IGUIButton *jump; + gui::IGUIButton *inventory; + gui::IGUIButton *fly; + gui::IGUIButton *fast; + gui::IGUIButton *range; + gui::IGUIButton *dump; + gui::IGUIButton *chat; + + u32 activeKey; + u32 key_forward; + u32 key_backward; + u32 key_left; + u32 key_right; + u32 key_use; + u32 key_sneak; + u32 key_jump; + u32 key_inventory; + u32 key_fly; + u32 key_fast; + u32 key_range; + u32 key_chat; + u32 key_dump; +}; + +#endif + diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp index a30e006..cea3286 100644 --- a/src/guiMainMenu.cpp +++ b/src/guiMainMenu.cpp @@ -18,10 +18,13 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "guiMainMenu.h" +#include "guiKeyChangeMenu.h" #include "debug.h" #include "serialization.h" #include + + GUIMainMenu::GUIMainMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent, s32 id, IMenuManager *menumgr, @@ -34,6 +37,10 @@ GUIMainMenu::GUIMainMenu(gui::IGUIEnvironment* env, m_gamecallback(gamecallback) { assert(m_data); + this->env = env; + this->parent = parent; + this->id = id; + this->menumgr = menumgr; } GUIMainMenu::~GUIMainMenu() @@ -70,35 +77,35 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) // Client options { - gui::IGUIElement *e = getElementFromId(258); + gui::IGUIElement *e = getElementFromId(GUI_ID_NAME_INPUT); if(e != NULL) text_name = e->getText(); else text_name = m_data->name; } { - gui::IGUIElement *e = getElementFromId(256); + gui::IGUIElement *e = getElementFromId(GUI_ID_ADDRESS_INPUT); if(e != NULL) text_address = e->getText(); else text_address = m_data->address; } { - gui::IGUIElement *e = getElementFromId(257); + gui::IGUIElement *e = getElementFromId(GUI_ID_PORT_INPUT); if(e != NULL) text_port = e->getText(); else text_port = m_data->port; } { - gui::IGUIElement *e = getElementFromId(263); + gui::IGUIElement *e = getElementFromId(GUI_ID_FANCYTREE_CB); if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX) fancy_trees = ((gui::IGUICheckBox*)e)->isChecked(); else fancy_trees = m_data->fancy_trees; } { - gui::IGUIElement *e = getElementFromId(262); + gui::IGUIElement *e = getElementFromId(GUI_ID_SMOOTH_LIGHTING_CB); if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX) smooth_lighting = ((gui::IGUICheckBox*)e)->isChecked(); else @@ -107,14 +114,14 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) // Server options { - gui::IGUIElement *e = getElementFromId(259); + gui::IGUIElement *e = getElementFromId(GUI_ID_CREATIVE_CB); if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX) creative_mode = ((gui::IGUICheckBox*)e)->isChecked(); else creative_mode = m_data->creative_mode; } { - gui::IGUIElement *e = getElementFromId(261); + gui::IGUIElement *e = getElementFromId(GUI_ID_DAMAGE_CB); if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX) enable_damage = ((gui::IGUICheckBox*)e)->isChecked(); else @@ -175,7 +182,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, 50); gui::IGUIElement *e = - Environment->addEditBox(text_name.c_str(), rect, true, this, 258); + Environment->addEditBox(text_name.c_str(), rect, true, this, GUI_ID_NAME_INPUT); if(text_name == L"") Environment->setFocus(e); } @@ -198,7 +205,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, 100); gui::IGUIElement *e = - Environment->addEditBox(text_address.c_str(), rect, true, this, 256); + Environment->addEditBox(text_address.c_str(), rect, true, this, GUI_ID_ADDRESS_INPUT); if(text_name != L"") Environment->setFocus(e); } @@ -206,7 +213,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 120, 30); //rect += topleft_client + v2s32(160+250+20, 125); rect += topleft_client + v2s32(size_client.X-60-100, 100); - Environment->addEditBox(text_port.c_str(), rect, true, this, 257); + Environment->addEditBox(text_port.c_str(), rect, true, this, GUI_ID_PORT_INPUT); } { core::rect rect(0, 0, 400, 20); @@ -217,13 +224,13 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 250, 30); rect += topleft_client + v2s32(35, 150); - Environment->addCheckBox(fancy_trees, rect, this, 263, + Environment->addCheckBox(fancy_trees, rect, this, GUI_ID_FANCYTREE_CB, L"Fancy trees"); } { core::rect rect(0, 0, 250, 30); rect += topleft_client + v2s32(35, 150+30); - Environment->addCheckBox(smooth_lighting, rect, this, 262, + Environment->addCheckBox(smooth_lighting, rect, this, GUI_ID_SMOOTH_LIGHTING_CB, L"Smooth Lighting"); } // Start game button @@ -231,9 +238,16 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 180, 30); //rect += topleft_client + v2s32(size_client.X/2-180/2, 225-30/2); rect += topleft_client + v2s32(size_client.X-180-40, 150+25); - Environment->addButton(rect, this, 257, L"Start Game / Connect"); + Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON, L"Start Game / Connect"); } + // Key change button + { + core::rect rect(0, 0, 100, 30); + //rect += topleft_client + v2s32(size_client.X/2-180/2, 225-30/2); + rect += topleft_client + v2s32(size_client.X-180-40-100-20, 150+25); + Environment->addButton(rect, this, GUI_ID_CHANGE_KEYS_BUTTON, L"Change keys"); + } /* Server section */ @@ -254,19 +268,19 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 250, 30); rect += topleft_server + v2s32(35, 30); - Environment->addCheckBox(creative_mode, rect, this, 259, L"Creative Mode"); + Environment->addCheckBox(creative_mode, rect, this, GUI_ID_CREATIVE_CB, L"Creative Mode"); } { core::rect rect(0, 0, 250, 30); rect += topleft_server + v2s32(35, 60); - Environment->addCheckBox(enable_damage, rect, this, 261, L"Enable Damage"); + Environment->addCheckBox(enable_damage, rect, this, GUI_ID_DAMAGE_CB, L"Enable Damage"); } // Map delete button { core::rect rect(0, 0, 130, 30); //rect += topleft_server + v2s32(size_server.X-40-130, 100+25); rect += topleft_server + v2s32(40, 100+25); - Environment->addButton(rect, this, 260, L"Delete map"); + Environment->addButton(rect, this, GUI_ID_DELETE_MAP_BUTTON, L"Delete map"); } } @@ -300,7 +314,7 @@ void GUIMainMenu::drawMenu() void GUIMainMenu::acceptInput() { { - gui::IGUIElement *e = getElementFromId(258); + gui::IGUIElement *e = getElementFromId(GUI_ID_NAME_INPUT); if(e != NULL) m_data->name = e->getText(); } @@ -310,32 +324,32 @@ void GUIMainMenu::acceptInput() m_data->password = e->getText(); } { - gui::IGUIElement *e = getElementFromId(256); + gui::IGUIElement *e = getElementFromId(GUI_ID_ADDRESS_INPUT); if(e != NULL) m_data->address = e->getText(); } { - gui::IGUIElement *e = getElementFromId(257); + gui::IGUIElement *e = getElementFromId(GUI_ID_PORT_INPUT); if(e != NULL) m_data->port = e->getText(); } { - gui::IGUIElement *e = getElementFromId(259); + gui::IGUIElement *e = getElementFromId(GUI_ID_CREATIVE_CB); if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX) m_data->creative_mode = ((gui::IGUICheckBox*)e)->isChecked(); } { - gui::IGUIElement *e = getElementFromId(261); + gui::IGUIElement *e = getElementFromId(GUI_ID_DAMAGE_CB); if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX) m_data->enable_damage = ((gui::IGUICheckBox*)e)->isChecked(); } { - gui::IGUIElement *e = getElementFromId(262); + gui::IGUIElement *e = getElementFromId(GUI_ID_SMOOTH_LIGHTING_CB); if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX) m_data->smooth_lighting = ((gui::IGUICheckBox*)e)->isChecked(); } { - gui::IGUIElement *e = getElementFromId(263); + gui::IGUIElement *e = getElementFromId(GUI_ID_FANCYTREE_CB); if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX) m_data->fancy_trees = ((gui::IGUICheckBox*)e)->isChecked(); } @@ -377,11 +391,16 @@ bool GUIMainMenu::OnEvent(const SEvent& event) { switch(event.GUIEvent.Caller->getID()) { - case 257: // Start game + case GUI_ID_JOIN_GAME_BUTTON: // Start game acceptInput(); quitMenu(); return true; - case 260: // Delete map + case GUI_ID_CHANGE_KEYS_BUTTON: { + GUIKeyChangeMenu *kmenu = new GUIKeyChangeMenu(env, parent, -1,menumgr); + kmenu->drop(); + return true; + } + case GUI_ID_DELETE_MAP_BUTTON: // Delete map // Don't accept input data, just set deletion request m_data->delete_map = true; m_accepted = true; @@ -393,7 +412,7 @@ bool GUIMainMenu::OnEvent(const SEvent& event) { switch(event.GUIEvent.Caller->getID()) { - case 256: case 257: case 258: case 264: + case GUI_ID_ADDRESS_INPUT: case GUI_ID_PORT_INPUT: case GUI_ID_NAME_INPUT: case 264: acceptInput(); quitMenu(); return true; diff --git a/src/guiMainMenu.h b/src/guiMainMenu.h index edd5190..6c028c6 100644 --- a/src/guiMainMenu.h +++ b/src/guiMainMenu.h @@ -1,21 +1,21 @@ /* -Minetest-c55 -Copyright (C) 2010 celeron55, Perttu Ahola + Minetest-c55 + Copyright (C) 2010 celeron55, Perttu Ahola -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 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. + 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. -*/ + 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. + */ #ifndef GUIMAINMENU_HEADER #define GUIMAINMENU_HEADER @@ -27,21 +27,35 @@ with this program; if not, write to the Free Software Foundation, Inc., // For IGameCallback #include "guiPauseMenu.h" +enum +{ + GUI_ID_QUIT_BUTTON = 101, + GUI_ID_NAME_INPUT, + GUI_ID_ADDRESS_INPUT, + GUI_ID_PORT_INPUT, + GUI_ID_FANCYTREE_CB, + GUI_ID_SMOOTH_LIGHTING_CB, + GUI_ID_DAMAGE_CB, + GUI_ID_CREATIVE_CB, + GUI_ID_JOIN_GAME_BUTTON, + GUI_ID_CHANGE_KEYS_BUTTON, + GUI_ID_DELETE_MAP_BUTTON +}; + struct MainMenuData { - MainMenuData(): + MainMenuData() : // Client opts - fancy_trees(false), - smooth_lighting(false), - // Server opts - creative_mode(false), - enable_damage(false), - // Actions - delete_map(false) - {} + fancy_trees(false), smooth_lighting(false), + // Server opts + creative_mode(false), enable_damage(false), + // Actions + delete_map(false) + { + } // These are in the native format of the gui elements - + // Client options std::wstring address; std::wstring port; @@ -56,20 +70,23 @@ struct MainMenuData bool delete_map; }; -class GUIMainMenu : public GUIModalMenu +class GUIMainMenu: public GUIModalMenu { public: - GUIMainMenu(gui::IGUIEnvironment* env, - gui::IGUIElement* parent, s32 id, - IMenuManager *menumgr, - MainMenuData *data, + GUIMainMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent, s32 id, + IMenuManager *menumgr, MainMenuData *data, IGameCallback *gamecallback); ~GUIMainMenu(); - + + gui::IGUIEnvironment* env; + gui::IGUIElement* parent; + s32 id; + IMenuManager *menumgr; + void removeChildren(); /* - Remove and re-add (or reposition) stuff - */ + Remove and re-add (or reposition) stuff + */ void regenerateGui(v2u32 screensize); void drawMenu(); @@ -82,7 +99,7 @@ public: } bool OnEvent(const SEvent& event); - + private: MainMenuData *m_data; bool m_accepted; diff --git a/src/guiMessageMenu.h b/src/guiMessageMenu.h index 82c40ce..8f48b66 100644 --- a/src/guiMessageMenu.h +++ b/src/guiMessageMenu.h @@ -1,21 +1,21 @@ /* -Minetest-c55 -Copyright (C) 2010 celeron55, Perttu Ahola + Minetest-c55 + Copyright (C) 2010 celeron55, Perttu Ahola -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 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. + 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. -*/ + 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. + */ #ifndef GUIMESSAGEMENU_HEADER #define GUIMESSAGEMENU_HEADER @@ -25,19 +25,17 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "utility.h" #include -class GUIMessageMenu : public GUIModalMenu +class GUIMessageMenu: public GUIModalMenu { public: - GUIMessageMenu(gui::IGUIEnvironment* env, - gui::IGUIElement* parent, s32 id, - IMenuManager *menumgr, - std::wstring message_text); + GUIMessageMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent, s32 id, + IMenuManager *menumgr, std::wstring message_text); ~GUIMessageMenu(); - + void removeChildren(); /* - Remove and re-add (or reposition) stuff - */ + Remove and re-add (or reposition) stuff + */ void regenerateGui(v2u32 screensize); void drawMenu(); @@ -45,13 +43,13 @@ public: bool OnEvent(const SEvent& event); /* - true = ok'd - */ + true = ok'd + */ bool getStatus() { return m_status; } - + private: std::wstring m_message_text; bool m_status; diff --git a/src/keycode.cpp b/src/keycode.cpp index ad3c0b4..9934260 100644 --- a/src/keycode.cpp +++ b/src/keycode.cpp @@ -1,25 +1,24 @@ /* -Minetest-c55 -Copyright (C) 2010-2011 celeron55, Perttu Ahola + Minetest-c55 + Copyright (C) 2010-2011 celeron55, Perttu Ahola -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 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. + 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. -*/ + 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. + */ #include "keycode.h" #include "main.h" // For g_settings - #define CHECKKEY(x){if(strcmp(name, #x)==0) return irr::x;} irr::EKEY_CODE keyname_to_keycode(const char *name) @@ -171,9 +170,48 @@ irr::EKEY_CODE keyname_to_keycode(const char *name) return irr::KEY_KEY_CODES_COUNT; } +static const char *KeyNames[] = +{ "-", "KEY_LBUTTON", "KEY_RBUTTON", "Cancel", "Middle Button", "X Button 1", + "X Button 2", "-", "Back", "Tab", "-", "-", "Clear", "Return", "-", + "-", "KEY_SHIFT", "Control", "Menu", "Pause", "Capital", "Kana", "-", + "Junja", "Final", "Kanji", "-", "Escape", "Convert", "Nonconvert", + "Accept", "Mode Change", "KEY_SPACE", "Priot", "Next", "KEY_END", + "KEY_HOME", "Left", "Up", "Right", "Down", "Select", "KEY_PRINT", + "Execute", "Snapshot", "Insert", "Delete", "Help", "KEY_KEY_0", + "KEY_KEY_1", "KEY_KEY_2", "KEY_KEY_3", "KEY_KEY_4", "KEY_KEY_5", + "KEY_KEY_6", "KEY_KEY_7", "KEY_KEY_8", "KEY_KEY_9", "-", "-", "-", "-", + "-", "-", "-", "KEY_KEY_A", "KEY_KEY_B", "KEY_KEY_C", "KEY_KEY_D", + "KEY_KEY_E", "KEY_KEY_F", "KEY_KEY_G", "KEY_KEY_H", "KEY_KEY_I", + "KEY_KEY_J", "KEY_KEY_K", "KEY_KEY_L", "KEY_KEY_M", "KEY_KEY_N", + "KEY_KEY_O", "KEY_KEY_P", "KEY_KEY_Q", "KEY_KEY_R", "KEY_KEY_S", + "KEY_KEY_T", "KEY_KEY_U", "KEY_KEY_V", "KEY_KEY_W", "KEY_KEY_X", + "KEY_KEY_Y", "KEY_KEY_Z", "Left Windows", "Right Windows", "Apps", "-", + "Sleep", "KEY_NUMPAD0", "KEY_NUMPAD1", "KEY_NUMPAD2", "KEY_NUMPAD3", + "KEY_NUMPAD4", "KEY_NUMPAD5", "KEY_NUMPAD6", "KEY_NUMPAD7", + "KEY_NUMPAD8", "KEY_NUMPAD9", "Numpad *", "Numpad +", "Numpad /", + "Numpad -", "Numpad .", "Numpad /", "KEY_F1", "KEY_F2", "KEY_F3", + "KEY_F4", "KEY_F5", "KEY_F6", "KEY_F7", "KEY_F8", "KEY_F9", "KEY_F10", + "KEY_F11", "KEY_F12", "KEY_F13", "KEY_F14", "KEY_F15", "KEY_F16", + "KEY_F17", "KEY_F18", "KEY_F19", "KEY_F20", "KEY_F21", "KEY_F22", + "KEY_F23", "KEY_F24", "-", "-", "-", "-", "-", "-", "-", "-", + "Num Lock", "Scroll Lock", "-", "-", "-", "-", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "KEY_LSHIFT", "KEY_RSHIFT", "Left Control", + "Right Control", "Left Menu", "Right Menu", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", + "-", "-", "Plus", "Comma", "Minus", "Period", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "-", "Attn", "CrSel", "ExSel", + "Erase OEF", "Play", "Zoom", "PA1", "OEM Clear", "-" }; + +std::string keycode_to_keyname(s32 keycode) +{ + return KeyNames[keycode]; +} /* - Key config -*/ + Key config + */ // A simple cache for quicker lookup core::map g_key_setting_cache; @@ -182,11 +220,15 @@ irr::EKEY_CODE getKeySetting(const char *settingname) { core::map::Node *n; n = g_key_setting_cache.find(settingname); - if(n) + if (n) return n->getValue(); irr::EKEY_CODE c = keyname_to_keycode(g_settings.get(settingname).c_str()); g_key_setting_cache.insert(settingname, c); return c; } +void clearKeyCache() +{ + g_key_setting_cache.clear(); +} diff --git a/src/keycode.h b/src/keycode.h index f19fe34..614f2e5 100644 --- a/src/keycode.h +++ b/src/keycode.h @@ -21,11 +21,13 @@ with this program; if not, write to the Free Software Foundation, Inc., #define KEYCODE_HEADER #include "common_irrlicht.h" +#include irr::EKEY_CODE keyname_to_keycode(const char *name); // Key configuration getter irr::EKEY_CODE getKeySetting(const char *settingname); - +std::string keycode_to_keyname(s32 keycode); +void clearCache(); #endif From 4800f1df974e78d4bd9de36a2ff8478771d6fedf Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Thu, 2 Jun 2011 03:03:47 +0200 Subject: [PATCH 023/158] * README updated --- README | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README b/README index 70d1104..4610ed1 100644 --- a/README +++ b/README @@ -1,5 +1,8 @@ Minetest Δ (“Minetest Delta”) is a fork of Minetest-c55 , incorporating experimental features that are not (yet) included in Minetest-c55. +New features: +* Submenu for key assignment (changes apply after restart) + New bricks: * Sandstone (crafted from 4 sand, yields sand) * Cactus (plant that grows on sand) From 4b2b65df9ff9903e64a2831be7411bc9a3afd8be Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Thu, 2 Jun 2011 16:17:50 +0200 Subject: [PATCH 024/158] =?UTF-8?q?+=20minetestmapper2,=20colors=20modifie?= =?UTF-8?q?d=20for=20Minetest=20=CE=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- minetestmapper/colors.txt | 22 +++ minetestmapper/minetestmapper2.py | 272 ++++++++++++++++++++++++++++++ 2 files changed, 294 insertions(+) create mode 100644 minetestmapper/colors.txt create mode 100755 minetestmapper/minetestmapper2.py diff --git a/minetestmapper/colors.txt b/minetestmapper/colors.txt new file mode 100644 index 0000000..a7f8a36 --- /dev/null +++ b/minetestmapper/colors.txt @@ -0,0 +1,22 @@ +0 128 128 128 +1 107 134 51 +2 39 66 106 +3 255 255 0 +4 86 58 31 +5 48 95 8 +6 102 129 38 +7 178 178 0 +8 101 84 36 +9 39 66 106 +12 104 78 42 +13 210 194 156 +14 117 86 41 +15 128 79 0 +16 118 118 118 +18 123 123 123 +19 199 199 199 +20 183 183 222 +21 103 78 42 +23 115 210 22 +24 204 0 0 +25 211 215 207 diff --git a/minetestmapper/minetestmapper2.py b/minetestmapper/minetestmapper2.py new file mode 100755 index 0000000..f9b681b --- /dev/null +++ b/minetestmapper/minetestmapper2.py @@ -0,0 +1,272 @@ +#!/usr/bin/env python +# -*- coding: windows-1252 -*- + +# Made by j0gge, modified by celeron55 + +# This program is free software. It comes without any warranty, to +# the extent permitted by applicable law. You can redistribute it +# and/or modify it under the terms of the Do What The Fuck You Want +# To Public License, Version 2, as published by Sam Hocevar. See +# http://sam.zoy.org/wtfpl/COPYING for more details. + +# Requires Python Imaging Library: http://www.pythonware.com/products/pil/ + +# Some speed-up: ...lol, actually it slows it down. +#import psyco ; psyco.full() +#from psyco.classes import * + +import zlib +import Image, ImageDraw +import os +import string +import time + +def hex_to_int(h): + i = int(h,16) + if(i > 2047): + i-=4096 + return i + +def hex4_to_int(h): + i = int(h,16) + if(i > 32767): + i-=65536 + return i + +def int_to_hex3(i): + if(i < 0): + return "%03X" % (i + 4096) + else: + return "%03X" % i + +def int_to_hex4(i): + if(i < 0): + return "%04X" % (i + 65536) + else: + return "%04X" % i + +def limit(i,l,h): + if(i>h): + i=h + if(i sector_xmax: + continue + if z < sector_zmin or z > sector_zmax: + continue + xlist.append(x) + zlist.append(z) +for filename in os.listdir(path + "sectors"): + x = hex4_to_int(filename[:4]) + z = hex4_to_int(filename[-4:]) + if x < sector_xmin or x > sector_xmax: + continue + if z < sector_zmin or z > sector_zmax: + continue + xlist.append(x) + zlist.append(z) + +w = (max(xlist) - min(xlist)) * 16 + 16 +h = (max(zlist) - min(zlist)) * 16 + 16 + +print "w="+str(w)+" h="+str(h) + +im = Image.new("RGB", (w, h), "white") +impix = im.load() + +stuff={} + +starttime = time.time() + +# Go through all sectors. +for n in range(len(xlist)): + #if n > 500: + # break + if n % 200 == 0: + nowtime = time.time() + dtime = nowtime - starttime + n_per_second = 1.0 * n / dtime + if n_per_second != 0: + seconds_per_n = 1.0 / n_per_second + time_guess = seconds_per_n * len(xlist) + remaining_s = time_guess - dtime + remaining_minutes = int(remaining_s / 60) + remaining_s -= remaining_minutes * 60; + print("Processing sector "+str(n)+" of "+str(len(xlist)) + +" ("+str(round(100.0*n/len(xlist), 1))+"%)" + +" (ETA: "+str(remaining_minutes)+"m " + +str(int(remaining_s))+"s)") + + xpos = xlist[n] + zpos = zlist[n] + + xhex = int_to_hex3(xpos) + zhex = int_to_hex3(zpos) + xhex4 = int_to_hex4(xpos) + zhex4 = int_to_hex4(zpos) + + sector1 = xhex4.lower() + zhex4.lower() + sector2 = xhex.lower() + "/" + zhex.lower() + + ylist=[] + + sectortype = "" + + try: + for filename in os.listdir(path + "sectors/" + sector1): + if(filename != "meta"): + pos = int(filename,16) + if(pos > 32767): + pos-=65536 + ylist.append(pos) + sectortype = "old" + except OSError: + pass + + if sectortype != "old": + try: + for filename in os.listdir(path + "sectors2/" + sector2): + if(filename != "meta"): + pos = int(filename,16) + if(pos > 32767): + pos-=65536 + ylist.append(pos) + sectortype = "new" + except OSError: + pass + + if sectortype == "": + continue + + ylist.sort() + + # Make a list of pixels of the sector that are to be looked for. + pixellist = [] + for x in range(16): + for y in range(16): + pixellist.append((x,y)) + + # Go through the Y axis from top to bottom. + for ypos in reversed(ylist): + + yhex = int_to_hex4(ypos) + + filename = "" + if sectortype == "old": + filename = path + "sectors/" + sector1 + "/" + yhex.lower() + else: + filename = path + "sectors2/" + sector2 + "/" + yhex.lower() + + f = file(filename, "rb") + + # Let's just memorize these even though it's not really necessary. + version = f.read(1) + flags = f.read(1) + + dec_o = zlib.decompressobj() + try: + mapdata = dec_o.decompress(f.read()) + except: + mapdata = [] + + f.close() + + if(len(mapdata)<4096): + print "bad: " + xhex+zhex+"/"+yhex + " " + len(mapdata) + else: + chunkxpos=xpos*16 + chunkypos=ypos*16 + chunkzpos=zpos*16 + for (x,z) in reversed(pixellist): + for y in reversed(range(16)): + datapos=x+y*16+z*256 + if(ord(mapdata[datapos])!=254): + try: + pixellist.remove((x,z)) + # Memorize information on the type and height of the block and for drawing the picture. + stuff[(chunkxpos+x,chunkzpos+z)]=(chunkypos+y,ord(mapdata[datapos])) + break + except: + print "strange block: " + xhex+zhex+"/"+yhex + " x: " + str(x) + " y: " + str(y) + " z: " + str(z) + " block: " + str(ord(mapdata[datapos])) + + # After finding all the pixeld in the sector, we can move on to the next sector without having to continue the Y axis. + if(len(pixellist)==0): + break + +print "Drawing image" +# Drawing the picture +starttime = time.time() +n = 0 +minx = min(xlist) +minz = min(zlist) +for (x,z) in stuff.iterkeys(): + if n % 500000 == 0: + nowtime = time.time() + dtime = nowtime - starttime + n_per_second = 1.0 * n / dtime + if n_per_second != 0: + listlen = len(stuff) + seconds_per_n = 1.0 / n_per_second + time_guess = seconds_per_n * listlen + remaining_s = time_guess - dtime + remaining_minutes = int(remaining_s / 60) + remaining_s -= remaining_minutes * 60; + print("Drawing pixel "+str(n)+" of "+str(listlen) + +" ("+str(round(100.0*n/listlen, 1))+"%)" + +" (ETA: "+str(remaining_minutes)+"m " + +str(int(remaining_s))+"s)") + n += 1 + + (r,g,b)=colors[stuff[(x,z)][1]] + + # Comparing heights of a couple of adjacent blocks and changing brightness accordingly. + try: + y1=stuff[(x-1,z)][0] + y2=stuff[(x,z-1)][0] + y=stuff[(x,z)][0] + + d=(y-y1+y-y2)*12 + + if(d>36): + d=36 + + r=limit(r+d,0,255) + g=limit(g+d,0,255) + b=limit(b+d,0,255) + except: + pass + #impix[w-1-(x-minx*16),h-1-(z-minz*16)]=(r,g,b) + impix[x-minx*16,h-1-(z-minz*16)]=(r,g,b) + +# Flip the picture to make it right and save. +#print "Transposing" +#im=im.transpose(Image.FLIP_TOP_BOTTOM) +print "Saving" +im.save(output) From cc65bda2cc727e813b06e2e819df39ce64ccf69b Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Thu, 2 Jun 2011 16:52:25 +0200 Subject: [PATCH 025/158] + sandstone color value now in minetestmapper --- minetestmapper/colors.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/minetestmapper/colors.txt b/minetestmapper/colors.txt index a7f8a36..a91a3c9 100644 --- a/minetestmapper/colors.txt +++ b/minetestmapper/colors.txt @@ -17,6 +17,7 @@ 19 199 199 199 20 183 183 222 21 103 78 42 +22 219 202 178 23 115 210 22 24 204 0 0 25 211 215 207 From 33264d0fb6b386f702191991815554c13ebdded9 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Thu, 2 Jun 2011 16:54:05 +0200 Subject: [PATCH 026/158] * ignore minetestmapper output --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 64ebbef..ee3aa43 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ Makefile cmake_install.cmake src/jthread/libjthread.a debug.txt +minetestmapper/map.png From de8996ac3b2962aa6d3f613a6f99e77021540a45 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Thu, 2 Jun 2011 17:13:00 +0200 Subject: [PATCH 027/158] * tabs to spaces --- minetestmapper/minetestmapper2.py | 370 +++++++++++++++--------------- 1 file changed, 185 insertions(+), 185 deletions(-) diff --git a/minetestmapper/minetestmapper2.py b/minetestmapper/minetestmapper2.py index f9b681b..6330ceb 100755 --- a/minetestmapper/minetestmapper2.py +++ b/minetestmapper/minetestmapper2.py @@ -12,7 +12,7 @@ # Requires Python Imaging Library: http://www.pythonware.com/products/pil/ # Some speed-up: ...lol, actually it slows it down. -#import psyco ; psyco.full() +#import psyco ; psyco.full() #from psyco.classes import * import zlib @@ -22,36 +22,36 @@ import string import time def hex_to_int(h): - i = int(h,16) - if(i > 2047): - i-=4096 - return i + i = int(h,16) + if(i > 2047): + i-=4096 + return i def hex4_to_int(h): - i = int(h,16) - if(i > 32767): - i-=65536 - return i + i = int(h,16) + if(i > 32767): + i-=65536 + return i def int_to_hex3(i): - if(i < 0): - return "%03X" % (i + 4096) - else: - return "%03X" % i + if(i < 0): + return "%03X" % (i + 4096) + else: + return "%03X" % i def int_to_hex4(i): - if(i < 0): - return "%04X" % (i + 65536) - else: - return "%04X" % i + if(i < 0): + return "%04X" % (i + 65536) + else: + return "%04X" % i def limit(i,l,h): - if(i>h): - i=h - if(ih): + i=h + if(i sector_xmax: - continue - if z < sector_zmin or z > sector_zmax: - continue - xlist.append(x) - zlist.append(z) + for filename2 in os.listdir(path + "sectors2/" + filename): + x = hex_to_int(filename) + z = hex_to_int(filename2) + if x < sector_xmin or x > sector_xmax: + continue + if z < sector_zmin or z > sector_zmax: + continue + xlist.append(x) + zlist.append(z) for filename in os.listdir(path + "sectors"): - x = hex4_to_int(filename[:4]) - z = hex4_to_int(filename[-4:]) - if x < sector_xmin or x > sector_xmax: - continue - if z < sector_zmin or z > sector_zmax: - continue - xlist.append(x) - zlist.append(z) + x = hex4_to_int(filename[:4]) + z = hex4_to_int(filename[-4:]) + if x < sector_xmin or x > sector_xmax: + continue + if z < sector_zmin or z > sector_zmax: + continue + xlist.append(x) + zlist.append(z) w = (max(xlist) - min(xlist)) * 16 + 16 h = (max(zlist) - min(zlist)) * 16 + 16 @@ -107,118 +107,118 @@ starttime = time.time() # Go through all sectors. for n in range(len(xlist)): - #if n > 500: - # break - if n % 200 == 0: - nowtime = time.time() - dtime = nowtime - starttime - n_per_second = 1.0 * n / dtime - if n_per_second != 0: - seconds_per_n = 1.0 / n_per_second - time_guess = seconds_per_n * len(xlist) - remaining_s = time_guess - dtime - remaining_minutes = int(remaining_s / 60) - remaining_s -= remaining_minutes * 60; - print("Processing sector "+str(n)+" of "+str(len(xlist)) - +" ("+str(round(100.0*n/len(xlist), 1))+"%)" - +" (ETA: "+str(remaining_minutes)+"m " - +str(int(remaining_s))+"s)") + #if n > 500: + # break + if n % 200 == 0: + nowtime = time.time() + dtime = nowtime - starttime + n_per_second = 1.0 * n / dtime + if n_per_second != 0: + seconds_per_n = 1.0 / n_per_second + time_guess = seconds_per_n * len(xlist) + remaining_s = time_guess - dtime + remaining_minutes = int(remaining_s / 60) + remaining_s -= remaining_minutes * 60; + print("Processing sector "+str(n)+" of "+str(len(xlist)) + +" ("+str(round(100.0*n/len(xlist), 1))+"%)" + +" (ETA: "+str(remaining_minutes)+"m " + +str(int(remaining_s))+"s)") - xpos = xlist[n] - zpos = zlist[n] - - xhex = int_to_hex3(xpos) - zhex = int_to_hex3(zpos) - xhex4 = int_to_hex4(xpos) - zhex4 = int_to_hex4(zpos) - - sector1 = xhex4.lower() + zhex4.lower() - sector2 = xhex.lower() + "/" + zhex.lower() - - ylist=[] - - sectortype = "" - - try: - for filename in os.listdir(path + "sectors/" + sector1): - if(filename != "meta"): - pos = int(filename,16) - if(pos > 32767): - pos-=65536 - ylist.append(pos) - sectortype = "old" - except OSError: - pass - - if sectortype != "old": - try: - for filename in os.listdir(path + "sectors2/" + sector2): - if(filename != "meta"): - pos = int(filename,16) - if(pos > 32767): - pos-=65536 - ylist.append(pos) - sectortype = "new" - except OSError: - pass - - if sectortype == "": - continue + xpos = xlist[n] + zpos = zlist[n] - ylist.sort() - - # Make a list of pixels of the sector that are to be looked for. - pixellist = [] - for x in range(16): - for y in range(16): - pixellist.append((x,y)) - - # Go through the Y axis from top to bottom. - for ypos in reversed(ylist): - - yhex = int_to_hex4(ypos) + xhex = int_to_hex3(xpos) + zhex = int_to_hex3(zpos) + xhex4 = int_to_hex4(xpos) + zhex4 = int_to_hex4(zpos) - filename = "" - if sectortype == "old": - filename = path + "sectors/" + sector1 + "/" + yhex.lower() - else: - filename = path + "sectors2/" + sector2 + "/" + yhex.lower() + sector1 = xhex4.lower() + zhex4.lower() + sector2 = xhex.lower() + "/" + zhex.lower() - f = file(filename, "rb") + ylist=[] - # Let's just memorize these even though it's not really necessary. - version = f.read(1) - flags = f.read(1) + sectortype = "" - dec_o = zlib.decompressobj() - try: - mapdata = dec_o.decompress(f.read()) - except: - mapdata = [] - - f.close() - - if(len(mapdata)<4096): - print "bad: " + xhex+zhex+"/"+yhex + " " + len(mapdata) - else: - chunkxpos=xpos*16 - chunkypos=ypos*16 - chunkzpos=zpos*16 - for (x,z) in reversed(pixellist): - for y in reversed(range(16)): - datapos=x+y*16+z*256 - if(ord(mapdata[datapos])!=254): - try: - pixellist.remove((x,z)) - # Memorize information on the type and height of the block and for drawing the picture. - stuff[(chunkxpos+x,chunkzpos+z)]=(chunkypos+y,ord(mapdata[datapos])) - break - except: - print "strange block: " + xhex+zhex+"/"+yhex + " x: " + str(x) + " y: " + str(y) + " z: " + str(z) + " block: " + str(ord(mapdata[datapos])) - - # After finding all the pixeld in the sector, we can move on to the next sector without having to continue the Y axis. - if(len(pixellist)==0): - break + try: + for filename in os.listdir(path + "sectors/" + sector1): + if(filename != "meta"): + pos = int(filename,16) + if(pos > 32767): + pos-=65536 + ylist.append(pos) + sectortype = "old" + except OSError: + pass + + if sectortype != "old": + try: + for filename in os.listdir(path + "sectors2/" + sector2): + if(filename != "meta"): + pos = int(filename,16) + if(pos > 32767): + pos-=65536 + ylist.append(pos) + sectortype = "new" + except OSError: + pass + + if sectortype == "": + continue + + ylist.sort() + + # Make a list of pixels of the sector that are to be looked for. + pixellist = [] + for x in range(16): + for y in range(16): + pixellist.append((x,y)) + + # Go through the Y axis from top to bottom. + for ypos in reversed(ylist): + + yhex = int_to_hex4(ypos) + + filename = "" + if sectortype == "old": + filename = path + "sectors/" + sector1 + "/" + yhex.lower() + else: + filename = path + "sectors2/" + sector2 + "/" + yhex.lower() + + f = file(filename, "rb") + + # Let's just memorize these even though it's not really necessary. + version = f.read(1) + flags = f.read(1) + + dec_o = zlib.decompressobj() + try: + mapdata = dec_o.decompress(f.read()) + except: + mapdata = [] + + f.close() + + if(len(mapdata)<4096): + print "bad: " + xhex+zhex+"/"+yhex + " " + len(mapdata) + else: + chunkxpos=xpos*16 + chunkypos=ypos*16 + chunkzpos=zpos*16 + for (x,z) in reversed(pixellist): + for y in reversed(range(16)): + datapos=x+y*16+z*256 + if(ord(mapdata[datapos])!=254): + try: + pixellist.remove((x,z)) + # Memorize information on the type and height of the block and for drawing the picture. + stuff[(chunkxpos+x,chunkzpos+z)]=(chunkypos+y,ord(mapdata[datapos])) + break + except: + print "strange block: " + xhex+zhex+"/"+yhex + " x: " + str(x) + " y: " + str(y) + " z: " + str(z) + " block: " + str(ord(mapdata[datapos])) + + # After finding all the pixeld in the sector, we can move on to the next sector without having to continue the Y axis. + if(len(pixellist)==0): + break print "Drawing image" # Drawing the picture @@ -227,46 +227,46 @@ n = 0 minx = min(xlist) minz = min(zlist) for (x,z) in stuff.iterkeys(): - if n % 500000 == 0: - nowtime = time.time() - dtime = nowtime - starttime - n_per_second = 1.0 * n / dtime - if n_per_second != 0: - listlen = len(stuff) - seconds_per_n = 1.0 / n_per_second - time_guess = seconds_per_n * listlen - remaining_s = time_guess - dtime - remaining_minutes = int(remaining_s / 60) - remaining_s -= remaining_minutes * 60; - print("Drawing pixel "+str(n)+" of "+str(listlen) - +" ("+str(round(100.0*n/listlen, 1))+"%)" - +" (ETA: "+str(remaining_minutes)+"m " - +str(int(remaining_s))+"s)") - n += 1 + if n % 500000 == 0: + nowtime = time.time() + dtime = nowtime - starttime + n_per_second = 1.0 * n / dtime + if n_per_second != 0: + listlen = len(stuff) + seconds_per_n = 1.0 / n_per_second + time_guess = seconds_per_n * listlen + remaining_s = time_guess - dtime + remaining_minutes = int(remaining_s / 60) + remaining_s -= remaining_minutes * 60; + print("Drawing pixel "+str(n)+" of "+str(listlen) + +" ("+str(round(100.0*n/listlen, 1))+"%)" + +" (ETA: "+str(remaining_minutes)+"m " + +str(int(remaining_s))+"s)") + n += 1 - (r,g,b)=colors[stuff[(x,z)][1]] - - # Comparing heights of a couple of adjacent blocks and changing brightness accordingly. - try: - y1=stuff[(x-1,z)][0] - y2=stuff[(x,z-1)][0] - y=stuff[(x,z)][0] - - d=(y-y1+y-y2)*12 - - if(d>36): - d=36 - - r=limit(r+d,0,255) - g=limit(g+d,0,255) - b=limit(b+d,0,255) - except: - pass - #impix[w-1-(x-minx*16),h-1-(z-minz*16)]=(r,g,b) - impix[x-minx*16,h-1-(z-minz*16)]=(r,g,b) + (r,g,b)=colors[stuff[(x,z)][1]] + + # Comparing heights of a couple of adjacent blocks and changing brightness accordingly. + try: + y1=stuff[(x-1,z)][0] + y2=stuff[(x,z-1)][0] + y=stuff[(x,z)][0] + + d=(y-y1+y-y2)*12 + + if(d>36): + d=36 + + r=limit(r+d,0,255) + g=limit(g+d,0,255) + b=limit(b+d,0,255) + except: + pass + #impix[w-1-(x-minx*16),h-1-(z-minz*16)]=(r,g,b) + impix[x-minx*16,h-1-(z-minz*16)]=(r,g,b) # Flip the picture to make it right and save. #print "Transposing" -#im=im.transpose(Image.FLIP_TOP_BOTTOM) +#im=im.transpose(Image.FLIP_TOP_BOTTOM) print "Saving" im.save(output) From 34e57da1ca55ee13fb3df1f06b8fad61f7cac016 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Thu, 2 Jun 2011 17:19:50 +0200 Subject: [PATCH 028/158] * encoding fix --- minetestmapper/minetestmapper2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minetestmapper/minetestmapper2.py b/minetestmapper/minetestmapper2.py index 6330ceb..b7264fe 100755 --- a/minetestmapper/minetestmapper2.py +++ b/minetestmapper/minetestmapper2.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# -*- coding: windows-1252 -*- +# -*- coding: utf-8 -*- # Made by j0gge, modified by celeron55 From bd5cdbf1a44c8ce969867e1b24d9ec6918c14a0c Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Thu, 2 Jun 2011 17:21:58 +0200 Subject: [PATCH 029/158] + check if sectors/sectors2 directories exist before attempting to read them --- minetestmapper/minetestmapper2.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/minetestmapper/minetestmapper2.py b/minetestmapper/minetestmapper2.py index b7264fe..8dc3de2 100755 --- a/minetestmapper/minetestmapper2.py +++ b/minetestmapper/minetestmapper2.py @@ -73,25 +73,28 @@ xlist = [] zlist = [] # List all sectors to memory and calculate the width and heigth of the resulting picture. -for filename in os.listdir(path + "sectors2"): - for filename2 in os.listdir(path + "sectors2/" + filename): - x = hex_to_int(filename) - z = hex_to_int(filename2) +if os.path.exists(path + "sectors2"): + for filename in os.listdir(path + "sectors2"): + for filename2 in os.listdir(path + "sectors2/" + filename): + x = hex_to_int(filename) + z = hex_to_int(filename2) + if x < sector_xmin or x > sector_xmax: + continue + if z < sector_zmin or z > sector_zmax: + continue + xlist.append(x) + zlist.append(z) + +if os.path.exists(path + "sectors"): + for filename in os.listdir(path + "sectors"): + x = hex4_to_int(filename[:4]) + z = hex4_to_int(filename[-4:]) if x < sector_xmin or x > sector_xmax: continue if z < sector_zmin or z > sector_zmax: continue xlist.append(x) zlist.append(z) -for filename in os.listdir(path + "sectors"): - x = hex4_to_int(filename[:4]) - z = hex4_to_int(filename[-4:]) - if x < sector_xmin or x > sector_xmax: - continue - if z < sector_zmin or z > sector_zmax: - continue - xlist.append(x) - zlist.append(z) w = (max(xlist) - min(xlist)) * 16 + 16 h = (max(zlist) - min(zlist)) * 16 + 16 From e627f023a09bcb9db2ace81832c2c326ef38d0ec Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Fri, 3 Jun 2011 00:52:36 +0200 Subject: [PATCH 030/158] * made cactus color darker --- minetestmapper/colors.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minetestmapper/colors.txt b/minetestmapper/colors.txt index a91a3c9..144d798 100644 --- a/minetestmapper/colors.txt +++ b/minetestmapper/colors.txt @@ -18,6 +18,6 @@ 20 183 183 222 21 103 78 42 22 219 202 178 -23 115 210 22 +23 78 154 6 24 204 0 0 25 211 215 207 From 3bb1cfdf360c50aa317b029c2886de80dc4d573d Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Fri, 3 Jun 2011 00:55:28 +0200 Subject: [PATCH 031/158] + papyrus --- data/papyrus.png | Bin 0 -> 366 bytes src/map.cpp | 27 +++++++++++++++++++-- src/mapblock.cpp | 58 ++++++++++++++++++++++++++++++++++++++++++++++ src/mapnode.cpp | 10 ++++++++ src/mapnode.h | 1 + src/materials.cpp | 1 + src/server.cpp | 1 + src/tile.cpp | 1 + 8 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 data/papyrus.png diff --git a/data/papyrus.png b/data/papyrus.png new file mode 100644 index 0000000000000000000000000000000000000000..bf0dec7fe2f2048a4f521c8efce41fd775ef1339 GIT binary patch literal 366 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfZ8j!h8TlvGX3u~^k|nMYCC>S|xv6<249-QVi6yBi3gww4 z84B*6z5(HleBwYww>@1PLo7}w$NbQk_)zum)BpPRHc2lo)}Gw)qEN_h-;M^E`sQ-fP#!OO#8CHBS# z{=^hT{;@x~ae?}Svkg=9BsirSbe}%_Y<%@FFaUlvmanip, v2s16(x,z)); // Don't make a tree under water level - if(y < WATER_LEVEL) + if(y < WATER_LEVEL - 1) continue; // Don't make a tree so high that it doesn't fit if(y > y_nodes_max - 6) @@ -3236,6 +3250,15 @@ void makeChunk(ChunkMakeData *data) MapNode *n = &data->vmanip.m_data[i]; if(n->d != CONTENT_MUD && n->d != CONTENT_GRASS && n->d != CONTENT_SAND) continue; + // Papyrus grows only on mud and in water + if(n->d == CONTENT_MUD && y == WATER_LEVEL - 1) + { + p.Y++; + make_papyrus(data->vmanip, p); + } + // Don't make a tree under water level + if(y < WATER_LEVEL) + continue; // Trees grow only on mud and grass if(n->d == CONTENT_MUD || n->d == CONTENT_GRASS) { @@ -3243,7 +3266,7 @@ void makeChunk(ChunkMakeData *data) make_tree(data->vmanip, p); } // Cactii grow only on sand - if(n->d == CONTENT_SAND) + else if(n->d == CONTENT_SAND) { p.Y++; make_cactus(data->vmanip, p); diff --git a/src/mapblock.cpp b/src/mapblock.cpp index d98bfaf..c6b8263 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -987,6 +987,16 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data) g_texturesource->getTextureId("wood.png")); material_wood.setTexture(0, pa_wood.atlas); + // Papyrus material + video::SMaterial material_papyrus; + material_papyrus.setFlag(video::EMF_LIGHTING, false); + material_papyrus.setFlag(video::EMF_BILINEAR_FILTER, false); + material_papyrus.setFlag(video::EMF_FOG_ENABLE, true); + material_papyrus.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; + AtlasPointer pa_papyrus = g_texturesource->getTexture( + g_texturesource->getTextureId("papyrus.png")); + material_papyrus.setTexture(0, pa_papyrus.atlas); + for(s16 z=0; zm_daynight_ratio))); + video::SColor c(255,l,l,l); + for(u32 j=0; j<4; j++) + { + video::S3DVertex vertices[4] = + { + video::S3DVertex(-BS/2,-BS/2,0, 0,0,0, c, + pa_papyrus.x0(), pa_papyrus.y1()), + video::S3DVertex(BS/2,-BS/2,0, 0,0,0, c, + pa_papyrus.x1(), pa_papyrus.y1()), + video::S3DVertex(BS/2,BS/2,0, 0,0,0, c, + pa_papyrus.x1(), pa_papyrus.y0()), + video::S3DVertex(-BS/2,BS/2,0, 0,0,0, c, + pa_papyrus.x0(), pa_papyrus.y0()), + }; + if(j == 0) + { + for(u16 i=0; i<4; i++) + vertices[i].Pos.rotateXZBy(45); + } + else if(j == 1) + { + for(u16 i=0; i<4; i++) + vertices[i].Pos.rotateXZBy(-45); + } + else if(j == 2) + { + for(u16 i=0; i<4; i++) + vertices[i].Pos.rotateXZBy(135); + } + else if(j == 3) + { + for(u16 i=0; i<4; i++) + vertices[i].Pos.rotateXZBy(-135); + } + + for(u16 i=0; i<4; i++) + { + vertices[i].Pos += intToFloat(p + blockpos_nodes, BS); + } + + u16 indices[] = {0,1,2,2,3,0}; + // Add to mesh collector + collector.append(material_papyrus, vertices, 4, indices, 6); + } + } } diff --git a/src/mapnode.cpp b/src/mapnode.cpp index cef9bbf..954c85f 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -241,6 +241,16 @@ void init_mapnode() f->is_ground_content = true; f->dug_item = std::string("MaterialItem ")+itos(i)+" 1"; + i = CONTENT_PAPYRUS; + f = &g_content_features[i]; + f->setInventoryTexture("papyrus.png"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->walkable = false; + i = CONTENT_GLASS; f = &g_content_features[i]; f->light_propagates = true; diff --git a/src/mapnode.h b/src/mapnode.h index e8cc0ab..52d0199 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -105,6 +105,7 @@ void init_content_inventory_texture_paths(); #define CONTENT_CACTUS 23 #define CONTENT_BRICK 24 #define CONTENT_CLAY 25 +#define CONTENT_PAPYRUS 26 /* Content feature list diff --git a/src/materials.cpp b/src/materials.cpp index 8c23056..e95ca7b 100644 --- a/src/materials.cpp +++ b/src/materials.cpp @@ -76,6 +76,7 @@ void initializeMaterialProperties() setWoodLikeDiggingProperties(CONTENT_TREE, 1.0); setWoodLikeDiggingProperties(CONTENT_LEAVES, 0.15); setWoodLikeDiggingProperties(CONTENT_CACTUS, 0.75); + setWoodLikeDiggingProperties(CONTENT_PAPYRUS, 0.25); setWoodLikeDiggingProperties(CONTENT_GLASS, 0.15); setWoodLikeDiggingProperties(CONTENT_FENCE, 0.75); setWoodLikeDiggingProperties(CONTENT_WOOD, 0.75); diff --git a/src/server.cpp b/src/server.cpp index 17850c5..e987545 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -4111,6 +4111,7 @@ void setCreativeInventory(Player *player) CONTENT_TREE, CONTENT_LEAVES, CONTENT_CACTUS, + CONTENT_PAPYRUS, CONTENT_GLASS, CONTENT_FENCE, CONTENT_MESE, diff --git a/src/tile.cpp b/src/tile.cpp index 71e0c96..c77262c 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -517,6 +517,7 @@ void TextureSource::buildMainAtlas() sourcelist.push_back("leaves.png"); sourcelist.push_back("cactus_side.png"); sourcelist.push_back("cactus_top.png"); + sourcelist.push_back("papyrus.png"); sourcelist.push_back("glass.png"); sourcelist.push_back("mud.png^grass_side.png"); sourcelist.push_back("cobble.png"); From 8da4a4276ff1b8da0aa087548b4bf032098196d1 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Fri, 3 Jun 2011 00:56:27 +0200 Subject: [PATCH 032/158] + papyrus in minetestmapper --- minetestmapper/colors.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/minetestmapper/colors.txt b/minetestmapper/colors.txt index 144d798..7c2d3f9 100644 --- a/minetestmapper/colors.txt +++ b/minetestmapper/colors.txt @@ -21,3 +21,4 @@ 23 78 154 6 24 204 0 0 25 211 215 207 +26 138 226 52 From 17e17ceb599588295d9f8eb7edf46fb39972d78c Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Fri, 3 Jun 2011 00:57:39 +0200 Subject: [PATCH 033/158] * README updated --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index 4610ed1..c273889 100644 --- a/README +++ b/README @@ -8,6 +8,7 @@ New bricks: * Cactus (plant that grows on sand) * Clay (found in sand at sea level, yields 4 lumps of clay) * Brick (made from 4 clay bricks, yields 4 clay bricks) +* Papyrus (plant that grows in shallow water) New materials: * Lump of clay From 1bd25925cb8b4f96f5d5deec348db1214f3da525 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Fri, 3 Jun 2011 13:12:56 +0200 Subject: [PATCH 034/158] + paper, book, bookshelf --- data/book.png | Bin 0 -> 292 bytes data/bookshelf.png | Bin 0 -> 597 bytes data/paper.png | Bin 0 -> 242 bytes src/inventory.cpp | 4 ++++ src/mapnode.cpp | 11 ++++++++++ src/mapnode.h | 1 + src/materials.cpp | 1 + src/server.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++ src/tile.cpp | 1 + 9 files changed, 67 insertions(+) create mode 100644 data/book.png create mode 100644 data/bookshelf.png create mode 100644 data/paper.png diff --git a/data/book.png b/data/book.png new file mode 100644 index 0000000000000000000000000000000000000000..176fb6aa96154614c7edb3a7ed80064d23a8fceb GIT binary patch literal 292 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRt!3HF+tk*dLq!^2X+?^QKos)S9vL>4nJ za0`PlBg3pY5H=O_SORIEGl9PEL@>IN;&oSg&%qUSfB_ zPkXmTybjkocrNfJsx0|IqP)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RW1_J>KEte|7$^ZZX=Sf6CR4C7- zQq61Aa2S5_%bTRBSzR$8Oxw#ktsn{=dYK1hc-f@`Jq&vAQkVp9$~^3%;1IkCK_-Yy z{{TTz4}P#BC?RO4;$ea^u~tzlOJ`!+^q0g#Yn>f};B$I;-mi!Ed4+S+qr`|ezq=uE zCIeB!t4CqT;435|qQrnEO9WChO(jVoZF6#=fNO8|;SYp>R~QS};^K4D zuuQ`OaCL{}==omBDckDBj-Ge){Ib17nVs8zq^<)<7bo%P_rP?qoV5Yq@X+}Ej}MO@ z3<1!)ENj(k@ybNJGSMr|4JUHLU4@;^reV#O*nElkjWyfN>6xcC zfESbFqpE$eJ~vpqdFh0W2Y51g7Qg{OO{VGYt;e&MPj(uvL>4nJ za0`PlBg3pY5H=O_SKve#96}gV#iqlw;solidness = 0; // drawn separately, makes no faces f->walkable = false; + i = CONTENT_BOOKSHELF; + f = &g_content_features[i]; + f->setAllTextures("bookshelf.png"); + f->setTexture(0, "wood.png"); + f->setTexture(1, "wood.png"); + // FIXME: setInventoryTextureCube() only cares for the first texture + f->setInventoryTextureCube("bookshelf.png", "bookshelf.png", "bookshelf.png"); + //f->setInventoryTextureCube("wood.png", "bookshelf.png", "bookshelf.png"); + f->param_type = CPT_MINERAL; + f->is_ground_content = true; + i = CONTENT_GLASS; f = &g_content_features[i]; f->light_propagates = true; diff --git a/src/mapnode.h b/src/mapnode.h index 52d0199..57335b7 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -106,6 +106,7 @@ void init_content_inventory_texture_paths(); #define CONTENT_BRICK 24 #define CONTENT_CLAY 25 #define CONTENT_PAPYRUS 26 +#define CONTENT_BOOKSHELF 27 /* Content feature list diff --git a/src/materials.cpp b/src/materials.cpp index e95ca7b..7815f59 100644 --- a/src/materials.cpp +++ b/src/materials.cpp @@ -80,6 +80,7 @@ void initializeMaterialProperties() setWoodLikeDiggingProperties(CONTENT_GLASS, 0.15); setWoodLikeDiggingProperties(CONTENT_FENCE, 0.75); setWoodLikeDiggingProperties(CONTENT_WOOD, 0.75); + setWoodLikeDiggingProperties(CONTENT_BOOKSHELF, 0.75); setWoodLikeDiggingProperties(CONTENT_CHEST, 1.0); g_material_properties[CONTENT_SIGN_WALL].setDiggingProperties("", diff --git a/src/server.cpp b/src/server.cpp index e987545..f40ed05 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -4017,6 +4017,54 @@ void Server::UpdateCrafting(u16 peer_id) found = true; } } + + // Paper + if(!found) + { + ItemSpec specs[9]; + specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_PAPYRUS); + specs[4] = ItemSpec(ITEM_MATERIAL, CONTENT_PAPYRUS); + specs[5] = ItemSpec(ITEM_MATERIAL, CONTENT_PAPYRUS); + if(checkItemCombination(items, specs)) + { + rlist->addItem(new CraftItem("paper", 1)); + found = true; + } + } + + // Book + if(!found) + { + ItemSpec specs[9]; + specs[1] = ItemSpec(ITEM_CRAFT, "paper"); + specs[4] = ItemSpec(ITEM_CRAFT, "paper"); + specs[7] = ItemSpec(ITEM_CRAFT, "paper"); + if(checkItemCombination(items, specs)) + { + rlist->addItem(new CraftItem("book", 1)); + found = true; + } + } + + // Book shelf + if(!found) + { + ItemSpec specs[9]; + specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD); + specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD); + specs[2] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD); + specs[3] = ItemSpec(ITEM_CRAFT, "book"); + specs[4] = ItemSpec(ITEM_CRAFT, "book"); + specs[5] = ItemSpec(ITEM_CRAFT, "book"); + specs[6] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD); + specs[7] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD); + specs[8] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD); + if(checkItemCombination(items, specs)) + { + rlist->addItem(new MaterialItem(CONTENT_BOOKSHELF, 1)); + found = true; + } + } } } // if creative_mode == false @@ -4112,6 +4160,7 @@ void setCreativeInventory(Player *player) CONTENT_LEAVES, CONTENT_CACTUS, CONTENT_PAPYRUS, + CONTENT_BOOKSHELF, CONTENT_GLASS, CONTENT_FENCE, CONTENT_MESE, diff --git a/src/tile.cpp b/src/tile.cpp index c77262c..c703e14 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -518,6 +518,7 @@ void TextureSource::buildMainAtlas() sourcelist.push_back("cactus_side.png"); sourcelist.push_back("cactus_top.png"); sourcelist.push_back("papyrus.png"); + sourcelist.push_back("bookshelf.png"); sourcelist.push_back("glass.png"); sourcelist.push_back("mud.png^grass_side.png"); sourcelist.push_back("cobble.png"); From c3cd89705d4f9ce92c934f824caedb2f679cb780 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Fri, 3 Jun 2011 13:13:31 +0200 Subject: [PATCH 035/158] * point out setInventoryTextureCube() is broken with a FIXME --- src/tile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tile.cpp b/src/tile.cpp index c703e14..77084bf 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -1092,7 +1092,7 @@ bool generate_image(std::string part_of_name, video::IImage *& baseimg, imagename_right, device); assert(img_top && img_left && img_right); - // TODO: Create textures from images + // FIXME: Create textures from left and right images video::ITexture *texture_top = driver->addTexture( (imagename_top + "__temp__").c_str(), img_top); assert(texture_top); From 15ae9ca8a2def7271ac8bd2f262ce14df4f3589d Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Fri, 3 Jun 2011 13:31:42 +0200 Subject: [PATCH 036/158] + bookshelf in minetestmapper, same color as wood --- minetestmapper/colors.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/minetestmapper/colors.txt b/minetestmapper/colors.txt index 7c2d3f9..e70f56e 100644 --- a/minetestmapper/colors.txt +++ b/minetestmapper/colors.txt @@ -22,3 +22,4 @@ 24 204 0 0 25 211 215 207 26 138 226 52 +27 104 78 42 From b3c439fb16bb5a5566702f8d9d1cfcd2f9e20e18 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Fri, 3 Jun 2011 13:39:07 +0200 Subject: [PATCH 037/158] * README updated --- README | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README b/README index c273889..3230fd9 100644 --- a/README +++ b/README @@ -8,11 +8,14 @@ New bricks: * Cactus (plant that grows on sand) * Clay (found in sand at sea level, yields 4 lumps of clay) * Brick (made from 4 clay bricks, yields 4 clay bricks) -* Papyrus (plant that grows in shallow water) +* Papyrus (plant that grows in shallow water, yields paper) +* Book shelf (made from 6 wood and 3 books, sandwhiched) New materials: * Lump of clay * Clay brick (made from lumps of clay in the furnace) +* Paper +* Book (made from 3 paper) Alternate graphics: * Player From 51d308c666dfd023169b7d5e200fbefb3d315d3b Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Tue, 7 Jun 2011 19:24:30 +0200 Subject: [PATCH 038/158] + rail --- data/rail.png | Bin 0 -> 507 bytes data/rail_crossing.png | Bin 0 -> 555 bytes data/rail_curved.png | Bin 0 -> 545 bytes data/rail_t_junction.png | Bin 0 -> 542 bytes src/mapblock.cpp | 104 +++++++++++++++++++++++++++++++++++++++ src/mapnode.cpp | 11 +++++ src/mapnode.h | 1 + src/materials.cpp | 1 + src/server.cpp | 21 ++++++++ 9 files changed, 138 insertions(+) create mode 100644 data/rail.png create mode 100644 data/rail_crossing.png create mode 100644 data/rail_curved.png create mode 100644 data/rail_t_junction.png diff --git a/data/rail.png b/data/rail.png new file mode 100644 index 0000000000000000000000000000000000000000..18176d9f3ca96ec9d6e4f6d41ab7a370aa93afeb GIT binary patch literal 507 zcmVPx#32;bRa{vGf6951U69E94oEQKA0ia1lK~y-)&6B@N98na7zxU=j>tw-1NU+dC z$R7|iDkRvYlN13FYq7KtBq?H-#uQ1DLLq{r2&pX$1_VLKkH%H8P!L5{QJk!+E9*{n zX7{~$DP}X0Dv+e`l=mJ!?mgTK4J|D%+M(e=%O5l}JZP7e7gL`C`1G$_s@G%;@gRCt94BK9S=tc{8B`VrwD5XzZ8-yC%%tU5AEa0 zZ%GDwheg^NfZc;4K{aOo$Uz8D5~8}Lreho_z)O6&E&n=Y@L{qqCC-d@S?->n;GR+yChoegbuB)%daag-!qf002ovPDHLkV1f&}+gAVp literal 0 HcmV?d00001 diff --git a/data/rail_crossing.png b/data/rail_crossing.png new file mode 100644 index 0000000000000000000000000000000000000000..98464057704a84ab9dfeac63f13e9b1af8d6f1ae GIT binary patch literal 555 zcmV+`0@VG9P)Px#32;bRa{vGf6951U69E94oEQKA0nkZAK~y-)rIO1_TTu{)f0KKoRRR_lqV;bm zr9MLUuEdQf>aH763q==-RD)0`2t`A5A%f3E>!UtMqfi%uOLtnqN=hSIF*o-pii$|c z>ty({&l`wmn9nC&tD zH{AA?^Bi{ARl;OvDH8~}ISS4$W0-b1*|(SCzIB!H`>z{h1AxD~y6j~C@EDu^AQFir zb^-#M{vfve8te*TV<#xNKLOpG!k0OXZZF(EopQ4kgia&yEa^1#>zHD30}NnbSxBzm zt5e1?UWF6L&&!s%F#la8LLGMC{;szre zHPGi3)H|ab;?J8O#A-SS!%Zm%xl t#n10DZ{q#v_X+}p%soCq9-m0t(KTmX;6MA&eM$fT002ovPDHLkV1jh{_{snP literal 0 HcmV?d00001 diff --git a/data/rail_curved.png b/data/rail_curved.png new file mode 100644 index 0000000000000000000000000000000000000000..62afa3d2b81c4dc6f85275ea6de89ffb43a1be8b GIT binary patch literal 545 zcmV++0^a?JP)Px#32;bRa{vGf6951U69E94oEQKA0mey0K~y-)y^~K!lW`cwKfi6gPR1Y?nzVF- zL=q2^R^-8Bdg>w+Aq8Qg{Si8hC?ObxLVpgHC@34dc#&995Eu+Rb&64R=o+CI6;86b zcguHwo(|)kdubEB^xS?Ae811<`SXMS84s_Wl*N0er8?(0h{2Cdo#5qZ5(89B)PBW@ zm1O~lMq-w{I;gPCNaFW;xIOnt)otPaP=|E+nrP{NP!YzTzf=I@=Z}lWt?fMn!!Rmh zQ)q_AeTYH_F*VOk^mUQM1u{%N8#a0vw^6wU^t5@eIF8V}k&^XrY=El>H z3LrGtF5cF|WrFaPPMI3+mU<+Q;;Tx}8tB;^ixX!Az$geVr=v`8_kvH(-JB;HiE*jx z8+xutNlFYq`CuUl4YteCBQ6@98t*nbtSy-MZAKE8)6TCMdY=pOS*XikO-TO1mzFFTjQ;6NB jK=T98eWHb{kCW;zgEX_2=&9K_00000NkvXXu0mjfyq^6z literal 0 HcmV?d00001 diff --git a/data/rail_t_junction.png b/data/rail_t_junction.png new file mode 100644 index 0000000000000000000000000000000000000000..9985f63cd49ce29f636e72fe3b168fe1b6bad236 GIT binary patch literal 542 zcmV+(0^$9MP)Px#32;bRa{vGf6951U69E94oEQKA0mDf|K~y-)m6J_KRB;r=fB$)ZUZZ_L8#mDh z6@df|6=4fE5w?gnGRPpb3DLkd89|F;KxiSMsTeWLFzblP3<84zTeORaAX>G1evpBZ zito*PZ+!2znCAKQ)V#}c?>U@vxflLbd1_KRGHGFt>d2&}JT)23X@FNxS|T8K|Du>W zf$aq-AQaGsqPiAh>I5I>YjeZB7o_jycclS7eVe2GTCMTZTI6t}W^vi)P=lu81vDlN zTtCF|0yuISfb;1A%4tMxj8MoIDZL(7an|d$3;E(ETJI_k< z$)hy2^+&|Iv#pDc74UsOBJUKbUWquctv5#@UnJG=gE!f$vM+&+%UoEhVEtZZ^j=E# z<)B_8@21tS1&5VYm*T_A@?Qd5a}SPN%643=`4w_~mn2pod;8q3IR{FXvK=4Wsch?M z0N3>*Ak#d@tw&cRl#n~mzD7=l-dgHG`w78Z{|SI?mw4R&!oj4$pVca@sbf^UfaC## z&ZnO@-9dLxSNt73pO}tB6-YGzQ!7f@7Fn{_D9_f&A70#Lcw$EFddg$(XV=9PVk8up gr)tl1rU{tgFLW2g;W?8CasU7T07*qoM6N<$g8pIiBme*a literal 0 HcmV?d00001 diff --git a/src/mapblock.cpp b/src/mapblock.cpp index c6b8263..7104465 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -1672,6 +1672,110 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data) collector.append(material_papyrus, vertices, 4, indices, 6); } } + else if(n.d == CONTENT_RAIL) + { + u8 l = decode_light(n.getLightBlend(data->m_daynight_ratio)); + video::SColor c(255,l,l,l); + + bool is_rail_x [] = { false, false }; /* x-1, x+1 */ + bool is_rail_z [] = { false, false }; /* z-1, z+1 */ + + MapNode n_minus_x = data->m_vmanip.getNodeNoEx(blockpos_nodes + v3s16(x-1,y,z)); + MapNode n_plus_x = data->m_vmanip.getNodeNoEx(blockpos_nodes + v3s16(x+1,y,z)); + MapNode n_minus_z = data->m_vmanip.getNodeNoEx(blockpos_nodes + v3s16(x,y,z-1)); + MapNode n_plus_z = data->m_vmanip.getNodeNoEx(blockpos_nodes + v3s16(x,y,z+1)); + + if(n_minus_x.d == CONTENT_RAIL) + is_rail_x[0] = true; + if(n_plus_x.d == CONTENT_RAIL) + is_rail_x[1] = true; + if(n_minus_z.d == CONTENT_RAIL) + is_rail_z[0] = true; + if(n_plus_z.d == CONTENT_RAIL) + is_rail_z[1] = true; + + float d = (float)BS/16; + video::S3DVertex vertices[4] = + { + video::S3DVertex(-BS/2,-BS/2+d,-BS/2, 0,0,0, c, + 0, 1), + video::S3DVertex(BS/2,-BS/2+d,-BS/2, 0,0,0, c, + 1, 1), + video::S3DVertex(BS/2,-BS/2+d,BS/2, 0,0,0, c, + 1, 0), + video::S3DVertex(-BS/2,-BS/2+d,BS/2, 0,0,0, c, + 0, 0), + }; + + video::SMaterial material_rail; + material_rail.setFlag(video::EMF_LIGHTING, false); + material_rail.setFlag(video::EMF_BACK_FACE_CULLING, false); + material_rail.setFlag(video::EMF_BILINEAR_FILTER, false); + material_rail.setFlag(video::EMF_FOG_ENABLE, true); + material_rail.MaterialType + = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; + + int adjacencies = is_rail_x[0] + is_rail_x[1] + is_rail_z[0] + is_rail_z[1]; + + // Assign textures + if(adjacencies < 2) + material_rail.setTexture(0, g_texturesource->getTextureRaw("rail.png")); + else if(adjacencies == 2) + { + if((is_rail_x[0] && is_rail_x[1]) || (is_rail_z[0] && is_rail_z[1])) + material_rail.setTexture(0, g_texturesource->getTextureRaw("rail.png")); + else + material_rail.setTexture(0, g_texturesource->getTextureRaw("rail_curved.png")); + } + else if(adjacencies == 3) + material_rail.setTexture(0, g_texturesource->getTextureRaw("rail_t_junction.png")); + else if(adjacencies == 4) + material_rail.setTexture(0, g_texturesource->getTextureRaw("rail_crossing.png")); + + // Rotate textures + int angle = 0; + + if(adjacencies == 1) + { + if(is_rail_x[0] || is_rail_x[1]) + angle = 90; + } + else if(adjacencies == 2) + { + if(is_rail_x[0] && is_rail_x[1]) + angle = 90; + else if(is_rail_x[0] && is_rail_z[0]) + angle = 270; + else if(is_rail_x[0] && is_rail_z[1]) + angle = 180; + else if(is_rail_x[1] && is_rail_z[1]) + angle = 90; + } + else if(adjacencies == 3) + { + if(!is_rail_x[0]) + angle=0; + if(!is_rail_x[1]) + angle=180; + if(!is_rail_z[0]) + angle=90; + if(!is_rail_z[1]) + angle=270; + } + + if(angle != 0) { + for(u16 i=0; i<4; i++) + vertices[i].Pos.rotateXZBy(angle); + } + + for(s32 i=0; i<4; i++) + { + vertices[i].Pos += intToFloat(p + blockpos_nodes, BS); + } + + u16 indices[] = {0,1,2,2,3,0}; + collector.append(material_rail, vertices, 4, indices, 6); + } } diff --git a/src/mapnode.cpp b/src/mapnode.cpp index 7e97a8d..1c0a274 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -281,6 +281,17 @@ void init_mapnode() f->solidness = 0; // drawn separately, makes no faces f->air_equivalent = true; // grass grows underneath + i = CONTENT_RAIL; + f = &g_content_features[i]; + f->setInventoryTexture("rail.png"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->air_equivalent = true; // grass grows underneath + f->walkable = false; + // Deprecated i = CONTENT_COALSTONE; f = &g_content_features[i]; diff --git a/src/mapnode.h b/src/mapnode.h index 57335b7..409fe2b 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -107,6 +107,7 @@ void init_content_inventory_texture_paths(); #define CONTENT_CLAY 25 #define CONTENT_PAPYRUS 26 #define CONTENT_BOOKSHELF 27 +#define CONTENT_RAIL 28 /* Content feature list diff --git a/src/materials.cpp b/src/materials.cpp index 7815f59..a8a9a94 100644 --- a/src/materials.cpp +++ b/src/materials.cpp @@ -79,6 +79,7 @@ void initializeMaterialProperties() setWoodLikeDiggingProperties(CONTENT_PAPYRUS, 0.25); setWoodLikeDiggingProperties(CONTENT_GLASS, 0.15); setWoodLikeDiggingProperties(CONTENT_FENCE, 0.75); + setDirtLikeDiggingProperties(CONTENT_RAIL, 0.75); setWoodLikeDiggingProperties(CONTENT_WOOD, 0.75); setWoodLikeDiggingProperties(CONTENT_BOOKSHELF, 0.75); setWoodLikeDiggingProperties(CONTENT_CHEST, 1.0); diff --git a/src/server.cpp b/src/server.cpp index f40ed05..4e9ff07 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -3915,6 +3915,26 @@ void Server::UpdateCrafting(u16 peer_id) } } + // Rail + if(!found) + { + ItemSpec specs[9]; + specs[0] = ItemSpec(ITEM_CRAFT, "steel_ingot"); + specs[1] = ItemSpec(ITEM_CRAFT, "Stick"); + specs[2] = ItemSpec(ITEM_CRAFT, "steel_ingot"); + specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot"); + specs[4] = ItemSpec(ITEM_CRAFT, "Stick"); + specs[5] = ItemSpec(ITEM_CRAFT, "steel_ingot"); + specs[6] = ItemSpec(ITEM_CRAFT, "steel_ingot"); + specs[7] = ItemSpec(ITEM_CRAFT, "Stick"); + specs[8] = ItemSpec(ITEM_CRAFT, "steel_ingot"); + if(checkItemCombination(items, specs)) + { + rlist->addItem(new MaterialItem(CONTENT_RAIL, 15)); + found = true; + } + } + // Chest if(!found) { @@ -4163,6 +4183,7 @@ void setCreativeInventory(Player *player) CONTENT_BOOKSHELF, CONTENT_GLASS, CONTENT_FENCE, + CONTENT_RAIL, CONTENT_MESE, CONTENT_WATERSOURCE, CONTENT_CLOUD, From 2ec160454a013dfc84b109c5c0b0901ac1055559 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Tue, 7 Jun 2011 19:41:03 +0200 Subject: [PATCH 039/158] * README updated --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index 3230fd9..9b1f54e 100644 --- a/README +++ b/README @@ -10,6 +10,7 @@ New bricks: * Brick (made from 4 clay bricks, yields 4 clay bricks) * Papyrus (plant that grows in shallow water, yields paper) * Book shelf (made from 6 wood and 3 books, sandwhiched) +* Rail (made from 6 iron ingots and 3 sticks, vertically sandwhiched) New materials: * Lump of clay From e261cc9e8fa67c9020fa0a82bd1a7041ecd351a0 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 8 Jun 2011 05:27:51 +0200 Subject: [PATCH 040/158] + rail block bounding box --- src/game.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/game.cpp b/src/game.cpp index 7970a6e..bbd0a22 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -530,6 +530,43 @@ void getPointedNode(Client *client, v3f player_position, } } } + else if(n.d == CONTENT_RAIL) + { + v3s16 dir = unpackDir(n.dir); + v3f dir_f = v3f(dir.X, dir.Y, dir.Z); + dir_f *= BS/2 - BS/6 - BS/20; + v3f cpf = npf + dir_f; + f32 distance = (cpf - camera_position).getLength(); + + float d = (float)BS/16; + v3f vertices[4] = + { + v3f(BS/2, -BS/2+d, -BS/2), + v3f(-BS/2, -BS/2, BS/2), + }; + + for(s32 i=0; i<2; i++) + { + vertices[i] += npf; + } + + core::aabbox3d box; + + box = core::aabbox3d(vertices[0]); + box.addInternalPoint(vertices[1]); + + if(distance < mindistance) + { + if(box.intersectsWithLine(shootline)) + { + nodefound = true; + nodepos = np; + neighbourpos = np; + mindistance = distance; + nodehilightbox = box; + } + } + } /* Regular blocks */ From fb6ac9a1a6b68e87665a9e1692295230ebcef8db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20R=C3=BChl?= Date: Sun, 26 Jun 2011 12:52:03 +0200 Subject: [PATCH 041/158] small fix --- doc/README.txt | 238 ++++++++++++++++ makepackage_binary.sh | 63 +++++ src/guiKeyChangeMenu.cpp | 598 +++++++++++++++++++++++++++++++++++++++ src/guiKeyChangeMenu.h | 133 +++++++++ 4 files changed, 1032 insertions(+) create mode 100644 doc/README.txt create mode 100755 makepackage_binary.sh create mode 100644 src/guiKeyChangeMenu.cpp create mode 100644 src/guiKeyChangeMenu.h diff --git a/doc/README.txt b/doc/README.txt new file mode 100644 index 0000000..645e2a5 --- /dev/null +++ b/doc/README.txt @@ -0,0 +1,238 @@ +Minetest-c55 +--------------- +An InfiniMiner/Minecraft inspired game. +Copyright (c) 2010-2011 Perttu Ahola + +Further documentation: +---------------------- +- Website: http://celeron.55.lt/~celeron55/minetest/ +- Wiki: http://celeron.55.lt/~celeron55/minetest/wiki/ +- Forum: http://celeron.55.lt/~celeron55/minetest/forum/ + +This is a development version: +------------------------------ +- Don't expect it to work as well as a finished game will. +- Please report any bugs to me. That way I can fix them to the next release. + - debug.txt is useful when the game crashes. + +Controls: +--------- +- See the in-game pause menu +- Settable in the configuration file, see the section below. + +Map directory: +-------------- +- Map is stored in a directory, which can be removed to generate a new map. +- There is a command-line option for it: --map-dir +- For a RUN_IN_PLACE build, it is located in: + ../map +- Otherwise something like this: + Windows: C:\Documents and Settings\user\Application Data\minetest\map + Linux: ~/.minetest/map + OS X: ~/Library/Application Support/minetest/map + +Configuration file: +------------------- +- An optional configuration file can be used. See minetest.conf.example. +- Path to file can be passed as a parameter to the executable: + --config +- Defaults: + - If built with -DRUN_IN_PLACE=1: + ../minetest.conf + ../../minetest.conf + - Otherwise something like this: + Windows: C:\Documents and Settings\user\Application Data\minetest\minetest.conf + Linux: ~/.minetest/minetest.conf + OS X: ~/Library/Application Support/minetest.conf + +Command-line options: +--------------------- +- Use --help + +Compiling on GNU/Linux: +----------------------- + +Install dependencies. Here's an example for Debian/Ubuntu: +$ apt-get install build-essential libirrlicht-dev cmake libbz2-dev libpng12-dev libjpeg8-dev libxxf86vm-dev libgl1-mesa-dev + +Download source, extract (this is the URL to the latest of source repository, which might not work at all times): +$ wget https://bitbucket.org/celeron55/minetest/get/tip.tar.gz +$ tar xf tip.tar.gz +$ cd minetest + +Build a version that runs directly from the source directory: +$ cmake . -DRUN_IN_PLACE=1 +$ make -j2 + +Run it: +$ cd bin +$ ./minetest + +- Use cmake . -LH to see all CMake options and their current state +- If you want to install it system-wide (or are making a distribution package), you will want to use -DRUN_IN_PLACE=0 +- You can build a bare server or a bare client by specifying -DBUILD_CLIENT=0 or -DBUILD_SERVER=0 +- You can select between Release and Debug build by -DCMAKE_BUILD_TYPE= + - Note that the Debug build is considerably slower + +Compiling on Windows: +--------------------- + +- You need: + * CMake: + http://www.cmake.org/cmake/resources/software.html + * MinGW or Visual Studio + http://www.mingw.org/ + http://msdn.microsoft.com/en-us/vstudio/default + * Irrlicht SDK 1.7: + http://irrlicht.sourceforge.net/downloads.html + * Zlib headers (zlib125.zip) + http://www.winimage.com/zLibDll/index.html + * Zlib library (zlibwapi.lib and zlibwapi.dll from zlib125dll.zip): + http://www.winimage.com/zLibDll/index.html + * And, of course, Minetest-c55: + http://celeron.55.lt/~celeron55/minetest/download +- Steps: + - Select a directory called DIR hereafter in which you will operate. + - Make sure you have CMake and a compiler installed. + - Download all the other stuff to DIR and extract them into there. All those + packages contain a nice base directory in them, which should end up being + the direct subdirectories of DIR. + - You will end up with a directory structure like this (+=dir, -=file): + ----------------- + + DIR + - zlib-1.2.5.tar.gz + - zlib125dll.zip + - irrlicht-1.7.1.zip + - 110214175330.zip (or whatever, this is the minetest source) + + zlib-1.2.5 + - zlib.h + + win32 + ... + + zlib125dll + - readme.txt + + dll32 + ... + + irrlicht-1.7.1 + + lib + + include + ... + + minetest + + src + + doc + - CMakeLists.txt + ... + ----------------- + - Start up the CMake GUI + - Select "Browse Source..." and select DIR/minetest + - Now, if using MSVC: + - Select "Browse Build..." and select DIR/minetest-build + - Else if using MinGW: + - Select "Browse Build..." and select DIR/minetest + - Select "Configure" + - Select your compiler + - It will warn about missing stuff, ignore that at this point. (later don't) + - Make sure the configuration is as follows + (note that the versions may differ for you): + ----------------- + BUILD_CLIENT [X] + BUILD_SERVER [ ] + CMAKE_BUILD_TYPE Release + CMAKE_INSTALL_PREFIX DIR/minetest-install + IRRLICHT_SOURCE_DIR DIR/irrlicht-1.7.1 + RUN_IN_PLACE [X] + WARN_ALL [ ] + ZLIB_DLL DIR/zlib125dll/dll32/zlibwapi.dll + ZLIB_INCLUDE_DIR DIR/zlib-1.2.5 + ZLIB_LIBRARIES DIR/zlib125dll/dll32/zlibwapi.lib + ----------------- + - Hit "Configure" + - Hit "Generate" + If using MSVC: + - Open the generated minetest.sln + - The project defaults to the "Debug" configuration. Make very sure to + select "Release", unless you want to debug some stuff (it's slower) + - Build the ALL_BUILD project + - Build the INSTALL project + - You should now have a working game with the executable in + DIR/minetest-install/bin/minetest.exe + - Additionally you may create a zip package by building the PACKAGE + project. + If using MinGW: + - Using the command line, browse to the build directory and run 'make' + (or mingw32-make or whatever it happens to be) + - You should now have a working game with the executable in + DIR/minetest/bin/minetest.exe + +License of Minetest-c55 +----------------------- + +Minetest-c55 +Copyright (C) 2010-2011 celeron55, Perttu Ahola + +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. + +Irrlicht +--------------- + +This program uses the Irrlicht Engine. http://irrlicht.sourceforge.net/ + + The Irrlicht Engine License + +Copyright © 2002-2005 Nikolaus Gebhardt + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute +it freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you use + this software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + 3. This notice may not be removed or altered from any source + distribution. + + +JThread +--------------- + +This program uses the JThread library. License for JThread follows: + +Copyright (c) 2000-2006 Jori Liesenborgs (jori.liesenborgs@gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + + diff --git a/makepackage_binary.sh b/makepackage_binary.sh new file mode 100755 index 0000000..f00ec60 --- /dev/null +++ b/makepackage_binary.sh @@ -0,0 +1,63 @@ +#!/bin/sh + +PACKAGEDIR=../minetest-packages +PACKAGENAME=minetest-c55-binary-`date +%y%m%d%H%M%S` +PACKAGEPATH=$PACKAGEDIR/$PACKAGENAME + +mkdir -p $PACKAGEPATH +mkdir -p $PACKAGEPATH/bin +mkdir -p $PACKAGEPATH/data +mkdir -p $PACKAGEPATH/doc + +cp minetest.conf.example $PACKAGEPATH/ + +cp bin/minetest.exe $PACKAGEPATH/bin/ +cp bin/Irrlicht.dll $PACKAGEPATH/bin/ +cp bin/zlibwapi.dll $PACKAGEPATH/bin/ +#cp bin/test $PACKAGEPATH/bin/ +#cp bin/fasttest $PACKAGEPATH/bin/ +#cp bin/server $PACKAGEPATH/bin/ +#cp ../irrlicht/irrlicht-1.7.1/lib/Linux/libIrrlicht.a $PACKAGEPATH/bin/ +#cp ../jthread/jthread-1.2.1/src/.libs/libjthread-1.2.1.so $PACKAGEPATH/bin/ + +cp -r data/fontlucida.png $PACKAGEPATH/data/ +cp -r data/player.png $PACKAGEPATH/data/ +cp -r data/player_back.png $PACKAGEPATH/data/ +cp -r data/stone.png $PACKAGEPATH/data/ +cp -r data/grass.png $PACKAGEPATH/data/ +cp -r data/grass_footsteps.png $PACKAGEPATH/data/ +cp -r data/water.png $PACKAGEPATH/data/ +cp -r data/tree.png $PACKAGEPATH/data/ +cp -r data/leaves.png $PACKAGEPATH/data/ +cp -r data/mese.png $PACKAGEPATH/data/ +cp -r data/cloud.png $PACKAGEPATH/data/ +cp -r data/sign.png $PACKAGEPATH/data/ +cp -r data/sign_back.png $PACKAGEPATH/data/ +cp -r data/rat.png $PACKAGEPATH/data/ +cp -r data/mud.png $PACKAGEPATH/data/ +cp -r data/torch.png $PACKAGEPATH/data/ +cp -r data/torch_on_floor.png $PACKAGEPATH/data/ +cp -r data/torch_on_ceiling.png $PACKAGEPATH/data/ +cp -r data/tree_top.png $PACKAGEPATH/data/ +cp -r data/coalstone.png $PACKAGEPATH/data/ +cp -r data/crack.png $PACKAGEPATH/data/ +cp -r data/wood.png $PACKAGEPATH/data/ +cp -r data/stick.png $PACKAGEPATH/data/ +cp -r data/tool_wpick.png $PACKAGEPATH/data/ +cp -r data/tool_stpick.png $PACKAGEPATH/data/ +cp -r data/tool_mesepick.png $PACKAGEPATH/data/ +cp -r data/grass_side.png $PACKAGEPATH/data/ +cp -r data/lump_of_coal.png $PACKAGEPATH/data/ +cp -r data/lump_of_iron.png $PACKAGEPATH/data/ +cp -r data/mineral_coal.png $PACKAGEPATH/data/ +cp -r data/mineral_iron.png $PACKAGEPATH/data/ +cp -r data/sand.png $PACKAGEPATH/data/ + +#cp -r data/pauseMenu.gui $PACKAGEPATH/data/ + +cp -r doc/README.txt $PACKAGEPATH/doc/README.txt + +cd $PACKAGEDIR +rm $PACKAGENAME.zip +zip -r $PACKAGENAME.zip $PACKAGENAME + diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp new file mode 100644 index 0000000..3e594ae --- /dev/null +++ b/src/guiKeyChangeMenu.cpp @@ -0,0 +1,598 @@ +/* + Minetest-delta + Copyright (C) 2010-11 celeron55, Perttu Ahola + Copyright (C) 2011 Ciaran Gultnieks + Copyright (C) 2011 teddydestodes + + 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. + */ + +#include "guiKeyChangeMenu.h" +#include "debug.h" +#include "serialization.h" +#include "keycode.h" +#include "main.h" +#include + +GUIKeyChangeMenu::GUIKeyChangeMenu(gui::IGUIEnvironment* env, + gui::IGUIElement* parent, s32 id, IMenuManager *menumgr) : + GUIModalMenu(env, parent, id, menumgr) +{ + activeKey = -1; + init_keys(); +} + +GUIKeyChangeMenu::~GUIKeyChangeMenu() +{ + removeChildren(); +} + +void GUIKeyChangeMenu::removeChildren() +{ + const core::list &children = getChildren(); + core::list children_copy; + for (core::list::ConstIterator i = children.begin(); i + != children.end(); i++) + { + children_copy.push_back(*i); + } + for (core::list::Iterator i = children_copy.begin(); i + != children_copy.end(); i++) + { + (*i)->remove(); + } +} + +void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) +{ + /* + Remove stuff + */ + removeChildren(); + + /* + Calculate new sizes and positions + */ + + v2s32 size(620, 430); + + core::rect < s32 > rect(screensize.X / 2 - size.X / 2, + screensize.Y / 2 - size.Y / 2, screensize.X / 2 + size.X / 2, + screensize.Y / 2 + size.Y / 2); + + DesiredRect = rect; + recalculateAbsolutePosition(false); + + v2s32 topleft(0, 0); + + { + core::rect < s32 > rect(0, 0, 125, 20); + rect += topleft + v2s32(25, 3); + const wchar_t *text = L"KEYBINDINGS"; + //gui::IGUIStaticText *t = + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + v2s32 offset(25, 40); + // buttons + + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Forward"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->forward = Environment->addButton(rect, this, + GUI_ID_KEY_FORWARD_BUTTON, + narrow_to_wide(KeyNames[key_forward]).c_str()); + } + + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Backward"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->backward = Environment->addButton(rect, this, + GUI_ID_KEY_BACKWARD_BUTTON, + narrow_to_wide(KeyNames[key_backward]).c_str()); + } + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Left"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->left = Environment->addButton(rect, this, GUI_ID_KEY_LEFT_BUTTON, + narrow_to_wide(KeyNames[key_left]).c_str()); + } + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Right"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->right = Environment->addButton(rect, this, + GUI_ID_KEY_RIGHT_BUTTON, + narrow_to_wide(KeyNames[key_right]).c_str()); + } + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Use"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->use = Environment->addButton(rect, this, GUI_ID_KEY_USE_BUTTON, + narrow_to_wide(KeyNames[key_use]).c_str()); + } + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Sneak"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->sneak = Environment->addButton(rect, this, + GUI_ID_KEY_SNEAK_BUTTON, + narrow_to_wide(KeyNames[key_sneak]).c_str()); + } + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Jump"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->jump = Environment->addButton(rect, this, GUI_ID_KEY_JUMP_BUTTON, + narrow_to_wide(KeyNames[key_jump]).c_str()); + } + + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Inventory"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->inventory = Environment->addButton(rect, this, + GUI_ID_KEY_INVENTORY_BUTTON, + narrow_to_wide(KeyNames[key_inventory]).c_str()); + } + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Chat"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->chat = Environment->addButton(rect, this, GUI_ID_KEY_CHAT_BUTTON, + narrow_to_wide(KeyNames[key_chat]).c_str()); + } + + //next col + offset = v2s32(250, 40); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Toggle fly"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->fly = Environment->addButton(rect, this, GUI_ID_KEY_FLY_BUTTON, + narrow_to_wide(KeyNames[key_fly]).c_str()); + } + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Toggle fast"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->fast = Environment->addButton(rect, this, GUI_ID_KEY_FAST_BUTTON, + narrow_to_wide(KeyNames[key_fast]).c_str()); + } + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Range select"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->range = Environment->addButton(rect, this, + GUI_ID_KEY_RANGE_BUTTON, + narrow_to_wide(KeyNames[key_range]).c_str()); + } + + offset += v2s32(0, 25); + { + core::rect < s32 > rect(0, 0, 100, 20); + rect += topleft + v2s32(offset.X, offset.Y); + const wchar_t *text = L"Print stacks"; + Environment->addStaticText(text, rect, false, true, this, -1); + //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); + } + + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(offset.X + 105, offset.Y - 5); + this->dump = Environment->addButton(rect, this, GUI_ID_KEY_DUMP_BUTTON, + narrow_to_wide(KeyNames[key_dump]).c_str()); + } + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(size.X - 100 - 20, size.Y - 40); + Environment->addButton(rect, this, GUI_ID_BACK_BUTTON, L"Save"); + } + { + core::rect < s32 > rect(0, 0, 100, 30); + rect += topleft + v2s32(size.X - 100 - 20 - 100 - 20, size.Y - 40); + Environment->addButton(rect, this, GUI_ID_ABORT_BUTTON, L"Cancel"); + } +} + +void GUIKeyChangeMenu::drawMenu() +{ + gui::IGUISkin* skin = Environment->getSkin(); + if (!skin) + return; + video::IVideoDriver* driver = Environment->getVideoDriver(); + + video::SColor bgcolor(140, 0, 0, 0); + + { + core::rect < s32 > rect(0, 0, 620, 620); + rect += AbsoluteRect.UpperLeftCorner; + driver->draw2DRectangle(bgcolor, rect, &AbsoluteClippingRect); + } + + gui::IGUIElement::draw(); +} + +bool GUIKeyChangeMenu::acceptInput() +{ + g_settings.set("keymap_forward", keycode_to_keyname(key_forward)); + g_settings.set("keymap_backward", keycode_to_keyname(key_backward)); + g_settings.set("keymap_left", keycode_to_keyname(key_left)); + g_settings.set("keymap_right", keycode_to_keyname(key_right)); + g_settings.set("keymap_jump", keycode_to_keyname(key_jump)); + g_settings.set("keymap_sneak", keycode_to_keyname(key_sneak)); + g_settings.set("keymap_inventory", keycode_to_keyname(key_inventory)); + g_settings.set("keymap_chat", keycode_to_keyname(key_chat)); + g_settings.set("keymap_rangeselect", keycode_to_keyname(key_range)); + g_settings.set("keymap_freemove", keycode_to_keyname(key_fly)); + g_settings.set("keymap_fastmove", keycode_to_keyname(key_fast)); + g_settings.set("keymap_special1", keycode_to_keyname(key_use)); + g_settings.set("keymap_print_debug_stacks", keycode_to_keyname(key_dump)); + //clearKeyCache(); Y U NO SCOPE?! + return true; +} +void GUIKeyChangeMenu::init_keys() +{ + key_forward = getKeySetting("keymap_forward"); + key_backward = getKeySetting("keymap_backward"); + key_left = getKeySetting("keymap_left"); + key_right = getKeySetting("keymap_right"); + key_jump = getKeySetting("keymap_jump"); + key_sneak = getKeySetting("keymap_sneak"); + key_inventory = getKeySetting("keymap_inventory"); + key_chat = getKeySetting("keymap_chat"); + key_range = getKeySetting("keymap_rangeselect"); + key_fly = getKeySetting("keymap_freemove"); + key_fast = getKeySetting("keymap_fastmove"); + key_use = getKeySetting("keymap_special1"); + key_dump = getKeySetting("keymap_print_debug_stacks"); +} + +bool GUIKeyChangeMenu::resetMenu() +{ + if (activeKey >= 0) + { + switch (activeKey) + { + case GUI_ID_KEY_FORWARD_BUTTON: + this->forward->setText( + narrow_to_wide(KeyNames[key_forward]).c_str()); + break; + case GUI_ID_KEY_BACKWARD_BUTTON: + this->backward->setText( + narrow_to_wide(KeyNames[key_backward]).c_str()); + break; + case GUI_ID_KEY_LEFT_BUTTON: + this->left->setText(narrow_to_wide(KeyNames[key_left]).c_str()); + break; + case GUI_ID_KEY_RIGHT_BUTTON: + this->right->setText(narrow_to_wide(KeyNames[key_right]).c_str()); + break; + case GUI_ID_KEY_JUMP_BUTTON: + this->jump->setText(narrow_to_wide(KeyNames[key_jump]).c_str()); + break; + case GUI_ID_KEY_SNEAK_BUTTON: + this->sneak->setText(narrow_to_wide(KeyNames[key_sneak]).c_str()); + break; + case GUI_ID_KEY_INVENTORY_BUTTON: + this->inventory->setText( + narrow_to_wide(KeyNames[key_inventory]).c_str()); + break; + case GUI_ID_KEY_CHAT_BUTTON: + this->chat->setText(narrow_to_wide(KeyNames[key_chat]).c_str()); + break; + case GUI_ID_KEY_RANGE_BUTTON: + this->range->setText(narrow_to_wide(KeyNames[key_range]).c_str()); + break; + case GUI_ID_KEY_FLY_BUTTON: + this->fly->setText(narrow_to_wide(KeyNames[key_fly]).c_str()); + break; + case GUI_ID_KEY_FAST_BUTTON: + this->fast->setText(narrow_to_wide(KeyNames[key_fast]).c_str()); + break; + case GUI_ID_KEY_USE_BUTTON: + this->use->setText(narrow_to_wide(KeyNames[key_use]).c_str()); + break; + case GUI_ID_KEY_DUMP_BUTTON: + this->dump->setText(narrow_to_wide(KeyNames[key_dump]).c_str()); + break; + } + activeKey = -1; + return false; + } + return true; +} +bool GUIKeyChangeMenu::OnEvent(const SEvent& event) +{ + if (event.EventType == EET_KEY_INPUT_EVENT && activeKey >= 0 + && event.KeyInput.PressedDown) + { + if (activeKey == GUI_ID_KEY_FORWARD_BUTTON) + { + this->forward->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_forward = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_BACKWARD_BUTTON) + { + this->backward->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_backward = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_LEFT_BUTTON) + { + this->left->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_left = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_RIGHT_BUTTON) + { + this->right->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_right = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_JUMP_BUTTON) + { + this->jump->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_jump = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_SNEAK_BUTTON) + { + this->sneak->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_sneak = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_INVENTORY_BUTTON) + { + this->inventory->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_inventory = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_CHAT_BUTTON) + { + this->chat->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_chat = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_RANGE_BUTTON) + { + this->range->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_range = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_FLY_BUTTON) + { + this->fly->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_fly = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_FAST_BUTTON) + { + this->fast->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_fast = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_USE_BUTTON) + { + this->use->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_use = event.KeyInput.Key; + } + else if (activeKey == GUI_ID_KEY_DUMP_BUTTON) + { + this->dump->setText( + narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + this->key_dump = event.KeyInput.Key; + } + + activeKey = -1; + return true; + } + if (event.EventType == EET_GUI_EVENT) + { + if (event.GUIEvent.EventType == gui::EGET_ELEMENT_FOCUS_LOST + && isVisible()) + { + if (!canTakeFocus(event.GUIEvent.Element)) + { + dstream << "GUIMainMenu: Not allowing focus change." + << std::endl; + // Returning true disables focus change + return true; + } + } + if (event.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED) + { + switch (event.GUIEvent.Caller->getID()) + { + case GUI_ID_BACK_BUTTON: //back + acceptInput(); + quitMenu(); + return true; + case GUI_ID_ABORT_BUTTON: //abort + quitMenu(); + return true; + case GUI_ID_KEY_FORWARD_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->forward->setText(L"press Key"); + break; + case GUI_ID_KEY_BACKWARD_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->backward->setText(L"press Key"); + break; + case GUI_ID_KEY_LEFT_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->left->setText(L"press Key"); + break; + case GUI_ID_KEY_RIGHT_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->right->setText(L"press Key"); + break; + case GUI_ID_KEY_USE_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->use->setText(L"press Key"); + break; + case GUI_ID_KEY_FLY_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->fly->setText(L"press Key"); + break; + case GUI_ID_KEY_FAST_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->fast->setText(L"press Key"); + break; + case GUI_ID_KEY_JUMP_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->jump->setText(L"press Key"); + break; + case GUI_ID_KEY_CHAT_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->chat->setText(L"press Key"); + break; + case GUI_ID_KEY_SNEAK_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->sneak->setText(L"press Key"); + break; + case GUI_ID_KEY_INVENTORY_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->inventory->setText(L"press Key"); + break; + case GUI_ID_KEY_DUMP_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->dump->setText(L"press Key"); + break; + case GUI_ID_KEY_RANGE_BUTTON: + resetMenu(); + activeKey = event.GUIEvent.Caller->getID(); + this->range->setText(L"press Key"); + break; + } + //Buttons + + } + } + return Parent ? Parent->OnEvent(event) : false; +} + diff --git a/src/guiKeyChangeMenu.h b/src/guiKeyChangeMenu.h new file mode 100644 index 0000000..389ce7a --- /dev/null +++ b/src/guiKeyChangeMenu.h @@ -0,0 +1,133 @@ +/* + Minetest-delta + Copyright (C) 2010-11 celeron55, Perttu Ahola + Copyright (C) 2011 Ciaran Gultnieks + Copyright (C) 2011 teddydestodes + + 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. + */ + +#ifndef GUIKEYCHANGEMENU_HEADER +#define GUIKEYCHANGEMENU_HEADER + +#include "common_irrlicht.h" +#include "utility.h" +#include "modalMenu.h" +#include "client.h" +#include + +static const char *KeyNames[] = + { "-", "Left Button", "Right Button", "Cancel", "Middle Button", "X Button 1", + "X Button 2", "-", "Back", "Tab", "-", "-", "Clear", "Return", "-", + "-", "Shift", "Control", "Menu", "Pause", "Capital", "Kana", "-", + "Junja", "Final", "Kanji", "-", "Escape", "Convert", "Nonconvert", + "Accept", "Mode Change", "Space", "Priot", "Next", "End", "Home", + "Left", "Up", "Right", "Down", "Select", "Print", "Execute", + "Snapshot", "Insert", "Delete", "Help", "0", "1", "2", "3", "4", "5", + "6", "7", "8", "9", "-", "-", "-", "-", "-", "-", "-", "A", "B", "C", + "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", + "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "Left Windows", + "Right Windows", "Apps", "-", "Sleep", "Numpad 0", "Numpad 1", + "Numpad 2", "Numpad 3", "Numpad 4", "Numpad 5", "Numpad 6", "Numpad 7", + "Numpad 8", "Numpad 9", "Numpad *", "Numpad +", "Numpad /", "Numpad -", + "Numpad .", "Numpad /", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", + "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16", "F17", "F18", + "F19", "F20", "F21", "F22", "F23", "F24", "-", "-", "-", "-", "-", "-", + "-", "-", "Num Lock", "Scroll Lock", "-", "-", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "Left Shift", "Right Shight", + "Left Control", "Right Control", "Left Menu", "Right Menu", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "Plus", "Comma", "Minus", "Period", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "Attn", "CrSel", + "ExSel", "Erase OEF", "Play", "Zoom", "PA1", "OEM Clear", "-" }; + enum + { + GUI_ID_BACK_BUTTON = 101, GUI_ID_ABORT_BUTTON, GUI_ID_SCROLL_BAR, + //buttons + GUI_ID_KEY_FORWARD_BUTTON, + GUI_ID_KEY_BACKWARD_BUTTON, + GUI_ID_KEY_LEFT_BUTTON, + GUI_ID_KEY_RIGHT_BUTTON, + GUI_ID_KEY_USE_BUTTON, + GUI_ID_KEY_FLY_BUTTON, + GUI_ID_KEY_FAST_BUTTON, + GUI_ID_KEY_JUMP_BUTTON, + GUI_ID_KEY_CHAT_BUTTON, + GUI_ID_KEY_SNEAK_BUTTON, + GUI_ID_KEY_INVENTORY_BUTTON, + GUI_ID_KEY_DUMP_BUTTON, + GUI_ID_KEY_RANGE_BUTTON + }; + +class GUIKeyChangeMenu: public GUIModalMenu +{ +public: + GUIKeyChangeMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent, + s32 id, IMenuManager *menumgr); + ~GUIKeyChangeMenu(); + + void removeChildren(); + /* + Remove and re-add (or reposition) stuff + */ + void regenerateGui(v2u32 screensize); + + void drawMenu(); + + bool acceptInput(); + + bool OnEvent(const SEvent& event); + +private: + + void init_keys(); + + bool resetMenu(); + + gui::IGUIButton *forward; + gui::IGUIButton *backward; + gui::IGUIButton *left; + gui::IGUIButton *right; + gui::IGUIButton *use; + gui::IGUIButton *sneak; + gui::IGUIButton *jump; + gui::IGUIButton *inventory; + gui::IGUIButton *fly; + gui::IGUIButton *fast; + gui::IGUIButton *range; + gui::IGUIButton *dump; + gui::IGUIButton *chat; + + u32 activeKey; + u32 key_forward; + u32 key_backward; + u32 key_left; + u32 key_right; + u32 key_use; + u32 key_sneak; + u32 key_jump; + u32 key_inventory; + u32 key_fly; + u32 key_fast; + u32 key_range; + u32 key_chat; + u32 key_dump; +}; + +#endif + From 13cf5425db613dc0a4323c87a4988bb18fb87aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20R=C3=BChl?= Date: Sun, 26 Jun 2011 13:47:21 +0200 Subject: [PATCH 042/158] backported cactus, papyrus and clay --- data/heart.png | Bin 308 -> 258 bytes heart.png | Bin 258 -> 0 bytes src/mapgen.cpp | 77 ++++++++++++++++++++++++++++++++++++++++++------- 3 files changed, 67 insertions(+), 10 deletions(-) delete mode 100644 heart.png diff --git a/data/heart.png b/data/heart.png index 6bc183e04f21cba17b52009e89bb52072d5a0afd..bea1aefd6b22e3268f88db0eb26188b1cb362f81 100644 GIT binary patch delta 210 zcmV;@04@Kt0)hgNBnkm@Qb$4nuFf3kkuey52XskIMF-mj8W%GHKxNM^0001#NklVQ zc5uf$mMgo6z)RnOHGYBE@E2eNX~Qny4B~~m3Xq?rh593L2{H=50gdG}LP=Bz2nYy#2xN$nE*O8-Nkl9#BDbI(Ls&# z%GzuoAEjllO;+D+Z%Dd*{$^t^CUp&JEU@e=UJ*}~yJ%xg%!>0@nGqj71`Tns%ixlj zSHyE-v`gGF%B`+*G+V^gXS^f57lH>&dmg0sA52LHMA{<$AAAB8R%;g2&!{W_0000< KMNUMnLSTZvP;Kl0 diff --git a/heart.png b/heart.png deleted file mode 100644 index bea1aefd6b22e3268f88db0eb26188b1cb362f81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 258 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0XB zj({-ZRBb+KpdfpRr>`sfZB{99Vn~*1 zOf;RLoV~^PV*i6<0qnDigqRBVv2zGCh{k7MuAcWI;r8w|tei*K7JX!>6zOP5Hd=1= zq0!~|;tH-6T(g|4=G}RrVR)@*+b<8*$>M6JyaEj$jvIcNwydn+xXm=}-5m$K?>Cy( zHQx9jp1_iMSnmPPqt@MA6Xq{%{iR&UX~eakvG=Lg;u1%PV4(XLJYD@<);T3K0RY|` BTmb+8 diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 801dd72..71696a3 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -151,6 +151,34 @@ static void make_tree(VoxelManipulator &vmanip, v3s16 p0) } } +void make_papyrus(VoxelManipulator &vmanip, v3s16 p0) +{ + MapNode papyrusnode(CONTENT_PAPYRUS); + + s16 trunk_h = myrand_range(2, 3); + v3s16 p1 = p0; + for(s16 ii=0; iiseed+4321, 6, 0.95); + + have_clay = have_sand && (claynoise > 1.25); + // Use fast index incrementing s16 start_y = node_max.Y+2; v3s16 em = vmanip.m_area.getExtent(); @@ -1778,7 +1815,10 @@ void make_block(BlockMakeData *data) { if(have_sand) { - vmanip.m_data[i] = MapNode(CONTENT_SAND); + if (have_clay) + vmanip.m_data[i] = MapNode(CONTENT_CLAY); + else + vmanip.m_data[i] = MapNode(CONTENT_SAND); } #if 1 else if(current_depth==0 && !water_detected @@ -1823,7 +1863,7 @@ void make_block(BlockMakeData *data) //s16 y = find_ground_level(data->vmanip, v2s16(x,z)); s16 y = find_ground_level_from_noise(data->seed, v2s16(x,z), 4); // Don't make a tree under water level - if(y < WATER_LEVEL) + if(y < WATER_LEVEL - 1) continue; // Make sure tree fits (only trees whose starting point is // at this block are added) @@ -1847,19 +1887,36 @@ void make_block(BlockMakeData *data) // If not found, handle next one if(found == false) continue; - /* - Trees grow only on mud and grass - */ + { u32 i = data->vmanip->m_area.index(p); MapNode *n = &data->vmanip->m_data[i]; - if(n->d != CONTENT_MUD && n->d != CONTENT_GRASS) + + if(n->d != CONTENT_MUD && n->d != CONTENT_GRASS && n->d != CONTENT_SAND) + continue; + + // Papyrus grows only on mud and in water + if(n->d == CONTENT_MUD && y == WATER_LEVEL - 1) + { + p.Y++; + make_papyrus(vmanip, p); + } + // Don't make a tree under water level + if(y < WATER_LEVEL) continue; + // Trees grow only on mud and grass + if(n->d == CONTENT_MUD || n->d == CONTENT_GRASS) + { + p.Y++; + make_tree(vmanip, p); + } + // Cactii grow only on sand + else if(n->d == CONTENT_SAND) + { + p.Y++; + make_cactus(vmanip, p); + } } - // Tree will be placed one higher - p.Y++; - // Make a tree - make_tree(vmanip, p); } #if 0 From a106c0dbdcc564c649500257dc695055df3a6438 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sat, 9 Jul 2011 18:14:05 +0200 Subject: [PATCH 043/158] + notes regarding upstream conversion from mercurial using hg-fast-export --- README | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README b/README index 9b1f54e..1a1b4d4 100644 --- a/README +++ b/README @@ -27,3 +27,6 @@ Alternate graphics: Building on GNU/Linux or OS X: cmake . -DRUN_IN_PLACE=1 make -j2 + +The “upstream” branch contains vanilla minetest-c55, created using: + hg-fast-export -r ~/share/src/games/minetest -o upstream From 6103e59c19d6ff2817199fd6a684a67e8f43b12e Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sat, 9 Jul 2011 18:22:39 +0200 Subject: [PATCH 044/158] * amended upstream branch notes --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index 1a1b4d4..13cab5d 100644 --- a/README +++ b/README @@ -30,3 +30,4 @@ Building on GNU/Linux or OS X: The “upstream” branch contains vanilla minetest-c55, created using: hg-fast-export -r ~/share/src/games/minetest -o upstream + git push origin upstream/master:upstream -f From 858b2d7439c45012ddbb3a66b24ba4f4f8204dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Proch=C3=A1zka?= Date: Mon, 11 Jul 2011 14:29:59 +0200 Subject: [PATCH 045/158] + farmesh config options --- src/defaultsettings.cpp | 2 ++ src/farmesh.cpp | 14 +++++++------- src/farmesh.h | 3 ++- src/game.cpp | 8 +------- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 74d3232..ac1983e 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -68,6 +68,8 @@ void set_default_settings() g_settings.setDefault("fast_move", "false"); g_settings.setDefault("invert_mouse", "false"); g_settings.setDefault("enable_farmesh", "false"); + g_settings.setDefault("farmesh_trees", "true"); + g_settings.setDefault("farmesh_distance", "40"); g_settings.setDefault("enable_clouds", "true"); g_settings.setDefault("invisible_stone", "false"); diff --git a/src/farmesh.cpp b/src/farmesh.cpp index 72dbe11..a359837 100644 --- a/src/farmesh.cpp +++ b/src/farmesh.cpp @@ -70,6 +70,7 @@ FarMesh::FarMesh( m_box = core::aabbox3d(-BS*1000000,-BS*31000,-BS*1000000, BS*1000000,BS*31000,BS*1000000); + trees = g_settings.getBool("farmesh_trees"); } FarMesh::~FarMesh() @@ -312,12 +313,11 @@ void FarMesh::render() } else { - /*// Trees if there are over 0.01 trees per MapNode - if(tree_amount_avg > 0.01) + // Trees if there are over 0.01 trees per MapNode + if(trees && tree_amount_avg > 0.01) c = video::SColor(255,50,128,50); else - c = video::SColor(255,107,134,51);*/ - c = video::SColor(255,107,134,51); + c = video::SColor(255,107,134,51); ground_is_mud = true; } } @@ -350,7 +350,7 @@ void FarMesh::render() video::EVT_STANDARD, scene::EPT_TRIANGLES, video::EIT_16BIT); // Add some trees if appropriate - if(tree_amount_avg >= 0.0065 && steepness < 1.4 + if(trees && tree_amount_avg >= 0.0065 && steepness < 1.4 && ground_is_mud == true) { driver->setMaterial(m_materials[1]); @@ -403,11 +403,11 @@ void FarMesh::step(float dtime) m_time += dtime; } -void FarMesh::update(v2f camera_p, float brightness, s16 render_range) +void FarMesh::update(v2f camera_p, float brightness) { m_camera_pos = camera_p; m_brightness = brightness; - m_render_range = render_range; + m_render_range = g_settings.getS16("farmesh_distance")*10; } diff --git a/src/farmesh.h b/src/farmesh.h index 0a30a8a..577224e 100644 --- a/src/farmesh.h +++ b/src/farmesh.h @@ -67,7 +67,7 @@ public: void step(float dtime); - void update(v2f camera_p, float brightness, s16 render_range); + void update(v2f camera_p, float brightness); private: video::SMaterial m_materials[FARMESH_MATERIAL_COUNT]; @@ -79,6 +79,7 @@ private: float m_time; Client *m_client; s16 m_render_range; + bool trees; }; #endif diff --git a/src/game.cpp b/src/game.cpp index 5632c18..367abeb 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1874,15 +1874,9 @@ void the_game( */ if(farmesh) { - farmesh_range = draw_control.wanted_range * 10; - if(draw_control.range_all && farmesh_range < 500) - farmesh_range = 500; - if(farmesh_range > 1000) - farmesh_range = 1000; - farmesh->step(dtime); farmesh->update(v2f(player_position.X, player_position.Z), - 0.05+brightness*0.95, farmesh_range); + 0.05+brightness*0.95); } // Store brightness value From 63ce6eee5cf4063be4b6bae4c24e1e27e3a80651 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Mon, 11 Jul 2011 16:22:14 +0200 Subject: [PATCH 046/158] * README updated --- README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README b/README index 13cab5d..094e66f 100644 --- a/README +++ b/README @@ -2,6 +2,8 @@ Minetest Δ (“Minetest Delta”) is a fork of Minetest-c55 Date: Wed, 13 Jul 2011 16:21:20 +0200 Subject: [PATCH 047/158] * regression fix, papyrus should appear again now --- src/mapgen.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 71696a3..b7e077f 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -1863,7 +1863,7 @@ void make_block(BlockMakeData *data) //s16 y = find_ground_level(data->vmanip, v2s16(x,z)); s16 y = find_ground_level_from_noise(data->seed, v2s16(x,z), 4); // Don't make a tree under water level - if(y < WATER_LEVEL - 1) + if(y < WATER_LEVEL) continue; // Make sure tree fits (only trees whose starting point is // at this block are added) @@ -1878,7 +1878,7 @@ void make_block(BlockMakeData *data) { u32 i = data->vmanip->m_area.index(p); MapNode *n = &data->vmanip->m_data[i]; - if(n->d != CONTENT_AIR && n->d != CONTENT_IGNORE) + if(n->d != CONTENT_AIR && n->d != CONTENT_WATERSOURCE && n->d != CONTENT_IGNORE) { found = true; break; @@ -1896,22 +1896,19 @@ void make_block(BlockMakeData *data) continue; // Papyrus grows only on mud and in water - if(n->d == CONTENT_MUD && y == WATER_LEVEL - 1) + if(n->d == CONTENT_MUD && y <= WATER_LEVEL) { p.Y++; make_papyrus(vmanip, p); } - // Don't make a tree under water level - if(y < WATER_LEVEL) - continue; - // Trees grow only on mud and grass - if(n->d == CONTENT_MUD || n->d == CONTENT_GRASS) + // Trees grow only on mud and grass, on land + else if((n->d == CONTENT_MUD || n->d == CONTENT_GRASS) && y > WATER_LEVEL + 2) { p.Y++; make_tree(vmanip, p); } - // Cactii grow only on sand - else if(n->d == CONTENT_SAND) + // Cactii grow only on sand, on land + else if(n->d == CONTENT_SAND && y > WATER_LEVEL + 2) { p.Y++; make_cactus(vmanip, p); From b0ad5ce8e2a8da4fd98510b15c0afb3a8e2c96f4 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 13 Jul 2011 23:10:41 +0200 Subject: [PATCH 048/158] * slightly different values for 3d perlin noise --- src/mapgen.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mapgen.cpp b/src/mapgen.cpp index b7e077f..0fd2e4c 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -903,8 +903,8 @@ NoiseParams get_cave_noise2_params(u64 seed) NoiseParams get_ground_noise1_params(u64 seed) { - return NoiseParams(NOISE_PERLIN, seed+983240, 5, - 0.60, 100.0, 30.0); + return NoiseParams(NOISE_PERLIN, seed+983240, 4, + 0.55, 80.0, 40.0); } NoiseParams get_ground_crumbleness_params(u64 seed) @@ -939,7 +939,7 @@ bool val_is_ground(double ground_noise1_val, v3s16 p, u64 seed) double f = 0.8 + noise2d_perlin( 0.5+(float)p.X/250, 0.5+(float)p.Z/250, - seed+920381, 3, 0.5); + seed+920381, 3, 0.45); if(f < 0.01) f = 0.01; else if(f >= 1.0) From 1cdf210e4f01b7221a241cbb911f08bc6ffa75bd Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 13 Jul 2011 23:12:18 +0200 Subject: [PATCH 049/158] * possible fix for large cubic holes in map --- src/mapgen.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 0fd2e4c..a491ac8 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -1317,7 +1317,8 @@ void make_block(BlockMakeData *data) data->seed, v2s16(blockpos.X, blockpos.Z), 1); // Maximum amount of ground above the bottom of the central block s16 maximum_ground_depth = maximum_groundlevel - node_min.Y; - + + #if 0 /* Special case for high air or water: Just fill with air and water. */ @@ -1351,6 +1352,7 @@ void make_block(BlockMakeData *data) // We're done return; } + #endif /* If block is deep underground, this is set to true and ground From 4415d95c503f083d871abaf84516f2b6487ecb60 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Thu, 14 Jul 2011 16:17:50 +0200 Subject: [PATCH 050/158] * possibly improved water flow, by flyx86 - When flowing liquid starts to flow down, it stops contributing to its neighboring nodes' liquid level (possibly transforming it back to air) - Flowing liquid turns into a source if there are at least 2 adjacent liquid source nodes - If a new liquid flow reaches existing flowing liquid, the existing liquid is now updated properly. --- src/content_mapnode.cpp | 2 ++ src/map.cpp | 46 ++++++++++++++++++++++++++++++++++------- src/mapnode.h | 4 +++- 3 files changed, 44 insertions(+), 8 deletions(-) diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp index 2e7a240..3835659 100644 --- a/src/content_mapnode.cpp +++ b/src/content_mapnode.cpp @@ -276,6 +276,7 @@ void content_mapnode_init() f->buildable_to = true; f->liquid_type = LIQUID_FLOWING; f->liquid_alternative_flowing = CONTENT_WATER; + f->liquid_alternative_source = CONTENT_WATERSOURCE; i = CONTENT_WATERSOURCE; f = &content_features(i); @@ -307,6 +308,7 @@ void content_mapnode_init() f->liquid_type = LIQUID_SOURCE; f->dug_item = std::string("MaterialItem ")+itos(i)+" 1"; f->liquid_alternative_flowing = CONTENT_WATER; + f->liquid_alternative_source = CONTENT_WATERSOURCE; i = CONTENT_TORCH; f = &content_features(i); diff --git a/src/map.cpp b/src/map.cpp index 0de9cf1..d3e8983 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1204,16 +1204,24 @@ void Map::removeNodeAndUpdate(v3s16 p, /* Add neighboring liquid nodes to transform queue. + + Also add horizontal neighbors of node on top of removed node + because they could be affected of the water on top flowing + down instead of into them. */ - v3s16 dirs[6] = { + v3s16 dirs[10] = { v3s16(0,0,1), // back v3s16(0,1,0), // top + v3s16(1,1,0), // topright + v3s16(-1,1,0), // topleft + v3s16(0,1,1), // topback + v3s16(0,1,-1), // topfront v3s16(1,0,0), // right v3s16(0,0,-1), // front v3s16(0,-1,0), // bottom v3s16(-1,0,0), // left }; - for(u16 i=0; i<6; i++) + for(u16 i=0; i<10; i++) { try { @@ -1510,6 +1518,9 @@ void Map::transformLiquids(core::map & modified_blocks) // Turn possible source into non-source u8 nonsource_c = make_liquid_flowing(n0.d); + // Counts surrounding liquid source blocks + u8 surrounding_sources = 0; + /* If not source, check that some node flows into this one and what is the level of liquid in this one @@ -1547,7 +1558,9 @@ void Map::transformLiquids(core::map & modified_blocks) } bool n2_is_source = !content_flowing_liquid(n2.d); s8 n2_liquid_level = 8; - if(n2_is_source == false) + if(n2_is_source) + surrounding_sources++; + else n2_liquid_level = n2.param2 & 0x07; s8 new_liquid_level = -1; @@ -1561,7 +1574,20 @@ void Map::transformLiquids(core::map & modified_blocks) } else if(n2_liquid_level > 0) { - new_liquid_level = n2_liquid_level - 1; + // If the neighbor node isn't a source and flows downwards, + // it doesn't flow into this node + if (n2_is_source) + { + new_liquid_level = n2_liquid_level - 1; + } + else + { + // Node below n2 + MapNode n3 = getNodeNoEx(p2 + v3s16(0,-1,0)); + // NOTE: collision of different liquids not yet handled here. + if (content_features(n3.d).liquid_type != LIQUID_FLOWING) + new_liquid_level = n2_liquid_level - 1; + } } if(new_liquid_level > new_liquid_level_max) @@ -1577,9 +1603,14 @@ void Map::transformLiquids(core::map & modified_blocks) If liquid level should be something else, update it and add all the neighboring water nodes to the transform queue. */ - if(new_liquid_level_max != liquid_level) + if(new_liquid_level_max != liquid_level || (!is_source && surrounding_sources >= 2)) { - if(new_liquid_level_max == -1) + if (surrounding_sources >= 2) + { + n0.d = content_features(n0.d).liquid_alternative_source; + setNode(p0,n0); + } + else if(new_liquid_level_max == -1) { // Remove water alltoghether n0.d = CONTENT_AIR; @@ -1589,6 +1620,7 @@ void Map::transformLiquids(core::map & modified_blocks) else { n0.param2 = new_liquid_level_max; + liquid_level = new_liquid_level_max; setNode(p0, n0); } @@ -1706,7 +1738,7 @@ void Map::transformLiquids(core::map & modified_blocks) } else { - if(liquid_next_level > liquid_level) + if(liquid_next_level > n2_liquid_level) { n2.param2 = liquid_next_level; setNode(p2, n2); diff --git a/src/mapnode.h b/src/mapnode.h index d975a50..d4ba0fe 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -141,8 +141,10 @@ struct ContentFeatures NodeMetadata *initial_metadata; // If the content is liquid, this is the flowing version of the liquid. - // If content is liquid, this is the same content. + // If content is flowing liquid, this is the same content. u8 liquid_alternative_flowing; + // If the content is liquid, this is the source version of the liquid. + u8 liquid_alternative_source; // Amount of light the node emits u8 light_source; From 96f551a287df4a6b101f47bd1fd9f03955559168 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Fri, 15 Jul 2011 02:23:41 +0200 Subject: [PATCH 051/158] * possibly nicer trees --- src/mapgen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mapgen.cpp b/src/mapgen.cpp index d7b6e56..bb4785b 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -85,7 +85,7 @@ static void make_tree(VoxelManipulator &vmanip, v3s16 p0) MapNode treenode(CONTENT_TREE); MapNode leavesnode(CONTENT_LEAVES); - s16 trunk_h = myrand_range(3, 6); + s16 trunk_h = myrand_range(4, 5); v3s16 p1 = p0; for(s16 ii=0; ii leaves_d(new u8[leaves_a.getVolume()]); Buffer leaves_d(leaves_a.getVolume()); for(s32 i=0; i Date: Fri, 15 Jul 2011 06:37:47 +0200 Subject: [PATCH 052/158] * regression fix, clay occurs again now --- src/mapgen.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/mapgen.cpp b/src/mapgen.cpp index bb4785b..dfea862 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -1840,13 +1840,6 @@ void make_block(BlockMakeData *data) bool water_detected = false; bool have_clay = false; - // Determine whether to have clay in the sand here - double claynoise = noise2d_perlin( - 0.5+(float)p2d.X/500, 0.5+(float)p2d.Y/500, - data->seed+4321, 6, 0.95); - - have_clay = have_sand && (claynoise > 1.25); - // Use fast index incrementing s16 start_y = node_max.Y+2; v3s16 em = vmanip.m_area.getExtent(); @@ -1873,6 +1866,15 @@ void make_block(BlockMakeData *data) { if(have_sand) { + // Determine whether to have clay in the sand here + double claynoise = noise2d_perlin( + 0.5+(float)p2d.X/500, 0.5+(float)p2d.Y/500, + data->seed+4321, 6, 0.95) + 0.5; + + have_clay = (y <= WATER_LEVEL) && (y >= WATER_LEVEL-2) && ( + ((claynoise > 0) && (claynoise < 0.04) && (current_depth == 0)) || + ((claynoise > 0) && (claynoise < 0.12) && (current_depth == 1)) + ); if (have_clay) vmanip.m_data[i] = MapNode(CONTENT_CLAY); else From 4d20f1283f883dff0475dbda65090689823959e6 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Fri, 15 Jul 2011 20:16:02 +0200 Subject: [PATCH 053/158] * fix automerge regression --- src/environment.cpp | 78 +++------------------------------------------ 1 file changed, 5 insertions(+), 73 deletions(-) diff --git a/src/environment.cpp b/src/environment.cpp index 0dab542..d55aa38 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -594,7 +594,7 @@ void ServerEnvironment::activateBlock(MapBlock *block, u32 additional_dtime) block->setTimestamp(m_game_time); //dstream<<"Block is "<getBlockNoCreateNoEx(p); if(block==NULL) continue; + // Set current time as timestamp (and let it set ChangedFlag) - block->setTimestamp(m_game_time); } @@ -770,75 +770,7 @@ void ServerEnvironment::step(float dtime) if(block==NULL) continue; - // Get time difference - u32 dtime_s = 0; - u32 stamp = block->getTimestamp(); - if(m_game_time > stamp && stamp != BLOCK_TIMESTAMP_UNDEFINED) - dtime_s = m_game_time - block->getTimestamp(); - - // Set current time as timestamp (and let it set ChangedFlag) - block->setTimestamp(m_game_time); - - //dstream<<"Block is "<m_node_metadata.step((float)dtime_s); - if(changed) - { - MapEditEvent event; - event.type = MEET_BLOCK_NODE_METADATA_CHANGED; - event.p = p; - m_map->dispatchEvent(&event); - - block->setChangedFlag(); - } - - // TODO: Do something - // TODO: Implement usage of ActiveBlockModifier - - // Here's a quick demonstration - v3s16 p0; - for(p0.X=0; p0.XgetPosRelative(); - MapNode n = block->getNodeNoEx(p0); - // Test something: - // Convert all mud under proper day lighting to grass - if(n.d == CONTENT_MUD) - { - if(dtime_s > 300) - { - MapNode n_top = block->getNodeNoEx(p0+v3s16(0,1,0)); - if(content_features(n_top.d).air_equivalent && - n_top.getLight(LIGHTBANK_DAY) >= 13) - { - n.d = CONTENT_GRASS; - m_map->addNodeWithEvent(p, n); - } - } - } - /* - Convert grass into mud if under something else than air - */ - else if(n.d == CONTENT_GRASS) - { - //if(myrand()%20 == 0) - { - MapNode n_top = block->getNodeNoEx(p0+v3s16(0,1,0)); - if(n_top.d != CONTENT_AIR - && n_top.d != CONTENT_IGNORE) - { - n.d = CONTENT_MUD; - m_map->addNodeWithEvent(p, n); - } - } - } - } + activateBlock(block); } } @@ -954,8 +886,8 @@ void ServerEnvironment::step(float dtime) n.d = CONTENT_MUD; m_map->addNodeWithEvent(p, n); } - } } + } } } } From 0802edf582d5aa890213bc87c18fd1527d3ad3dc Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sat, 16 Jul 2011 17:14:58 +0200 Subject: [PATCH 054/158] * README updated --- README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README b/README index 094e66f..6c7b221 100644 --- a/README +++ b/README @@ -10,15 +10,15 @@ New bricks: * Cactus (plant that grows on sand) * Clay (found in sand at sea level, yields 4 lumps of clay) * Brick (made from 4 clay bricks, yields 4 clay bricks) -* Papyrus (plant that grows in shallow water, yields paper) +* Papyrus (plant that grows in shallow water) * Book shelf (made from 6 wood and 3 books, sandwhiched) * Rail (made from 6 iron ingots and 3 sticks, vertically sandwhiched) New materials: * Lump of clay * Clay brick (made from lumps of clay in the furnace) -* Paper -* Book (made from 3 paper) +* Paper (made from 3 papyrus horizontally) +* Book (made from 3 paper vertically) Alternate graphics: * Player From 077ffa5231eddd7e71cc59eadb7b6f7a8b33b3c0 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sun, 17 Jul 2011 22:33:18 +0200 Subject: [PATCH 055/158] =?UTF-8?q?*=20changed=20GUI=20to=20indicate=20Min?= =?UTF-8?q?etest=20=CE=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/game.cpp | 2 +- src/guiPauseMenu.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index d77b45d..0f858e8 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -2021,7 +2021,7 @@ void the_game( endscenetime_avg = endscenetime_avg * 0.95 + (float)endscenetime*0.05; char temptext[300]; - snprintf(temptext, 300, "Minetest-c55 %s (" + snprintf(temptext, 300, "Minetest-delta %s (" "R: range_all=%i" ")" " drawtime=%.0f, beginscenetime=%.0f" diff --git a/src/guiPauseMenu.cpp b/src/guiPauseMenu.cpp index d32d1a1..1a885a6 100644 --- a/src/guiPauseMenu.cpp +++ b/src/guiPauseMenu.cpp @@ -166,8 +166,8 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) );*/ std::ostringstream os; - os<<"Minetest-c55\n"; - os<<"by Perttu Ahola\n"; + os<<"Minetest-delta\n"; + os<<"by Perttu Ahola and contributors\n"; os<<"celeron55@gmail.com\n"; os< Date: Mon, 18 Jul 2011 02:09:55 +0200 Subject: [PATCH 056/158] =?UTF-8?q?*=20=D0=9E=D0=BC=D1=81=D0=BA=D0=B0?= =?UTF-8?q?=D1=8F=20=D0=BF=D1=82=D0=B8=D1=86=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/oerkki1.png | Bin 270 -> 333 bytes data/oerkki1_damaged.png | Bin 341 -> 291 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/data/oerkki1.png b/data/oerkki1.png index aad2ddb41faada144601bfaaf02cdd814ad4bb97..1256a8a574408a2f1c6096d68c0bdd734c4ea0aa 100644 GIT binary patch literal 333 zcmV-T0kZyyP)Px$2T4RhR9M69Siud0Fbq5>%ka($UC5JUiH^|~@@AUiKA=^JQfjbUk}8(?97gsf zc6y1QMVJR5#ey;iiyatafD%q5{C2B#)?4a7 zyeH#$optg-;A2Um{bll)eSD4tqQ(|sSrTvnu6@5qIE7_PAOJWI!=jv0Sk@&Jgjg;F z+9Tr^FD1+fknp5&#&bZWLtYgnMUyzZIYuclu{C zBJTrJ4>SOH^NRatcvkg*Y6qskJkstG<1vQ|&40{+N}v*`1S)|_pb{uf3(b1y7A?r8 f--Q7tR`(F>Pya`>--rgDardyt7-tj!NVntfK*GJ zF=(8?RtxmTiG*`oEodJp{}?Cb^@4WrN#LUi;r|&tb|0P*V1JaI0uY7Tv;aw{*%eX( z@FUl^6DSi@6h83j@&H#5pZ-E+@LIW`tB@)SxjMu0mlA?2ke-4roOL&8wKuSIKL9vT zV}r$T0P-CD03GNK_c`0;uaE&4fB_hQ0T{sLYoSNAAx-5$0&YF)KLOcyKfrueF0cRq O002ovPDHLkU;%>q19Wu& delta 314 zcmV-A0mc5K0@VVLB!2{RLP=Bz2nYy#2xN!=000SaNLh0L01m_e01m_fl`9S#0002@ zNklkh*p2!&5HFpGb2WBFS-hTy%fR%`%b^)0}N9K-z zAL3tgPC)I{!Cbnb?s3v>%hWwiojMpRfVgn=UQNmajznqbDV`Pwdljiq58n%-i~A*0N_4 z#*ToePI+^~A2YJuTP$3_6FjkhCBP#EM3VxdNdeKMfM`-cG$|mOHxc;s5{u M07*qoM6N<$g0|0v1poj5 From def870953a9d964749cbd8fcfc050f69a0c8e53f Mon Sep 17 00:00:00 2001 From: Felix Krause Date: Sat, 16 Jul 2011 16:01:37 +0200 Subject: [PATCH 057/158] * refactored liquid transformation code (has some flaws) Completely rewrote the liquid transformation. The algorithm now exclusively modifies the current node in one iteration. Another change is that MapNode.param2 now stores a bit that tells other nodes if a flowing liquid node flows downwards. This is accomplished by two masks on param2 for the "flow down" bit and the "liquid level" bits. This will be the base of future improvements to the liquid flow. However, in the current state flowing liquid does not always disappear when cut off its source. Be aware that this branch is work in progress. --- src/content_mapblock.cpp | 2 +- src/map.cpp | 471 +++++++++++++++++---------------------- src/mapnode.h | 7 + 3 files changed, 218 insertions(+), 262 deletions(-) diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp index 4c28fe3..d8bf71d 100644 --- a/src/content_mapblock.cpp +++ b/src/content_mapblock.cpp @@ -375,7 +375,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data, if(n2.d == CONTENT_WATERSOURCE) level = (-0.5+node_water_level) * BS; else if(n2.d == CONTENT_WATER) - level = (-0.5 + ((float)n2.param2 + 0.5) / 8.0 + level = (-0.5 + ((float)(n2.param2 & LIQUID_LEVEL_MASK) + 0.5) / 8.0 * node_water_level) * BS; // Check node above neighbor. diff --git a/src/map.cpp b/src/map.cpp index 10e1302..298826e 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1086,7 +1086,7 @@ void Map::addNodeAndUpdate(v3s16 p, MapNode n, v3s16 p2 = p + dirs[i]; MapNode n2 = getNode(p2); - if(content_liquid(n2.d)) + if(content_liquid(n2.d) || n2.d == CONTENT_AIR) { m_transforming_liquid.push_back(p2); } @@ -1241,18 +1241,10 @@ void Map::removeNodeAndUpdate(v3s16 p, /* Add neighboring liquid nodes to transform queue. - - Also add horizontal neighbors of node on top of removed node - because they could be affected of the water on top flowing - down instead of into them. */ v3s16 dirs[10] = { v3s16(0,0,1), // back v3s16(0,1,0), // top - v3s16(1,1,0), // topright - v3s16(-1,1,0), // topleft - v3s16(0,1,1), // topback - v3s16(0,1,-1), // topfront v3s16(1,0,0), // right v3s16(0,0,-1), // front v3s16(0,-1,0), // bottom @@ -1266,7 +1258,7 @@ void Map::removeNodeAndUpdate(v3s16 p, v3s16 p2 = p + dirs[i]; MapNode n2 = getNode(p2); - if(content_liquid(n2.d)) + if(content_liquid(n2.d) || n2.d == CONTENT_AIR) { m_transforming_liquid.push_back(p2); } @@ -1546,6 +1538,17 @@ void Map::PrintInfo(std::ostream &out) #define WATER_DROP_BOOST 4 +enum NeighborType { + NEIGHBOR_UPPER, + NEIGHBOR_SAME_LEVEL, + NEIGHBOR_LOWER +}; +struct NodeNeighbor { + MapNode n; + NeighborType t; + v3s16 p; +}; + void Map::transformLiquids(core::map & modified_blocks) { DSTACK(__FUNCTION_NAME); @@ -1565,264 +1568,210 @@ void Map::transformLiquids(core::map & modified_blocks) v3s16 p0 = m_transforming_liquid.pop_front(); MapNode n0 = getNodeNoEx(p0); - - // Don't deal with non-liquids - if(content_liquid(n0.d) == false) - continue; - - bool is_source = !content_flowing_liquid(n0.d); - - u8 liquid_level = 8; - if(is_source == false) - liquid_level = n0.param2 & 0x0f; - - // Turn possible source into non-source - u8 nonsource_c = make_liquid_flowing(n0.d); - - // Counts surrounding liquid source blocks - u8 surrounding_sources = 0; - + /* - If not source, check that some node flows into this one - and what is the level of liquid in this one - */ - if(is_source == false) - { - s8 new_liquid_level_max = -1; - - v3s16 dirs_from[5] = { - v3s16(0,1,0), // top - v3s16(0,0,1), // back - v3s16(1,0,0), // right - v3s16(0,0,-1), // front - v3s16(-1,0,0), // left - }; - for(u16 i=0; i<5; i++) - { - bool from_top = (i==0); - - v3s16 p2 = p0 + dirs_from[i]; - MapNode n2 = getNodeNoEx(p2); - - if(content_liquid(n2.d)) - { - u8 n2_nonsource_c = make_liquid_flowing(n2.d); - // Check that the liquids are the same type - if(n2_nonsource_c != nonsource_c) - { - dstream<<"WARNING: Not handling: different liquids" - " collide"<= 7 - WATER_DROP_BOOST) - new_liquid_level = 7; - else - new_liquid_level = n2_liquid_level + WATER_DROP_BOOST; - } - else if(n2_liquid_level > 0) - { - // If the neighbor node isn't a source and flows downwards, - // it doesn't flow into this node - if (n2_is_source) - { - new_liquid_level = n2_liquid_level - 1; - } - else - { - // Node below n2 - MapNode n3 = getNodeNoEx(p2 + v3s16(0,-1,0)); - // NOTE: collision of different liquids not yet handled here. - if (content_features(n3.d).liquid_type != LIQUID_FLOWING) - new_liquid_level = n2_liquid_level - 1; - } - } - - if(new_liquid_level > new_liquid_level_max) - new_liquid_level_max = new_liquid_level; - } - } //for - - /* - If liquid level should be something else, update it and - add all the neighboring water nodes to the transform queue. - */ - if(new_liquid_level_max != liquid_level || (!is_source && surrounding_sources >= 2)) - { - if (surrounding_sources >= 2) - { - n0.d = content_features(n0.d).liquid_alternative_source; - setNode(p0,n0); - } - else if(new_liquid_level_max == -1) - { - // Remove water alltoghether - n0.d = CONTENT_AIR; - n0.param2 = 0; - setNode(p0, n0); - } - else - { - n0.param2 = new_liquid_level_max; - liquid_level = new_liquid_level_max; - setNode(p0, n0); - } - - // Block has been modified - { - v3s16 blockpos = getNodeBlockPos(p0); - MapBlock *block = getBlockNoCreateNoEx(blockpos); - if(block != NULL) - modified_blocks.insert(blockpos, block); - } - - /* - Add neighboring non-source liquid nodes to transform queue. - */ - v3s16 dirs[6] = { - v3s16(0,0,1), // back - v3s16(0,1,0), // top - v3s16(1,0,0), // right - v3s16(0,0,-1), // front - v3s16(0,-1,0), // bottom - v3s16(-1,0,0), // left - }; - for(u16 i=0; i<6; i++) - { - v3s16 p2 = p0 + dirs[i]; - - MapNode n2 = getNodeNoEx(p2); - if(content_flowing_liquid(n2.d)) - { - m_transforming_liquid.push_back(p2); - } - } - } - } - - // Get a new one from queue if the node has turned into non-water - if(content_liquid(n0.d) == false) - continue; - - /* - Flow water from this node - */ - v3s16 dirs_to[5] = { - v3s16(0,-1,0), // bottom - v3s16(0,0,1), // back - v3s16(1,0,0), // right - v3s16(0,0,-1), // front - v3s16(-1,0,0), // left - }; - for(u16 i=0; i<5; i++) - { - bool to_bottom = (i == 0); - - // If liquid is at lowest possible height, it's not going - // anywhere except down - if(liquid_level == 0 && to_bottom == false) - continue; - - u8 liquid_next_level = 0; - // If going to bottom - if(to_bottom) - { - //liquid_next_level = 7; - if(liquid_level >= 7 - WATER_DROP_BOOST) - liquid_next_level = 7; - else - liquid_next_level = liquid_level + WATER_DROP_BOOST; - } - else - liquid_next_level = liquid_level - 1; - - bool n2_changed = false; - bool flowed = false; - - v3s16 p2 = p0 + dirs_to[i]; - - MapNode n2 = getNodeNoEx(p2); - //dstream<<"[1] n2.param="<<(int)n2.param< n2_liquid_level) - { - n2.param2 = liquid_next_level; - setNode(p2, n2); - - n2_changed = true; - flowed = true; - } - } - } - else if(n2.d == CONTENT_AIR) - { - n2.d = nonsource_c; - n2.param2 = liquid_next_level; - setNode(p2, n2); - - n2_changed = true; - flowed = true; - } - - //dstream<<"[2] n2.param="<<(int)n2.param< 0)) + liquid_kind = content_features(nb.n.d).liquid_alternative_flowing; + if (content_features(nb.n.d).liquid_alternative_flowing != liquid_kind) { + neutrals[num_neutrals++] = nb; + } else { + // order flowing neighbors by liquid level descending + int insert_at = 0; + while (insert_at < num_flows && ((flows[insert_at].n.param2 & LIQUID_LEVEL_MASK) > + (nb.n.param2 & LIQUID_LEVEL_MASK))) { + insert_at++; + } + flows[insert_at] = nb; + num_flows++; + if (nb.t == NEIGHBOR_LOWER) + flowing_down = true; + } + break; + } + } + + /* + decide on the type (and possibly level) of the current node + */ + u8 new_node_content; + s8 new_node_level = -1; + if (num_sources >= 2 || liquid_type == LIQUID_SOURCE) { + // liquid_kind will be set to either the flowing alternative of the node (if it's a liquid) + // or the flowing alternative of the first of the surrounding sources (if it's air), so + // it's perfectly safe to use liquid_kind here to determine the new node content. + new_node_content = content_features(liquid_kind).liquid_alternative_source; + } else if (num_sources == 1 && sources[0].t != NEIGHBOR_LOWER) { + // liquid_kind is set properly, see above + new_node_content = liquid_kind; + new_node_level = 7; + } else { + // no surrounding sources, so get the maximum level that can flow into this node + for (u16 i = 0; i < num_flows; i++) { + u8 nb_liquid_level = (flows[i].n.param2 & LIQUID_LEVEL_MASK); + switch (flows[i].t) { + case NEIGHBOR_UPPER: + if (nb_liquid_level + WATER_DROP_BOOST > new_node_level) { + new_node_level = 7; + if (nb_liquid_level + WATER_DROP_BOOST < 7) + new_node_level = nb_liquid_level + WATER_DROP_BOOST; + } + break; + case NEIGHBOR_LOWER: + break; + case NEIGHBOR_SAME_LEVEL: + if ((flows[i].n.param2 & LIQUID_FLOW_DOWN_MASK) != LIQUID_FLOW_DOWN_MASK && + nb_liquid_level > 0 && nb_liquid_level - 1 > new_node_level) { + new_node_level = nb_liquid_level - 1; + } + break; + } + } + if (new_node_level >= 0) + new_node_content = liquid_kind; + else + new_node_content = CONTENT_AIR; + } + + /* + check if anything has changed. if not, just continue with the next node. + */ + if (new_node_content == n0.d && (content_features(n0.d).liquid_type != LIQUID_FLOWING || + ((n0.param2 & LIQUID_LEVEL_MASK) == (u8)new_node_level) && + ((n0.param2 & LIQUID_FLOW_DOWN_MASK) == LIQUID_FLOW_DOWN_MASK) + == flowing_down)) + continue; + + /* + update the current node + */ + bool flow_down_enabled = (flowing_down && ((n0.param2 & LIQUID_FLOW_DOWN_MASK) != LIQUID_FLOW_DOWN_MASK)); + n0.d = new_node_content; + if (content_features(n0.d).liquid_type == LIQUID_FLOWING) { + // set level to last 3 bits, flowing down bit to 4th bit + n0.param2 = (flowing_down ? LIQUID_FLOW_DOWN_MASK : 0x00) | (new_node_level & LIQUID_LEVEL_MASK); + } else { + n0.param2 = 0; + } + setNode(p0, n0); + v3s16 blockpos = getNodeBlockPos(p0); + MapBlock *block = getBlockNoCreateNoEx(blockpos); + if(block != NULL) + modified_blocks.insert(blockpos, block); + + switch (content_features(n0.d).liquid_type) { + case LIQUID_SOURCE: + // make sure source flows into all neighboring nodes + for (u16 i = 0; i < num_flows; i++) + if (flows[i].t != NEIGHBOR_UPPER) + m_transforming_liquid.push_back(flows[i].p); + for (u16 i = 0; i < num_airs; i++) + if (airs[i].t != NEIGHBOR_UPPER) + m_transforming_liquid.push_back(airs[i].p); + break; + case LIQUID_NONE: + // this flow has turned to air; neighboring flows might need to do the same + for (u16 i = 0; i < num_flows; i++) + m_transforming_liquid.push_back(flows[i].p); + break; + case LIQUID_FLOWING: + for (u16 i = 0; i < num_flows; i++) { + u8 flow_level = (flows[i].n.param2 & LIQUID_LEVEL_MASK); + // liquid_level is still the ORIGINAL level of this node. + if (flows[i].t != NEIGHBOR_UPPER && ((flow_level < liquid_level || flow_level < new_node_level) || + flow_down_enabled)) + m_transforming_liquid.push_back(flows[i].p); + } + for (u16 i = 0; i < num_airs; i++) { + if (airs[i].t != NEIGHBOR_UPPER && (airs[i].t == NEIGHBOR_LOWER || new_node_level > 0)) + m_transforming_liquid.push_back(airs[i].p); + } + break; + } + loopcount++; //if(loopcount >= 100000) - if(loopcount >= initial_size * 1) + if(loopcount >= initial_size * 1) { break; + } } //dstream<<"Map::transformLiquids(): loopcount="< Date: Sun, 17 Jul 2011 04:01:31 +0200 Subject: [PATCH 058/158] fixed refactoring issues // slowed down water flow a bit * liquid flow no longer does random things when transformed * if a flowi ng liquid node doesn't have a solid block as neighbor, its spread distan ce is shortened by 1 --- src/map.cpp | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/src/map.cpp b/src/map.cpp index 298826e..19ed323 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1240,17 +1240,19 @@ void Map::removeNodeAndUpdate(v3s16 p, } /* - Add neighboring liquid nodes to transform queue. + Add neighboring liquid nodes and this node to transform queue. + (it's vital for the node itself to get updated last.) */ - v3s16 dirs[10] = { + v3s16 dirs[7] = { v3s16(0,0,1), // back v3s16(0,1,0), // top v3s16(1,0,0), // right v3s16(0,0,-1), // front v3s16(0,-1,0), // bottom v3s16(-1,0,0), // left + v3s16(0,0,0), // self }; - for(u16 i=0; i<10; i++) + for(u16 i=0; i<7; i++) { try { @@ -1602,7 +1604,7 @@ void Map::transformLiquids(core::map & modified_blocks) v3s16( 1, 0, 0), // right v3s16(-1, 0, 0), // left v3s16( 0, 0, 1), // back - v3s16( 0, 0,-1) // front + v3s16( 0, 0,-1), // front }; NodeNeighbor sources[6]; // surrounding sources int num_sources = 0; @@ -1655,11 +1657,13 @@ void Map::transformLiquids(core::map & modified_blocks) neutrals[num_neutrals++] = nb; } else { // order flowing neighbors by liquid level descending - int insert_at = 0; + u16 insert_at = 0; while (insert_at < num_flows && ((flows[insert_at].n.param2 & LIQUID_LEVEL_MASK) > (nb.n.param2 & LIQUID_LEVEL_MASK))) { insert_at++; } + for (u16 j = insert_at; j < num_flows; j++) + flows[j + 1] = flows[j]; flows[insert_at] = nb; num_flows++; if (nb.t == NEIGHBOR_LOWER) @@ -1705,6 +1709,20 @@ void Map::transformLiquids(core::map & modified_blocks) break; } } + // don't flow as far in open terrain - if there isn't at least one adjacent solid block, + // substract another unit from the resulting water level. + if (!flowing_down && new_node_level >= 1) { + bool at_wall = false; + for (u16 i = 0; i < num_neutrals; i++) { + if (neutrals[i].t == NEIGHBOR_SAME_LEVEL) { + at_wall = true; + break; + } + } + if (!at_wall) + new_node_level -= 1; + } + if (new_node_level >= 0) new_node_content = liquid_kind; else @@ -1715,11 +1733,12 @@ void Map::transformLiquids(core::map & modified_blocks) check if anything has changed. if not, just continue with the next node. */ if (new_node_content == n0.d && (content_features(n0.d).liquid_type != LIQUID_FLOWING || - ((n0.param2 & LIQUID_LEVEL_MASK) == (u8)new_node_level) && + ((n0.param2 & LIQUID_LEVEL_MASK) == (u8)new_node_level && ((n0.param2 & LIQUID_FLOW_DOWN_MASK) == LIQUID_FLOW_DOWN_MASK) - == flowing_down)) + == flowing_down))) continue; + /* update the current node */ @@ -1737,6 +1756,9 @@ void Map::transformLiquids(core::map & modified_blocks) if(block != NULL) modified_blocks.insert(blockpos, block); + /* + enqueue neighbors for update if neccessary + */ switch (content_features(n0.d).liquid_type) { case LIQUID_SOURCE: // make sure source flows into all neighboring nodes From a1e2a8bec6a7815987f2f8d841842a5eb207585d Mon Sep 17 00:00:00 2001 From: Felix Krause Date: Sun, 17 Jul 2011 13:15:33 +0200 Subject: [PATCH 059/158] fixes to liquid transformation --- src/map.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/map.cpp b/src/map.cpp index 19ed323..1596f12 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1651,7 +1651,7 @@ void Map::transformLiquids(core::map & modified_blocks) case LIQUID_FLOWING: // if this node is not (yet) of a liquid type, choose the first liquid type we encounter // (while ignoring flowing liquids at the lowest level, which cannot flow into this node) - if (liquid_kind == CONTENT_AIR && ((nb.n.param2 & LIQUID_LEVEL_MASK) > 0)) + if (liquid_kind == CONTENT_AIR) liquid_kind = content_features(nb.n.d).liquid_alternative_flowing; if (content_features(nb.n.d).liquid_alternative_flowing != liquid_kind) { neutrals[num_neutrals++] = nb; @@ -1746,7 +1746,7 @@ void Map::transformLiquids(core::map & modified_blocks) n0.d = new_node_content; if (content_features(n0.d).liquid_type == LIQUID_FLOWING) { // set level to last 3 bits, flowing down bit to 4th bit - n0.param2 = (flowing_down ? LIQUID_FLOW_DOWN_MASK : 0x00) | (new_node_level & LIQUID_LEVEL_MASK); + n0.param2 = (flowing_down ? LIQUID_FLOW_DOWN_MASK : 0x00) | (new_node_level & LIQUID_LEVEL_MASK); } else { n0.param2 = 0; } @@ -1776,10 +1776,10 @@ void Map::transformLiquids(core::map & modified_blocks) break; case LIQUID_FLOWING: for (u16 i = 0; i < num_flows; i++) { - u8 flow_level = (flows[i].n.param2 & LIQUID_LEVEL_MASK); + /*u8 flow_level = (flows[i].n.param2 & LIQUID_LEVEL_MASK); // liquid_level is still the ORIGINAL level of this node. if (flows[i].t != NEIGHBOR_UPPER && ((flow_level < liquid_level || flow_level < new_node_level) || - flow_down_enabled)) + flow_down_enabled))*/ m_transforming_liquid.push_back(flows[i].p); } for (u16 i = 0; i < num_airs; i++) { @@ -1791,7 +1791,7 @@ void Map::transformLiquids(core::map & modified_blocks) loopcount++; //if(loopcount >= 100000) - if(loopcount >= initial_size * 1) { + if(loopcount >= initial_size * 10) { break; } } From 7d92ce061d568118821548427106ae868eb7ce42 Mon Sep 17 00:00:00 2001 From: Felix Krause Date: Sun, 17 Jul 2011 13:55:59 +0200 Subject: [PATCH 060/158] final fixes to liquid flow, works now as intended --- src/map.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/map.cpp b/src/map.cpp index 1596f12..cf8692b 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1612,7 +1612,7 @@ void Map::transformLiquids(core::map & modified_blocks) int num_flows = 0; NodeNeighbor airs[6]; // surrounding air int num_airs = 0; - NodeNeighbor neutrals[6]; // nodes that are solid, another kind of liquid + NodeNeighbor neutrals[6]; // nodes that are solid or another kind of liquid int num_neutrals = 0; bool flowing_down = false; for (u16 i = 0; i < 6; i++) { @@ -1631,7 +1631,7 @@ void Map::transformLiquids(core::map & modified_blocks) case LIQUID_NONE: if (nb.n.d == CONTENT_AIR) { airs[num_airs++] = nb; - // if the current nodes happens to be a flowing node, it will start to flow down here. + // if the current node happens to be a flowing node, it will start to flow down here. if (nb.t == NEIGHBOR_LOWER) flowing_down = true; } else { @@ -1650,22 +1650,12 @@ void Map::transformLiquids(core::map & modified_blocks) break; case LIQUID_FLOWING: // if this node is not (yet) of a liquid type, choose the first liquid type we encounter - // (while ignoring flowing liquids at the lowest level, which cannot flow into this node) if (liquid_kind == CONTENT_AIR) liquid_kind = content_features(nb.n.d).liquid_alternative_flowing; if (content_features(nb.n.d).liquid_alternative_flowing != liquid_kind) { neutrals[num_neutrals++] = nb; } else { - // order flowing neighbors by liquid level descending - u16 insert_at = 0; - while (insert_at < num_flows && ((flows[insert_at].n.param2 & LIQUID_LEVEL_MASK) > - (nb.n.param2 & LIQUID_LEVEL_MASK))) { - insert_at++; - } - for (u16 j = insert_at; j < num_flows; j++) - flows[j + 1] = flows[j]; - flows[insert_at] = nb; - num_flows++; + flows[num_flows++] = nb; if (nb.t == NEIGHBOR_LOWER) flowing_down = true; } @@ -1776,10 +1766,10 @@ void Map::transformLiquids(core::map & modified_blocks) break; case LIQUID_FLOWING: for (u16 i = 0; i < num_flows; i++) { - /*u8 flow_level = (flows[i].n.param2 & LIQUID_LEVEL_MASK); + u8 flow_level = (flows[i].n.param2 & LIQUID_LEVEL_MASK); // liquid_level is still the ORIGINAL level of this node. if (flows[i].t != NEIGHBOR_UPPER && ((flow_level < liquid_level || flow_level < new_node_level) || - flow_down_enabled))*/ + flow_down_enabled)) m_transforming_liquid.push_back(flows[i].p); } for (u16 i = 0; i < num_airs; i++) { From 414d1ff9e2a1f40929480e094631efb0878e4ecf Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Mon, 18 Jul 2011 22:50:14 +0200 Subject: [PATCH 061/158] + volumetric clouds (thanks teddydestodes) --- src/clouds.cpp | 73 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 62 insertions(+), 11 deletions(-) diff --git a/src/clouds.cpp b/src/clouds.cpp index 122beed..0225504 100644 --- a/src/clouds.cpp +++ b/src/clouds.cpp @@ -125,22 +125,73 @@ void Clouds::render() m_seed, 3, 0.4); if(noise < 0.8) continue; - - v2f p1 = p0 + v2f(1,1)*cloud_size; - //video::SColor c(128,255,255,255); float b = m_brightness; video::SColor c(128,b*230,b*230,b*255); - video::S3DVertex vertices[4] = + + video::S3DVertex v[4] = { - video::S3DVertex(p0.X,m_cloud_y,p0.Y, 0,0,0, c, 0,1), - video::S3DVertex(p0.X,m_cloud_y,p1.Y, 0,0,0, c, 1,1), - video::S3DVertex(p1.X,m_cloud_y,p1.Y, 0,0,0, c, 1,0), - video::S3DVertex(p1.X,m_cloud_y,p0.Y, 0,0,0, c, 0,0), + video::S3DVertex(0,0,0, 0,0,0, c, 0, 1), + video::S3DVertex(0,0,0, 0,0,0, c, 1, 1), + video::S3DVertex(0,0,0, 0,0,0, c, 1, 0), + video::S3DVertex(0,0,0, 0,0,0, c, 0, 0) }; - u16 indices[] = {0,1,2,2,3,0}; - driver->drawVertexPrimitiveList(vertices, 4, indices, 2, - video::EVT_STANDARD, scene::EPT_TRIANGLES, video::EIT_16BIT); + + f32 rx = cloud_size; + f32 ry = 16*BS; + f32 rz = cloud_size; + + for(int i=0;i<6;i++) + { + switch(i) + { + case 0: // top + v[0].Pos.X=-rx; v[0].Pos.Y= ry; v[0].Pos.Z=-rz; + v[1].Pos.X=-rx; v[1].Pos.Y= ry; v[1].Pos.Z= rz; + v[2].Pos.X= rx; v[2].Pos.Y= ry; v[2].Pos.Z= rz; + v[3].Pos.X= rx; v[3].Pos.Y= ry, v[3].Pos.Z=-rz; + break; + case 1: // back + v[0].Pos.X=-rx; v[0].Pos.Y= ry; v[0].Pos.Z=-rz; + v[1].Pos.X= rx; v[1].Pos.Y= ry; v[1].Pos.Z=-rz; + v[2].Pos.X= rx; v[2].Pos.Y=-ry; v[2].Pos.Z=-rz; + v[3].Pos.X=-rx; v[3].Pos.Y=-ry, v[3].Pos.Z=-rz; + break; + case 2: //right + v[0].Pos.X= rx; v[0].Pos.Y= ry; v[0].Pos.Z=-rz; + v[1].Pos.X= rx; v[1].Pos.Y= ry; v[1].Pos.Z= rz; + v[2].Pos.X= rx; v[2].Pos.Y=-ry; v[2].Pos.Z= rz; + v[3].Pos.X= rx; v[3].Pos.Y=-ry, v[3].Pos.Z=-rz; + break; + case 3: // front + v[0].Pos.X= rx; v[0].Pos.Y= ry; v[0].Pos.Z= rz; + v[1].Pos.X=-rx; v[1].Pos.Y= ry; v[1].Pos.Z= rz; + v[2].Pos.X=-rx; v[2].Pos.Y=-ry; v[2].Pos.Z= rz; + v[3].Pos.X= rx; v[3].Pos.Y=-ry, v[3].Pos.Z= rz; + break; + case 4: // left + v[0].Pos.X=-rx; v[0].Pos.Y= ry; v[0].Pos.Z= rz; + v[1].Pos.X=-rx; v[1].Pos.Y= ry; v[1].Pos.Z=-rz; + v[2].Pos.X=-rx; v[2].Pos.Y=-ry; v[2].Pos.Z=-rz; + v[3].Pos.X=-rx; v[3].Pos.Y=-ry, v[3].Pos.Z= rz; + break; + case 5: // bottom + v[0].Pos.X= rx; v[0].Pos.Y=-ry; v[0].Pos.Z= rz; + v[1].Pos.X=-rx; v[1].Pos.Y=-ry; v[1].Pos.Z= rz; + v[2].Pos.X=-rx; v[2].Pos.Y=-ry; v[2].Pos.Z=-rz; + v[3].Pos.X= rx; v[3].Pos.Y=-ry, v[3].Pos.Z=-rz; + break; + } + + v3f pos = v3f(p0.X,m_cloud_y,p0.Y); + + for(u16 i=0; i<4; i++) + v[i].Pos += pos; + u16 indices[] = {0,1,2,2,3,0}; + driver->drawVertexPrimitiveList(v, 4, indices, 2, + video::EVT_STANDARD, scene::EPT_TRIANGLES, video::EIT_16BIT); + } + } } From e8eb4d233b825a55f16953bc82a8b9c6d819b32c Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Tue, 19 Jul 2011 01:43:30 +0200 Subject: [PATCH 062/158] + fake shading for the volumetric clouds --- src/clouds.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/clouds.cpp b/src/clouds.cpp index 0225504..19bcca9 100644 --- a/src/clouds.cpp +++ b/src/clouds.cpp @@ -127,18 +127,21 @@ void Clouds::render() continue; float b = m_brightness; - video::SColor c(128,b*230,b*230,b*255); + video::SColor c_top(128,b*240,b*240,b*255); + video::SColor c_side_1(128,b*230,b*230,b*255); + video::SColor c_side_2(128,b*220,b*220,b*245); + video::SColor c_bottom(128,b*205,b*205,b*230); video::S3DVertex v[4] = { - video::S3DVertex(0,0,0, 0,0,0, c, 0, 1), - video::S3DVertex(0,0,0, 0,0,0, c, 1, 1), - video::S3DVertex(0,0,0, 0,0,0, c, 1, 0), - video::S3DVertex(0,0,0, 0,0,0, c, 0, 0) + video::S3DVertex(0,0,0, 0,0,0, c_top, 0, 1), + video::S3DVertex(0,0,0, 0,0,0, c_top, 1, 1), + video::S3DVertex(0,0,0, 0,0,0, c_top, 1, 0), + video::S3DVertex(0,0,0, 0,0,0, c_top, 0, 0) }; f32 rx = cloud_size; - f32 ry = 16*BS; + f32 ry = 8*BS; f32 rz = cloud_size; for(int i=0;i<6;i++) @@ -152,30 +155,40 @@ void Clouds::render() v[3].Pos.X= rx; v[3].Pos.Y= ry, v[3].Pos.Z=-rz; break; case 1: // back + for(int j=0;j<4;j++) + v[j].Color=c_side_1; v[0].Pos.X=-rx; v[0].Pos.Y= ry; v[0].Pos.Z=-rz; v[1].Pos.X= rx; v[1].Pos.Y= ry; v[1].Pos.Z=-rz; v[2].Pos.X= rx; v[2].Pos.Y=-ry; v[2].Pos.Z=-rz; v[3].Pos.X=-rx; v[3].Pos.Y=-ry, v[3].Pos.Z=-rz; break; case 2: //right + for(int j=0;j<4;j++) + v[j].Color=c_side_2; v[0].Pos.X= rx; v[0].Pos.Y= ry; v[0].Pos.Z=-rz; v[1].Pos.X= rx; v[1].Pos.Y= ry; v[1].Pos.Z= rz; v[2].Pos.X= rx; v[2].Pos.Y=-ry; v[2].Pos.Z= rz; v[3].Pos.X= rx; v[3].Pos.Y=-ry, v[3].Pos.Z=-rz; break; case 3: // front + for(int j=0;j<4;j++) + v[j].Color=c_side_1; v[0].Pos.X= rx; v[0].Pos.Y= ry; v[0].Pos.Z= rz; v[1].Pos.X=-rx; v[1].Pos.Y= ry; v[1].Pos.Z= rz; v[2].Pos.X=-rx; v[2].Pos.Y=-ry; v[2].Pos.Z= rz; v[3].Pos.X= rx; v[3].Pos.Y=-ry, v[3].Pos.Z= rz; break; case 4: // left + for(int j=0;j<4;j++) + v[j].Color=c_side_2; v[0].Pos.X=-rx; v[0].Pos.Y= ry; v[0].Pos.Z= rz; v[1].Pos.X=-rx; v[1].Pos.Y= ry; v[1].Pos.Z=-rz; v[2].Pos.X=-rx; v[2].Pos.Y=-ry; v[2].Pos.Z=-rz; v[3].Pos.X=-rx; v[3].Pos.Y=-ry, v[3].Pos.Z= rz; break; case 5: // bottom + for(int j=0;j<4;j++) + v[j].Color=c_bottom; v[0].Pos.X= rx; v[0].Pos.Y=-ry; v[0].Pos.Z= rz; v[1].Pos.X=-rx; v[1].Pos.Y=-ry; v[1].Pos.Z= rz; v[2].Pos.X=-rx; v[2].Pos.Y=-ry; v[2].Pos.Z=-rz; From 821ff68f54581917e9f882058c828e6c457eb93b Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Tue, 19 Jul 2011 02:02:50 +0200 Subject: [PATCH 063/158] * initialize liquid_kind properly so compiler does not bitch about it --- src/map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map.cpp b/src/map.cpp index cf8692b..aa06463 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1575,7 +1575,7 @@ void Map::transformLiquids(core::map & modified_blocks) Collect information about current node */ s8 liquid_level = -1; - u8 liquid_kind; + u8 liquid_kind = CONTENT_IGNORE; LiquidType liquid_type = content_features(n0.d).liquid_type; switch (liquid_type) { case LIQUID_SOURCE: From 0cd2972d6008059d834091e8929d12b427c8999b Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Tue, 19 Jul 2011 23:32:01 +0200 Subject: [PATCH 064/158] + minetest application icon --- minetest-icon.svg | 183 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 minetest-icon.svg diff --git a/minetest-icon.svg b/minetest-icon.svg new file mode 100644 index 0000000..46c9ac7 --- /dev/null +++ b/minetest-icon.svg @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + From ac2e822ea18c194b9747ca63dd69262b79a190e0 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Tue, 19 Jul 2011 23:35:12 +0200 Subject: [PATCH 065/158] * README updated --- README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README b/README index 6c7b221..bf608cc 100644 --- a/README +++ b/README @@ -4,6 +4,7 @@ New features: * Submenu for key assignment (changes apply after restart) * configurable far mesh tree display (boolean) * configurable far mesh rendering distance +* volumetric clouds (using fake shading) New bricks: * Sandstone (crafted from 4 sand, yields sand) @@ -25,6 +26,7 @@ Alternate graphics: * Omsk birds (instead of Oerkki ghosts) * Rat * Glass +* Heart Building on GNU/Linux or OS X: cmake . -DRUN_IN_PLACE=1 From ffd3cdf5197a3982b7607601d17100da47fc6eed Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 20 Jul 2011 02:44:51 +0200 Subject: [PATCH 066/158] * by popular request, fewer clouds --- src/clouds.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/clouds.cpp b/src/clouds.cpp index 19bcca9..d754cc1 100644 --- a/src/clouds.cpp +++ b/src/clouds.cpp @@ -84,7 +84,7 @@ void Clouds::render() */ const s16 cloud_radius_i = 12; - const float cloud_size = BS*50; + const float cloud_size = BS*48; const v2f cloud_speed(-BS*2, 0); // Position of cloud noise origin in world coordinates @@ -123,7 +123,7 @@ void Clouds::render() (float)p_in_noise_i.X*cloud_size/BS/200, (float)p_in_noise_i.Y*cloud_size/BS/200, m_seed, 3, 0.4); - if(noise < 0.8) + if(noise < 0.95) continue; float b = m_brightness; From d0810b0156073833b9966672c86b5fc3650dade9 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 20 Jul 2011 02:45:15 +0200 Subject: [PATCH 067/158] * README updated (graphics licensing) --- README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README b/README index bf608cc..65a2881 100644 --- a/README +++ b/README @@ -35,3 +35,5 @@ Building on GNU/Linux or OS X: The “upstream” branch contains vanilla minetest-c55, created using: hg-fast-export -r ~/share/src/games/minetest -o upstream git push origin upstream/master:upstream -f + +All new/replaced graphics done by erlehmann are dual-licensed under GPL (version 2 or, at your option, any later version) and CC-BY-SA (version 3.0 or, at your option, any later version). From 052bb24c7f03e5542be2b8c2a14662fcbf928a42 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Wed, 20 Jul 2011 16:51:19 +0200 Subject: [PATCH 068/158] added gettext support german translation file and bashscript to update translations --- README.txt | 10 ++++ po/de/minetest-c55.po | 121 ++++++++++++++++++++++++++++++++++++++ src/CMakeLists.txt | 41 +++++++++++++ src/gettext.h | 12 ++++ src/guiMainMenu.cpp | 26 ++++---- src/guiMessageMenu.cpp | 4 +- src/guiPasswordChange.cpp | 16 +++-- src/guiPauseMenu.cpp | 36 ++++++------ src/guiTextInputMenu.cpp | 4 +- src/main.cpp | 5 ++ updatelocales.sh | 4 ++ 11 files changed, 237 insertions(+), 42 deletions(-) create mode 100644 po/de/minetest-c55.po create mode 100644 src/gettext.h create mode 100644 updatelocales.sh diff --git a/README.txt b/README.txt index 4104899..662f277 100644 --- a/README.txt +++ b/README.txt @@ -90,6 +90,8 @@ Compiling on Windows: http://www.winimage.com/zLibDll/index.html * Zlib library (zlibwapi.lib and zlibwapi.dll from zlib125dll.zip): http://www.winimage.com/zLibDll/index.html + * gettext bibrary and tools: + http://gnuwin32.sourceforge.net/downlinks/gettext.php * And, of course, Minetest-c55: http://celeron.55.lt/~celeron55/minetest/download - Steps: @@ -117,6 +119,10 @@ Compiling on Windows: + lib + include ... + + gettext + +bin + +include + +lib + minetest + src + doc @@ -145,6 +151,10 @@ Compiling on Windows: ZLIB_DLL DIR/zlib125dll/dll32/zlibwapi.dll ZLIB_INCLUDE_DIR DIR/zlib-1.2.5 ZLIB_LIBRARIES DIR/zlib125dll/dll32/zlibwapi.lib + GETTEXT_BIN_DIR DIR/gettext/bin + GETTEXT_INCLUDE_DIR DIR/gettext/include + GETTEXT_LIBRARIES DIR/gettext/lib/intl.lib + GETTEXT_MSGFMT DIR/gettext/bin/msgfmt ----------------- - Hit "Configure" - Hit "Generate" diff --git a/po/de/minetest-c55.po b/po/de/minetest-c55.po new file mode 100644 index 0000000..58c977f --- /dev/null +++ b/po/de/minetest-c55.po @@ -0,0 +1,121 @@ +# German translations for minetest-c55 package. +# Copyright (C) 2011 celeron +# This file is distributed under the same license as the minetest-c55 package. +# Constantin Wenger , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-07-20 16:03+0200\n" +"PO-Revision-Date: 2011-07-20 16:04+0100\n" +"Last-Translator: Constantin Wenger \n" +"Language-Team: Deutsch <>\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" + +#: src/guiMainMenu.cpp:173 +msgid "Name/Password" +msgstr "Name/Passwort" + +#: src/guiMainMenu.cpp:195 +msgid "Address/Port" +msgstr "Adresse / Port" + +#: src/guiMainMenu.cpp:214 +msgid "Leave address blank to start a local server." +msgstr "Lasse die Adresse frei um einen eigenen Server zu starten" + +#: src/guiMainMenu.cpp:220 +msgid "Fancy trees" +msgstr "Schöne Bäume" + +#: src/guiMainMenu.cpp:226 +msgid "Smooth Lighting" +msgstr "Besseres Licht" + +#: src/guiMainMenu.cpp:233 +msgid "Start Game / Connect" +msgstr "Spiel starten / Verbinden" + +#: src/guiMainMenu.cpp:256 +msgid "Creative Mode" +msgstr "Kreativitätsmodus" + +#: src/guiMainMenu.cpp:261 +msgid "Enable Damage" +msgstr "Schaden einschalten" + +#: src/guiMainMenu.cpp:268 +msgid "Delete world" +msgstr "Welt löschen" + +#: src/guiMessageMenu.cpp:92 +#: src/guiTextInputMenu.cpp:110 +msgid "Proceed" +msgstr "Fortsetzen" + +#: src/guiPasswordChange.cpp:102 +msgid "Old Password" +msgstr "Altes Passwort" + +#: src/guiPasswordChange.cpp:116 +msgid "New Password" +msgstr "Neues Passwort" + +#: src/guiPasswordChange.cpp:129 +msgid "Confirm Password" +msgstr "Passwort wiederholen" + +#: src/guiPasswordChange.cpp:143 +msgid "Change" +msgstr "Ändern" + +#: src/guiPasswordChange.cpp:151 +msgid "Passwords do not match!" +msgstr "Passwörter passen nicht zusammen" + +#: src/guiPauseMenu.cpp:109 +msgid "Continue" +msgstr "Weiter" + +#: src/guiPauseMenu.cpp:115 +msgid "Change Password" +msgstr "Passwort ändern" + +#: src/guiPauseMenu.cpp:121 +msgid "Disconnect" +msgstr "Verbindung trennen" + +#: src/guiPauseMenu.cpp:127 +msgid "Exit to OS" +msgstr "Programm beenden" + +#: src/guiPauseMenu.cpp:134 +msgid "" +"Keys:\n" +"- WASD: Walk\n" +"- Mouse left: dig blocks\n" +"- Mouse right: place blocks\n" +"- Mouse wheel: select item\n" +"- 0...9: select item\n" +"- Shift: sneak\n" +"- R: Toggle viewing all loaded chunks\n" +"- I: Inventory menu\n" +"- ESC: This menu\n" +"- T: Chat\n" +msgstr "" +"Tastenkürzel:\n" +"- WASD: Gehen\n" +"- linke Maustaste: dig blocks\n" +"- rechte Maustaste: place blocks\n" +"- Mausrad: Item auswählen\n" +"- 0...9: Item auswählen\n" +"- Shift: ducken\n" +"- R: Alle geladenen Kartenteile anzeigen, umschalten\n" +"- I: Inventarmenü\n" +"- T: Chat\n" + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dfe5b57..fd15914 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -27,6 +27,14 @@ if(WIN32) CACHE FILEPATH "Path to zlibwapi.lib") set(ZLIB_DLL "${PROJECT_SOURCE_DIR}/../../zlib125dll/dll32/zlibwapi.dll" CACHE FILEPATH "Path to zlibwapi.dll (for installation)") + set(GETTEXT_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/../../gettext/include" + CACHE PATH "gettext include directory") + set(GETTEXT_BIN_DIR "${PROJECT_SOURCE_DIR}/../../gettext/bin" + CACHE PATH "gettext bin directory") + set(GETTEXT_LIBRARIES "${PROJECT_SOURCE_DIR}/../../gettext/lib/intl.lib" + CACHE FILEPATH "gettext intl.lib") + set(IRRLICHT_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../irrlicht-1.7.2" + CACHE PATH "irrlicht dir") else() # Unix probably if(BUILD_CLIENT) @@ -134,6 +142,7 @@ include_directories( ${ZLIB_INCLUDE_DIR} ${CMAKE_BUILD_TYPE} ${PNG_INCLUDE_DIR} + ${GETTEXT_INCLUDE_DIR} "${PROJECT_SOURCE_DIR}/jthread" "${PROJECT_SOURCE_DIR}/sqlite" ) @@ -151,6 +160,7 @@ if(BUILD_CLIENT) ${BZIP2_LIBRARIES} ${PNG_LIBRARIES} ${X11_LIBRARIES} + ${GETTEXT_LIBRARIES} ${PLATFORM_LIBS} ${CLIENT_PLATFORM_LIBS} jthread @@ -208,6 +218,10 @@ else() set(ARCH i386) endif() + if(WIN32) + set(CMAKE_EXE_LINKER_FLAGS "-lintl -L ${GETTEXT_BIN_DIR}") + endif() + set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${RELEASE_WARNING_FLAGS} ${WARNING_FLAGS} -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops") set(CMAKE_CXX_FLAGS_DEBUG "-g -O1 -Wall ${WARNING_FLAGS}") @@ -239,6 +253,8 @@ if(BUILD_CLIENT) install(FILES ${images} DESTINATION ${DATADIR}) + install(FILES ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo DESTINATION locale/de/LC_MESSAGES) + if(WIN32) if(DEFINED IRRLICHT_DLL) install(FILES ${IRRLICHT_DLL} DESTINATION ${BINDIR}) @@ -246,6 +262,10 @@ if(BUILD_CLIENT) if(DEFINED ZLIB_DLL) install(FILES ${ZLIB_DLL} DESTINATION ${BINDIR}) endif() + if(DEFINED GETTEXT_BIN_DIR) + install(FILES ${GETTEXT_BIN_DIR}/libintl3.dll DESTINATION ${BINDIR}) + install(FILES ${GETTEXT_BIN_DIR}/libiconv2.dll DESTINATION ${BINDIR}) + endif() endif() endif(BUILD_CLIENT) @@ -253,6 +273,27 @@ if(BUILD_SERVER) install(TARGETS minetestserver DESTINATION ${BINDIR}) endif(BUILD_SERVER) +if(WIN32) + set(GETTEXT_MSGFMT "${GETTEXT_BIN_DIR}/msgfmt" CACHE FILEPATH "path to msgfmt") +elseif(APPLE) + set(GETTEXT_MSGFMT "${GETTEXT_BIN_DIR}/msgfmt" CACHE FILEPATH "path to msgfmt") +else() + set(GETTEXT_MSGFMT "msgfmt") +endif() + +add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMENT "mo-update [de]: Creating locale directory.") + +add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo + COMMAND ${GETTEXT_MSGFMT} -o ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo ${CMAKE_SOURCE_DIR}/po/de/minetest-c55.po + DEPENDS + ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES + ${CMAKE_SOURCE_DIR}/po/de/minetest-c55.po + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/po/de + COMMENT "mo-update [de]: Creating mo file." + ) +add_custom_target(translation_de ALL COMMENT "mo update [de]" DEPENDS ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo) + # Subdirectories add_subdirectory(jthread) diff --git a/src/gettext.h b/src/gettext.h new file mode 100644 index 0000000..7f5f56e --- /dev/null +++ b/src/gettext.h @@ -0,0 +1,12 @@ +#include +#define _(String) gettext(String) +#define gettext_noop(String) String +#define N_(String) gettext_noop (String) + +inline wchar_t* chartowchar_t(char *str) +{ + size_t l = strlen(str)+1; + wchar_t* nstr = new wchar_t[l]; + mbstowcs(nstr, str, l); + return nstr; +} diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp index cea3286..f557f4d 100644 --- a/src/guiMainMenu.cpp +++ b/src/guiMainMenu.cpp @@ -25,6 +25,8 @@ with this program; if not, write to the Free Software Foundation, Inc., +#include "gettext.h" + GUIMainMenu::GUIMainMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent, s32 id, IMenuManager *menumgr, @@ -175,8 +177,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, 50+6); - const wchar_t *text = L"Name/Password"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Name/Password")), rect, false, true, this, -1); } { core::rect rect(0, 0, 230, 30); @@ -198,8 +199,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, 100+6); - const wchar_t *text = L"Address/Port"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Address/Port")), rect, false, true, this, -1); } { core::rect rect(0, 0, 230, 30); @@ -217,28 +217,26 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) } { core::rect rect(0, 0, 400, 20); - rect += topleft_client + v2s32(160, 100+35); - const wchar_t *text = L"Leave address blank to start a local server."; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Leave address blank to start a local server.")), rect, false, true, this, -1); } { core::rect rect(0, 0, 250, 30); rect += topleft_client + v2s32(35, 150); Environment->addCheckBox(fancy_trees, rect, this, GUI_ID_FANCYTREE_CB, - L"Fancy trees"); + chartowchar_t(gettext("Fancy trees"))); } { core::rect rect(0, 0, 250, 30); rect += topleft_client + v2s32(35, 150+30); Environment->addCheckBox(smooth_lighting, rect, this, GUI_ID_SMOOTH_LIGHTING_CB, - L"Smooth Lighting"); + chartowchar_t(gettext("Smooth Lighting"))); } // Start game button { core::rect rect(0, 0, 180, 30); //rect += topleft_client + v2s32(size_client.X/2-180/2, 225-30/2); rect += topleft_client + v2s32(size_client.X-180-40, 150+25); - Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON, L"Start Game / Connect"); + Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON, chartowchar_t(gettext("Start Game / Connect"))); } // Key change button @@ -246,7 +244,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 100, 30); //rect += topleft_client + v2s32(size_client.X/2-180/2, 225-30/2); rect += topleft_client + v2s32(size_client.X-180-40-100-20, 150+25); - Environment->addButton(rect, this, GUI_ID_CHANGE_KEYS_BUTTON, L"Change keys"); + Environment->addButton(rect, this, GUI_ID_CHANGE_KEYS_BUTTON, chartowchar_t(gettext("Change keys"))); } /* Server section @@ -268,19 +266,19 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 250, 30); rect += topleft_server + v2s32(35, 30); - Environment->addCheckBox(creative_mode, rect, this, GUI_ID_CREATIVE_CB, L"Creative Mode"); + Environment->addCheckBox(creative_mode, rect, this, GUI_ID_CREATIVE_CB, chartowchar_t(gettext("Creative Mode"))); } { core::rect rect(0, 0, 250, 30); rect += topleft_server + v2s32(35, 60); - Environment->addCheckBox(enable_damage, rect, this, GUI_ID_DAMAGE_CB, L"Enable Damage"); + Environment->addCheckBox(enable_damage, rect, this, GUI_ID_DAMAGE_CB, chartowchar_t(gettext("Enable Damage"))); } // Map delete button { core::rect rect(0, 0, 130, 30); //rect += topleft_server + v2s32(size_server.X-40-130, 100+25); rect += topleft_server + v2s32(40, 100+25); - Environment->addButton(rect, this, GUI_ID_DELETE_MAP_BUTTON, L"Delete map"); + Environment->addButton(rect, this, GUI_ID_DELETE_MAP_BUTTON, chartowchar_t(gettext("Delete map"))); } } diff --git a/src/guiMessageMenu.cpp b/src/guiMessageMenu.cpp index 1929113..e4e582a 100644 --- a/src/guiMessageMenu.cpp +++ b/src/guiMessageMenu.cpp @@ -22,6 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "serialization.h" #include +#include "gettext.h" + GUIMessageMenu::GUIMessageMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent, s32 id, IMenuManager *menumgr, @@ -87,7 +89,7 @@ void GUIMessageMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25); gui::IGUIElement *e = - Environment->addButton(rect, this, 257, L"Proceed"); + Environment->addButton(rect, this, 257, chartowchar_t(gettext("Proceed"))); Environment->setFocus(e); } } diff --git a/src/guiPasswordChange.cpp b/src/guiPasswordChange.cpp index ec1cd02..79601a9 100644 --- a/src/guiPasswordChange.cpp +++ b/src/guiPasswordChange.cpp @@ -21,6 +21,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "serialization.h" #include +#include "gettext.h" + const int ID_oldPassword = 256; const int ID_newPassword1 = 257; const int ID_newPassword2 = 258; @@ -97,8 +99,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - const wchar_t *text = L"Old Password"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Old Password")), rect, false, true, this, -1); } { core::rect rect(0, 0, 230, 30); @@ -112,8 +113,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - const wchar_t *text = L"New Password"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("New Password")), rect, false, true, this, -1); } { core::rect rect(0, 0, 230, 30); @@ -126,8 +126,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - const wchar_t *text = L"Confirm Password"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Confirm Password")), rect, false, true, this, -1); } { core::rect rect(0, 0, 230, 30); @@ -141,16 +140,15 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, ypos); - Environment->addButton(rect, this, ID_change, L"Change"); + Environment->addButton(rect, this, ID_change, chartowchar_t(gettext("Change"))); } ypos += 50; { core::rect rect(0, 0, 300, 20); rect += topleft_client + v2s32(35, ypos); - const wchar_t *text = L"Passwords do not match!"; IGUIElement *e = - Environment->addStaticText(text, rect, false, true, this, ID_message); + Environment->addStaticText(chartowchar_t(gettext("Passwords do not match!")), rect, false, true, this, ID_message); e->setVisible(false); } diff --git a/src/guiPauseMenu.cpp b/src/guiPauseMenu.cpp index 1a885a6..5f40a48 100644 --- a/src/guiPauseMenu.cpp +++ b/src/guiPauseMenu.cpp @@ -24,6 +24,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "config.h" #include "main.h" +#include "gettext.h" + GUIPauseMenu::GUIPauseMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent, s32 id, IGameCallback *gamecallback, @@ -104,43 +106,43 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); - Environment->addButton(rect, this, 256, L"Continue"); + Environment->addButton(rect, this, 256, chartowchar_t(gettext("Continue"))); } btn_y += btn_height + btn_gap; { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); - Environment->addButton(rect, this, 261, L"Change Password"); + Environment->addButton(rect, this, 261, chartowchar_t(gettext("Change Password"))); } btn_y += btn_height + btn_gap; { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); - Environment->addButton(rect, this, 260, L"Disconnect"); + Environment->addButton(rect, this, 260, chartowchar_t(gettext("Disconnect"))); } btn_y += btn_height + btn_gap; { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); - Environment->addButton(rect, this, 257, L"Exit to OS"); + Environment->addButton(rect, this, 257, chartowchar_t(gettext("Exit to OS"))); } { core::rect rect(0, 0, 180, 240); rect = rect + v2s32(size.X/2 + 90, size.Y/2-rect.getHeight()/2); - const wchar_t *text = - L"Keys:\n" - L"- WASD: Walk\n" - L"- Mouse left: dig blocks\n" - L"- Mouse right: place blocks\n" - L"- Mouse wheel: select item\n" - L"- 0...9: select item\n" - L"- Shift: sneak\n" - L"- R: Toggle viewing all loaded chunks\n" - L"- I: Inventory menu\n" - L"- ESC: This menu\n" - L"- T: Chat\n"; - Environment->addStaticText(text, rect, false, true, this, 258); + Environment->addStaticText(chartowchar_t(gettext( + "Keys:\n" + "- WASD: Walk\n" + "- Mouse left: dig blocks\n" + "- Mouse right: place blocks\n" + "- Mouse wheel: select item\n" + "- 0...9: select item\n" + "- Shift: sneak\n" + "- R: Toggle viewing all loaded chunks\n" + "- I: Inventory menu\n" + "- ESC: This menu\n" + "- T: Chat\n" + )), rect, false, true, this, 258); } { core::rect rect(0, 0, 180, 220); diff --git a/src/guiTextInputMenu.cpp b/src/guiTextInputMenu.cpp index 2cb8cae..b15f8bc 100644 --- a/src/guiTextInputMenu.cpp +++ b/src/guiTextInputMenu.cpp @@ -22,6 +22,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "serialization.h" #include +#include "gettext.h" + GUITextInputMenu::GUITextInputMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent, s32 id, IMenuManager *menumgr, @@ -105,7 +107,7 @@ void GUITextInputMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25); - Environment->addButton(rect, this, 257, L"Proceed"); + Environment->addButton(rect, this, 257, chartowchar_t(gettext("Proceed"))); } } diff --git a/src/main.cpp b/src/main.cpp index 698c5fc..1cc479d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -401,6 +401,8 @@ Doing currently: #include "keycode.h" #include "tile.h" +#include "gettext.h" + // This makes textures ITextureSource *g_texturesource = NULL; @@ -1058,6 +1060,9 @@ int main(int argc, char *argv[]) std::locale::global(std::locale("C")); // This enables printing all characters in bitmap font setlocale(LC_CTYPE, "en_US"); + setlocale(LC_ALL, ""); + bindtextdomain("minetest-c55", "./../locale"); + textdomain("minetest-c55"); /* Parse command line diff --git a/updatelocales.sh b/updatelocales.sh new file mode 100644 index 0000000..1ac4234 --- /dev/null +++ b/updatelocales.sh @@ -0,0 +1,4 @@ +#! /bin/bash +xgettext -n -o minetest-c55.pot ./src/*.cpp ./src/*.h +msgmerge -U ./po/de/minetest-c55.po minetest-c55.pot +rm minetest-c55.pot From a006b828a672083e1f81dc599f1a8f5f11d50768 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Wed, 20 Jul 2011 17:00:54 +0200 Subject: [PATCH 069/158] updated german po file for minetest-delta (prior it was for minetest) set +x on bashscript --- po/de/minetest-c55.po | 30 +++++++++++++++++------------- updatelocales.sh | 0 2 files changed, 17 insertions(+), 13 deletions(-) mode change 100644 => 100755 updatelocales.sh diff --git a/po/de/minetest-c55.po b/po/de/minetest-c55.po index 58c977f..c5ec1c7 100644 --- a/po/de/minetest-c55.po +++ b/po/de/minetest-c55.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: 0.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-20 16:03+0200\n" -"PO-Revision-Date: 2011-07-20 16:04+0100\n" +"POT-Creation-Date: 2011-07-20 16:57+0200\n" +"PO-Revision-Date: 2011-07-20 16:58+0100\n" "Last-Translator: Constantin Wenger \n" "Language-Team: Deutsch <>\n" "Language: de\n" @@ -17,41 +17,45 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n" -#: src/guiMainMenu.cpp:173 +#: src/guiMainMenu.cpp:180 msgid "Name/Password" msgstr "Name/Passwort" -#: src/guiMainMenu.cpp:195 +#: src/guiMainMenu.cpp:202 msgid "Address/Port" msgstr "Adresse / Port" -#: src/guiMainMenu.cpp:214 +#: src/guiMainMenu.cpp:220 msgid "Leave address blank to start a local server." msgstr "Lasse die Adresse frei um einen eigenen Server zu starten" -#: src/guiMainMenu.cpp:220 +#: src/guiMainMenu.cpp:226 msgid "Fancy trees" msgstr "Schöne Bäume" -#: src/guiMainMenu.cpp:226 +#: src/guiMainMenu.cpp:232 msgid "Smooth Lighting" msgstr "Besseres Licht" -#: src/guiMainMenu.cpp:233 +#: src/guiMainMenu.cpp:239 msgid "Start Game / Connect" msgstr "Spiel starten / Verbinden" -#: src/guiMainMenu.cpp:256 +#: src/guiMainMenu.cpp:247 +msgid "Change keys" +msgstr "Tastenbelegung ändern" + +#: src/guiMainMenu.cpp:269 msgid "Creative Mode" msgstr "Kreativitätsmodus" -#: src/guiMainMenu.cpp:261 +#: src/guiMainMenu.cpp:274 msgid "Enable Damage" msgstr "Schaden einschalten" -#: src/guiMainMenu.cpp:268 -msgid "Delete world" -msgstr "Welt löschen" +#: src/guiMainMenu.cpp:281 +msgid "Delete map" +msgstr "Karte löschen" #: src/guiMessageMenu.cpp:92 #: src/guiTextInputMenu.cpp:110 diff --git a/updatelocales.sh b/updatelocales.sh old mode 100644 new mode 100755 From cd45ae3d0f8da00f0be69dee015e3298acce1367 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 19 Jul 2011 20:02:31 +0200 Subject: [PATCH 070/158] Use system sqlite3/jthread libs if available --- cmake/Modules/FindJthread.cmake | 18 ++++++++++++++++++ cmake/Modules/FindSqlite3.cmake | 18 ++++++++++++++++++ src/CMakeLists.txt | 23 ++++++++++++++++------- 3 files changed, 52 insertions(+), 7 deletions(-) create mode 100644 cmake/Modules/FindJthread.cmake create mode 100644 cmake/Modules/FindSqlite3.cmake 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/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/src/CMakeLists.txt b/src/CMakeLists.txt index fd15914..e1de236 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -43,6 +43,8 @@ else() find_package(JPEG REQUIRED) find_package(BZip2 REQUIRED) find_package(PNG REQUIRED) + find_package(Jthread REQUIRED) + find_package(Sqlite3 REQUIRED) if(APPLE) FIND_LIBRARY(CARBON_LIB Carbon) FIND_LIBRARY(COCOA_LIB Cocoa) @@ -143,8 +145,8 @@ include_directories( ${CMAKE_BUILD_TYPE} ${PNG_INCLUDE_DIR} ${GETTEXT_INCLUDE_DIR} - "${PROJECT_SOURCE_DIR}/jthread" - "${PROJECT_SOURCE_DIR}/sqlite" + ${JTHREAD_INCLUDE_DIR} + ${SQLITE3_INCLUDE_DIR} ) set(EXECUTABLE_OUTPUT_PATH ../bin) @@ -163,8 +165,8 @@ if(BUILD_CLIENT) ${GETTEXT_LIBRARIES} ${PLATFORM_LIBS} ${CLIENT_PLATFORM_LIBS} - jthread - sqlite3 + ${JTHREAD_LIBRARY} + ${SQLITE3_LIBRARY} ) endif(BUILD_CLIENT) @@ -174,8 +176,8 @@ if(BUILD_SERVER) minetestserver ${ZLIB_LIBRARIES} ${PLATFORM_LIBS} - jthread - sqlite3 + ${JTHREAD_LIBRARY} + ${SQLITE3_LIBRARY} ) endif(BUILD_SERVER) @@ -296,7 +298,14 @@ add_custom_target(translation_de ALL COMMENT "mo update [de]" DEPENDS ${CMAKE_BI # Subdirectories -add_subdirectory(jthread) +if (JTHREAD_FOUND) +else (JTHREAD_FOUND) + add_subdirectory(jthread) +endif (JTHREAD_FOUND) + +if (SQLITE3_FOUND) +else (SQLITE3_FOUND) add_subdirectory(sqlite) +endif (SQLITE3_FOUND) #end From bcd3e1af2f2d2f29ca739ee138ef72357b5b7b3a Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Wed, 8 Jun 2011 17:27:30 +0200 Subject: [PATCH 071/158] Check the data path before usage When not running in place, check if the assumed data path in ../share/APPNAME exists. If it doesn't exist, fall back to ../data instead. This allows the program to run successfully from the checkout directory even without the run-in-place flag active. --- src/porting.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/porting.cpp b/src/porting.cpp index 7de042a..ff8cb38 100644 --- a/src/porting.cpp +++ b/src/porting.cpp @@ -26,6 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "porting.h" #include "config.h" #include "debug.h" +#include "filesys.h" #ifdef __APPLE__ #include "CoreFoundation/CoreFoundation.h" @@ -210,6 +211,11 @@ void initializePaths() path_data = std::string(buf) + "/../share/" + APPNAME; //path_data = std::string(INSTALL_PREFIX) + "/share/" + APPNAME; + if (!fs::PathExists(path_data)) { + dstream<<"WARNING: data path " << path_data << " not found!"; + path_data = std::string(buf) + "/../data"; + dstream<<" Trying " << path_data << std::endl; + } path_userdata = std::string(getenv("HOME")) + "/." + APPNAME; From 3fb5b7a3bd95eb6327c6894072739a7c28c711ce Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 9 Jun 2011 22:31:40 +0200 Subject: [PATCH 072/158] Set the window caption for the initial window too --- src/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 1cc479d..7d0ea12 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1350,6 +1350,9 @@ int main(int argc, char *argv[]) // Set device in game parameters device = device; + + // Set the window caption + device->setWindowCaption(L"Minetest [Main Menu]"); // Create time getter g_timegetter = new IrrlichtTimeGetter(device); From 4d43a674190767cd85288b48737f97e94854e6f4 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Wed, 20 Jul 2011 18:49:18 +0200 Subject: [PATCH 073/158] fixed problem with wront paths in gettext --- src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 1cc479d..00248a2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1060,10 +1060,6 @@ int main(int argc, char *argv[]) std::locale::global(std::locale("C")); // This enables printing all characters in bitmap font setlocale(LC_CTYPE, "en_US"); - setlocale(LC_ALL, ""); - bindtextdomain("minetest-c55", "./../locale"); - textdomain("minetest-c55"); - /* Parse command line */ @@ -1135,6 +1131,10 @@ int main(int argc, char *argv[]) // Create user data directory fs::CreateDir(porting::path_userdata); + + setlocale(LC_ALL, ""); + bindtextdomain("minetest-c55", (porting::path_userdata+"/locale").c_str()); + textdomain("minetest-c55"); // Initialize debug streams #ifdef RUN_IN_PLACE From 4c0e36a5e9c76af6e5db1d739275f41f079d19d4 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 20 Jul 2011 19:14:40 +0200 Subject: [PATCH 074/158] * README updated --- README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README b/README index 65a2881..e03bdae 100644 --- a/README +++ b/README @@ -5,6 +5,8 @@ New features: * configurable far mesh tree display (boolean) * configurable far mesh rendering distance * volumetric clouds (using fake shading) +* translation support (including questionable translation into german) +* build system uses local jthread & sqlite libraries if available New bricks: * Sandstone (crafted from 4 sand, yields sand) From 84684e53edcf319f1aebd69b003ae016173dc485 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 20 Jul 2011 22:04:24 +0200 Subject: [PATCH 075/158] + fireflies --- data/firefly.png | Bin 0 -> 150 bytes src/content_cao.cpp | 157 ++++++++++++++++++++++++++++++++++ src/content_cao.h | 42 +++++++++ src/content_inventory.cpp | 9 +- src/content_object.h | 1 + src/content_sao.cpp | 175 ++++++++++++++++++++++++++++++++++++++ src/content_sao.h | 24 ++++++ src/environment.cpp | 3 +- 8 files changed, 409 insertions(+), 2 deletions(-) create mode 100644 data/firefly.png diff --git a/data/firefly.png b/data/firefly.png new file mode 100644 index 0000000000000000000000000000000000000000..d5a444b039f45e3bc76e692ed15b258357aa3047 GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|0z6$DLnJOI z>&&XZH>0t!aiRXj4?4_34V}i0KW7;*rg*Xef!d05uX%tVf4#w<`s&t)_C7*KuWS#O t`1il^<^TWZz3W9>eR!5IlxVMDX6SgU#+aC8egSAUgQu&X%Q~loCIFMSF>n9? literal 0 HcmV?d00001 diff --git a/src/content_cao.cpp b/src/content_cao.cpp index dc5ac40..dfeaea8 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -752,4 +752,161 @@ void Oerkki1CAO::initialize(const std::string &data) updateNodePos(); } +/* + FireflyCAO +*/ +// Prototype +FireflyCAO proto_FireflyCAO; + +FireflyCAO::FireflyCAO(): + ClientActiveObject(0), + m_selection_box(-BS/3.,0.0,-BS/3., BS/3.,BS/2.,BS/3.), + m_node(NULL), + m_position(v3f(0,10*BS,0)), + m_yaw(0) +{ + ClientActiveObject::registerType(getType(), create); +} + +FireflyCAO::~FireflyCAO() +{ +} + +ClientActiveObject* FireflyCAO::create() +{ + return new FireflyCAO(); +} + +void FireflyCAO::addToScene(scene::ISceneManager *smgr) +{ + if(m_node != NULL) + return; + + video::IVideoDriver* driver = smgr->getVideoDriver(); + + scene::SMesh *mesh = new scene::SMesh(); + scene::IMeshBuffer *buf = new scene::SMeshBuffer(); + video::SColor c(255,255,255,255); + video::S3DVertex vertices[4] = + { + video::S3DVertex(0,0,0, 0,0,0, c, 0,1), + video::S3DVertex(BS/2,0,0, 0,0,0, c, 1,1), + video::S3DVertex(BS/2,BS/2,0, 0,0,0, c, 1,0), + video::S3DVertex(0,BS/2,0, 0,0,0, c, 0,0), + }; + u16 indices[] = {0,1,2,2,3,0}; + buf->append(vertices, 4, indices, 6); + // Set material + buf->getMaterial().setFlag(video::EMF_LIGHTING, false); + buf->getMaterial().setFlag(video::EMF_BACK_FACE_CULLING, false); + //buf->getMaterial().setTexture(0, NULL); + buf->getMaterial().setTexture + (0, driver->getTexture(getTexturePath("firefly.png").c_str())); + buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, false); + buf->getMaterial().setFlag(video::EMF_FOG_ENABLE, true); + buf->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; + // Add to mesh + mesh->addMeshBuffer(buf); + buf->drop(); + m_node = smgr->addMeshSceneNode(mesh, NULL); + mesh->drop(); + // Set it to use the materials of the meshbuffers directly. + // This is needed for changing the texture in the future + m_node->setReadOnlyMaterials(true); + updateNodePos(); +} + +void FireflyCAO::removeFromScene() +{ + if(m_node == NULL) + return; + + m_node->remove(); + m_node = NULL; +} + +void FireflyCAO::updateLight(u8 light_at_pos) +{ + if(m_node == NULL) + return; + + u8 li = 255; + video::SColor color(255,li,li,li); + + scene::IMesh *mesh = m_node->getMesh(); + if(mesh == NULL) + return; + + u16 mc = mesh->getMeshBufferCount(); + for(u16 j=0; jgetMeshBuffer(j); + video::S3DVertex *vertices = (video::S3DVertex*)buf->getVertices(); + u16 vc = buf->getVertexCount(); + for(u16 i=0; isetPosition(m_position); + m_node->setPosition(pos_translator.vect_show); + + v3f rot = m_node->getRotation(); + rot.Y = 180.0 - m_yaw; + m_node->setRotation(rot); +} + +void FireflyCAO::step(float dtime, ClientEnvironment *env) +{ + pos_translator.translate(dtime); + updateNodePos(); +} + +void FireflyCAO::processMessage(const std::string &data) +{ + //dstream<<"FireflyCAO: Got message"<* getSelectionBox() + {return &m_selection_box;} + v3f getPosition() + {return m_position;} + +private: + core::aabbox3d m_selection_box; + scene::IMeshSceneNode *m_node; + v3f m_position; + float m_yaw; + SmoothTranslator pos_translator; +}; + #endif diff --git a/src/content_inventory.cpp b/src/content_inventory.cpp index 7d995cb..1068def 100644 --- a/src/content_inventory.cpp +++ b/src/content_inventory.cpp @@ -65,6 +65,8 @@ std::string item_craft_get_image_name(const std::string &subname) return "clay_brick.png"; else if(subname == "rat") return "rat.png"; + else if(subname == "firefly") + return "firefly.png"; else return "cloud.png"; // just something } @@ -77,13 +79,18 @@ ServerActiveObject* item_craft_create_object(const std::string &subname, ServerActiveObject *obj = new RatSAO(env, id, pos); return obj; } + else if(subname == "firefly") + { + ServerActiveObject *obj = new FireflySAO(env, id, pos); + return obj; + } return NULL; } s16 item_craft_get_drop_count(const std::string &subname) { - if(subname == "rat") + if(subname == "rat" || subname == "firefly") return 1; return -1; diff --git a/src/content_object.h b/src/content_object.h index ecabd8a..47f93d7 100644 --- a/src/content_object.h +++ b/src/content_object.h @@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #define ACTIVEOBJECT_TYPE_ITEM 2 #define ACTIVEOBJECT_TYPE_RAT 3 #define ACTIVEOBJECT_TYPE_OERKKI1 4 +#define ACTIVEOBJECT_TYPE_FIREFLY 5 #endif diff --git a/src/content_sao.cpp b/src/content_sao.cpp index c41f4ed..aeeafc2 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -693,4 +693,179 @@ void Oerkki1SAO::doDamage(u16 d) } } +/* + FireflySAO +*/ +// Prototype +FireflySAO proto_FireflySAO(NULL, 0, v3f(0,0,0)); + +FireflySAO::FireflySAO(ServerEnvironment *env, u16 id, v3f pos): + ServerActiveObject(env, id, pos), + m_is_active(false), + m_speed_f(0,0,0) +{ + ServerActiveObject::registerType(getType(), create); + + m_oldpos = v3f(0,0,0); + m_last_sent_position = v3f(0,0,0); + m_yaw = 0; + m_counter1 = 0; + m_counter2 = 0; + m_age = 0; + m_touching_ground = false; +} + +ServerActiveObject* FireflySAO::create(ServerEnvironment *env, u16 id, v3f pos, + const std::string &data) +{ + std::istringstream is(data, std::ios::binary); + char buf[1]; + // read version + is.read(buf, 1); + u8 version = buf[0]; + // check if version is supported + if(version != 0) + return NULL; + return new FireflySAO(env, id, pos); +} + +void FireflySAO::step(float dtime, bool send_recommended) +{ + assert(m_env); + + if(m_is_active == false) + { + if(m_inactive_interval.step(dtime, 0.5)==false) + return; + } + + /* + The AI + */ + + // Apply (less) gravity + m_speed_f.Y -= dtime*3*BS; + + /* + Move around if some player is close + */ + bool player_is_close = false; + // Check connected players + core::list players = m_env->getPlayers(true); + core::list::Iterator i; + for(i = players.begin(); + i != players.end(); i++) + { + Player *player = *i; + v3f playerpos = player->getPosition(); + if(m_base_position.getDistanceFrom(playerpos) < BS*10.0) + { + player_is_close = true; + break; + } + } + + m_is_active = player_is_close; + + if(player_is_close == false) + { + m_speed_f.X = 0; + m_speed_f.Z = 0; + } + else + { + // Move around + v3f dir(cos(m_yaw/180*PI),0,sin(m_yaw/180*PI)); + f32 speed = BS/2; + m_speed_f.X = speed * dir.X; + m_speed_f.Z = speed * dir.Z; + + if(m_touching_ground && (m_oldpos - m_base_position).getLength() + < dtime*speed/2) + { + m_counter1 -= dtime; + if(m_counter1 < 0.0) + { + m_counter1 += 1.0; + m_speed_f.Y = 5.0*BS; + } + } + + { + m_counter2 -= dtime; + if(m_counter2 < 0.0) + { + m_counter2 += (float)(myrand()%100)/100*3.0; + m_yaw += ((float)(myrand()%200)-100)/100*180; + m_yaw = wrapDegrees(m_yaw); + } + } + } + + m_oldpos = m_base_position; + + /* + Move it, with collision detection + */ + + core::aabbox3d box(-BS/3.,0.0,-BS/3., BS/3.,BS*2./3.,BS/3.); + collisionMoveResult moveresult; + // Maximum movement without glitches + f32 pos_max_d = BS*0.25; + // Limit speed + if(m_speed_f.getLength()*dtime > pos_max_d) + m_speed_f *= pos_max_d / (m_speed_f.getLength()*dtime); + v3f pos_f = getBasePosition(); + v3f pos_f_old = pos_f; + moveresult = collisionMoveSimple(&m_env->getMap(), pos_max_d, + box, dtime, pos_f, m_speed_f); + m_touching_ground = moveresult.touching_ground; + + setBasePosition(pos_f); + + if(send_recommended == false) + return; + + if(pos_f.getDistanceFrom(m_last_sent_position) > 0.05*BS) + { + m_last_sent_position = pos_f; + + std::ostringstream os(std::ios::binary); + // command (0 = update position) + writeU8(os, 0); + // pos + writeV3F1000(os, m_base_position); + // yaw + writeF1000(os, m_yaw); + // create message and add to list + ActiveObjectMessage aom(getId(), false, os.str()); + m_messages_out.push_back(aom); + } +} + +std::string FireflySAO::getClientInitializationData() +{ + std::ostringstream os(std::ios::binary); + // version + writeU8(os, 0); + // pos + writeV3F1000(os, m_base_position); + return os.str(); +} + +std::string FireflySAO::getStaticData() +{ + //dstream<<__FUNCTION_NAME< Date: Wed, 20 Jul 2011 22:49:48 +0200 Subject: [PATCH 076/158] Move package search out of conditional This unbreaks the Windows build which would otherwise have problems at the jthread level. --- src/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e1de236..72f7997 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -43,8 +43,6 @@ else() find_package(JPEG REQUIRED) find_package(BZip2 REQUIRED) find_package(PNG REQUIRED) - find_package(Jthread REQUIRED) - find_package(Sqlite3 REQUIRED) if(APPLE) FIND_LIBRARY(CARBON_LIB Carbon) FIND_LIBRARY(COCOA_LIB Cocoa) @@ -65,6 +63,9 @@ else() set(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${XXF86VM_LIBRARY}) endif() +find_package(Jthread REQUIRED) +find_package(Sqlite3 REQUIRED) + configure_file( "${PROJECT_SOURCE_DIR}/cmake_config.h.in" "${PROJECT_BINARY_DIR}/cmake_config.h" From a19491dbd21b7c58b8ed3016540aec884a7e9c3b Mon Sep 17 00:00:00 2001 From: Weedy Date: Thu, 21 Jul 2011 02:30:21 -0400 Subject: [PATCH 077/158] Fix win32 MSVC compile. (screw gettext) --- src/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 72f7997..a578eeb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -31,8 +31,8 @@ if(WIN32) CACHE PATH "gettext include directory") set(GETTEXT_BIN_DIR "${PROJECT_SOURCE_DIR}/../../gettext/bin" CACHE PATH "gettext bin directory") - set(GETTEXT_LIBRARIES "${PROJECT_SOURCE_DIR}/../../gettext/lib/intl.lib" - CACHE FILEPATH "gettext intl.lib") + set(GETTEXT_LIBRARIES "${PROJECT_SOURCE_DIR}/../../gettext/lib/libintl.lib" + CACHE FILEPATH "gettext libintl.lib") set(IRRLICHT_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../irrlicht-1.7.2" CACHE PATH "irrlicht dir") else() @@ -277,7 +277,7 @@ if(BUILD_SERVER) endif(BUILD_SERVER) if(WIN32) - set(GETTEXT_MSGFMT "${GETTEXT_BIN_DIR}/msgfmt" CACHE FILEPATH "path to msgfmt") + set(GETTEXT_MSGFMT "${GETTEXT_BIN_DIR}/msgfmt.exe" CACHE FILEPATH "path to msgfmt") elseif(APPLE) set(GETTEXT_MSGFMT "${GETTEXT_BIN_DIR}/msgfmt" CACHE FILEPATH "path to msgfmt") else() From 89b8b792c182fe4fc56f1e7072abc4c4fa9694c7 Mon Sep 17 00:00:00 2001 From: Weedy Date: Thu, 21 Jul 2011 02:36:30 -0400 Subject: [PATCH 078/158] Tweak makefiles to add -delta suffix. --- CMakeLists.txt | 16 ++++++++-------- makepackage_binary.sh | 10 +++++++--- src/CMakeLists.txt | 26 +++++++++++++------------- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15f4a64..aae390f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,11 +5,11 @@ if(${CMAKE_VERSION} STREQUAL "2.8.2") endif(${CMAKE_VERSION} STREQUAL "2.8.2") # This can be read from ${PROJECT_NAME} after project() is called -project(minetest) +project(minetest-delta) set(VERSION_MAJOR 0) set(VERSION_MINOR 2) -set(VERSION_PATCH 20110704_0) +set(VERSION_PATCH 20110720_0) set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") # Configuration options @@ -48,15 +48,15 @@ if(WIN32) set(EXAMPLE_CONF_DIR ".") elseif(APPLE) # random placeholders - set(DATADIR "share/minetest") + set(DATADIR "share/${PROJECT_NAME}") set(BINDIR "bin") - set(DOCDIR "share/doc/minetest") + set(DOCDIR "share/doc/${PROJECT_NAME}") set(EXAMPLE_CONF_DIR ".") elseif(UNIX) # Linux, BSD etc - set(DATADIR "share/minetest") + set(DATADIR "share/${PROJECT_NAME}") set(BINDIR "bin") - set(DOCDIR "share/doc/minetest") - set(EXAMPLE_CONF_DIR "share/doc/minetest") + set(DOCDIR "share/doc/${PROJECT_NAME}") + set(EXAMPLE_CONF_DIR "share/doc/${PROJECT_NAME}") endif() install(FILES "doc/README.txt" DESTINATION "${DOCDIR}") @@ -103,7 +103,7 @@ elseif(APPLE) set(CPACK_BUNDLE_NAME ${PROJECT_NAME}) set(CPACK_BUNDLE_ICON "") set(CPACK_BUNDLE_PLIST "") - set(CPACK_BUNDLE_STARTUP_COMMAND "Contents/MacOS/minetest") + set(CPACK_BUNDLE_STARTUP_COMMAND "Contents/MacOS/${PROJECT_NAME}") set(CPACK_GENERATOR "Bundle") else() set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-linux") diff --git a/makepackage_binary.sh b/makepackage_binary.sh index f00ec60..32d1986 100755 --- a/makepackage_binary.sh +++ b/makepackage_binary.sh @@ -1,17 +1,19 @@ #!/bin/sh -PACKAGEDIR=../minetest-packages -PACKAGENAME=minetest-c55-binary-`date +%y%m%d%H%M%S` +PROJECT_NAME=minetest-delta +PACKAGEDIR=../$PROJECT_NAME-packages +PACKAGENAME=$PROJECT_NAME-binary-`date +%y%m%d%H%M%S` PACKAGEPATH=$PACKAGEDIR/$PACKAGENAME mkdir -p $PACKAGEPATH mkdir -p $PACKAGEPATH/bin mkdir -p $PACKAGEPATH/data mkdir -p $PACKAGEPATH/doc +mkdir -p $PACKAGEPATH/locale/de/LC_MESSAGES/ cp minetest.conf.example $PACKAGEPATH/ -cp bin/minetest.exe $PACKAGEPATH/bin/ +cp bin/$PROJECT_NAME.exe $PACKAGEPATH/bin/ cp bin/Irrlicht.dll $PACKAGEPATH/bin/ cp bin/zlibwapi.dll $PACKAGEPATH/bin/ #cp bin/test $PACKAGEPATH/bin/ @@ -57,6 +59,8 @@ cp -r data/sand.png $PACKAGEPATH/data/ cp -r doc/README.txt $PACKAGEPATH/doc/README.txt +cp -r locale/de/LC_MESSAGES/$PROJECT_NAME.mo $PACKAGEPATH/locale/de/LC_MESSAGES/ + cd $PACKAGEDIR rm $PACKAGENAME.zip zip -r $PACKAGENAME.zip $PACKAGENAME diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a578eeb..2e99ec0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -project(minetest) +project(minetest-delta) cmake_minimum_required( VERSION 2.6 ) if(RUN_IN_PLACE) @@ -153,9 +153,9 @@ include_directories( set(EXECUTABLE_OUTPUT_PATH ../bin) if(BUILD_CLIENT) - add_executable(minetest ${minetest_SRCS}) + add_executable(${PROJECT_NAME} ${minetest_SRCS}) target_link_libraries( - minetest + ${PROJECT_NAME} ${ZLIB_LIBRARIES} ${IRRLICHT_LIBRARY} ${OPENGL_LIBRARIES} @@ -172,9 +172,9 @@ if(BUILD_CLIENT) endif(BUILD_CLIENT) if(BUILD_SERVER) - add_executable(minetestserver ${minetestserver_SRCS}) + add_executable(${PROJECT_NAME}server ${minetestserver_SRCS}) target_link_libraries( - minetestserver + ${PROJECT_NAME}server ${ZLIB_LIBRARIES} ${PLATFORM_LIBS} ${JTHREAD_LIBRARY} @@ -199,7 +199,7 @@ if(MSVC) set(CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Ob0 /Od /RTC1") if(BUILD_SERVER) - set_target_properties(minetestserver PROPERTIES + set_target_properties(${PROJECT_NAME}server PROPERTIES COMPILE_DEFINITIONS "SERVER") endif(BUILD_SERVER) @@ -233,7 +233,7 @@ else() endif() if(BUILD_SERVER) - set_target_properties(minetestserver PROPERTIES + set_target_properties(${PROJECT_NAME}server PROPERTIES COMPILE_DEFINITIONS "SERVER") endif(BUILD_SERVER) @@ -250,13 +250,13 @@ endif() install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../minetest.conf.example" DESTINATION ${EXAMPLE_CONF_DIR}) if(BUILD_CLIENT) - install(TARGETS minetest DESTINATION ${BINDIR}) + install(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR}) file(GLOB images "${CMAKE_CURRENT_SOURCE_DIR}/../data/*.png") install(FILES ${images} DESTINATION ${DATADIR}) - install(FILES ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo DESTINATION locale/de/LC_MESSAGES) + install(FILES ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo DESTINATION locale/de/LC_MESSAGES) if(WIN32) if(DEFINED IRRLICHT_DLL) @@ -273,7 +273,7 @@ if(BUILD_CLIENT) endif(BUILD_CLIENT) if(BUILD_SERVER) - install(TARGETS minetestserver DESTINATION ${BINDIR}) + install(TARGETS ${PROJECT_NAME}server DESTINATION ${BINDIR}) endif(BUILD_SERVER) if(WIN32) @@ -287,15 +287,15 @@ endif() add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMENT "mo-update [de]: Creating locale directory.") add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo - COMMAND ${GETTEXT_MSGFMT} -o ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo ${CMAKE_SOURCE_DIR}/po/de/minetest-c55.po + OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo + COMMAND ${GETTEXT_MSGFMT} -o ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo ${CMAKE_SOURCE_DIR}/po/de/minetest-c55.po DEPENDS ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES ${CMAKE_SOURCE_DIR}/po/de/minetest-c55.po WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/po/de COMMENT "mo-update [de]: Creating mo file." ) -add_custom_target(translation_de ALL COMMENT "mo update [de]" DEPENDS ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo) +add_custom_target(translation_de ALL COMMENT "mo update [de]" DEPENDS ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo) # Subdirectories From 89af509d100e4f2faf5ebcaa3a236ed685835685 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 21 Jul 2011 07:53:13 +0200 Subject: [PATCH 079/158] Make gettext optional --- src/CMakeLists.txt | 66 ++++++++++++++++++++++++++++------------------ src/gettext.h | 9 ++++++- 2 files changed, 48 insertions(+), 27 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2e99ec0..fb8f419 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,6 +5,16 @@ if(RUN_IN_PLACE) add_definitions ( -DRUN_IN_PLACE ) endif(RUN_IN_PLACE) +if(USE_GETTEXT) + add_definitions( -DUSE_GETTEXT ) + message(STATUS "GetText enabled") +else() + set(GETTEXT_INCLUDE_DIR "") + set(GETTEXT_BIN_DIR "") + set(GETTEXT_LIBRARIES "") + message(STATUS "GetText disabled") +endif(USE_GETTEXT) + if(NOT MSVC) set(USE_GPROF 0 CACHE BOOL "Use -pg flag for g++") endif() @@ -27,14 +37,16 @@ if(WIN32) CACHE FILEPATH "Path to zlibwapi.lib") set(ZLIB_DLL "${PROJECT_SOURCE_DIR}/../../zlib125dll/dll32/zlibwapi.dll" CACHE FILEPATH "Path to zlibwapi.dll (for installation)") - set(GETTEXT_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/../../gettext/include" - CACHE PATH "gettext include directory") - set(GETTEXT_BIN_DIR "${PROJECT_SOURCE_DIR}/../../gettext/bin" - CACHE PATH "gettext bin directory") - set(GETTEXT_LIBRARIES "${PROJECT_SOURCE_DIR}/../../gettext/lib/libintl.lib" - CACHE FILEPATH "gettext libintl.lib") set(IRRLICHT_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../irrlicht-1.7.2" CACHE PATH "irrlicht dir") + if (USE_GETTEXT) + set(GETTEXT_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/../../gettext/include" + CACHE PATH "gettext include directory") + set(GETTEXT_BIN_DIR "${PROJECT_SOURCE_DIR}/../../gettext/bin" + CACHE PATH "gettext bin directory") + set(GETTEXT_LIBRARIES "${PROJECT_SOURCE_DIR}/../../gettext/lib/libintl.lib" + CACHE FILEPATH "gettext libintl.lib") + endif(USE_GETTEXT) else() # Unix probably if(BUILD_CLIENT) @@ -221,7 +233,7 @@ else() set(ARCH i386) endif() - if(WIN32) + if(WIN32 AND USE_GETTEXT) set(CMAKE_EXE_LINKER_FLAGS "-lintl -L ${GETTEXT_BIN_DIR}") endif() @@ -265,7 +277,7 @@ if(BUILD_CLIENT) if(DEFINED ZLIB_DLL) install(FILES ${ZLIB_DLL} DESTINATION ${BINDIR}) endif() - if(DEFINED GETTEXT_BIN_DIR) + if(USE_GETTEXT AND DEFINED GETTEXT_BIN_DIR) install(FILES ${GETTEXT_BIN_DIR}/libintl3.dll DESTINATION ${BINDIR}) install(FILES ${GETTEXT_BIN_DIR}/libiconv2.dll DESTINATION ${BINDIR}) endif() @@ -276,26 +288,28 @@ if(BUILD_SERVER) install(TARGETS ${PROJECT_NAME}server DESTINATION ${BINDIR}) endif(BUILD_SERVER) -if(WIN32) - set(GETTEXT_MSGFMT "${GETTEXT_BIN_DIR}/msgfmt.exe" CACHE FILEPATH "path to msgfmt") -elseif(APPLE) - set(GETTEXT_MSGFMT "${GETTEXT_BIN_DIR}/msgfmt" CACHE FILEPATH "path to msgfmt") -else() - set(GETTEXT_MSGFMT "msgfmt") -endif() +if (USE_GETTEXT) + if(WIN32) + set(GETTEXT_MSGFMT "${GETTEXT_BIN_DIR}/msgfmt.exe" CACHE FILEPATH "path to msgfmt") + elseif(APPLE) + set(GETTEXT_MSGFMT "${GETTEXT_BIN_DIR}/msgfmt" CACHE FILEPATH "path to msgfmt") + else() + set(GETTEXT_MSGFMT "msgfmt") + endif() -add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMENT "mo-update [de]: Creating locale directory.") + add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMENT "mo-update [de]: Creating locale directory.") -add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo - COMMAND ${GETTEXT_MSGFMT} -o ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo ${CMAKE_SOURCE_DIR}/po/de/minetest-c55.po - DEPENDS - ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES - ${CMAKE_SOURCE_DIR}/po/de/minetest-c55.po - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/po/de - COMMENT "mo-update [de]: Creating mo file." - ) -add_custom_target(translation_de ALL COMMENT "mo update [de]" DEPENDS ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo) + add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo + COMMAND ${GETTEXT_MSGFMT} -o ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo ${CMAKE_SOURCE_DIR}/po/de/minetest-c55.po + DEPENDS + ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES + ${CMAKE_SOURCE_DIR}/po/de/minetest-c55.po + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/po/de + COMMENT "mo-update [de]: Creating mo file." + ) + add_custom_target(translation_de ALL COMMENT "mo update [de]" DEPENDS ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo) +endif(USE_GETTEXT) # Subdirectories diff --git a/src/gettext.h b/src/gettext.h index 7f5f56e..8ddb953 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -1,9 +1,16 @@ +#ifdef USE_GETTEXT #include +#else +#define gettext(String) String +#define bindtextdomain(domain, dir) /* */ +#define textdomain(domain) /* */ +#endif + #define _(String) gettext(String) #define gettext_noop(String) String #define N_(String) gettext_noop (String) -inline wchar_t* chartowchar_t(char *str) +inline wchar_t* chartowchar_t(const char *str) { size_t l = strlen(str)+1; wchar_t* nstr = new wchar_t[l]; From 1340da7b54721cffff6c546df2f4e2c931cf6377 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 21 Jul 2011 12:33:29 +0200 Subject: [PATCH 080/158] Refactor and clean up gettext management --- cmake/Modules/FindGettextLib.cmake | 48 ++++++++++++++++++++++++++ src/CMakeLists.txt | 54 ++++++++++++++---------------- 2 files changed, 74 insertions(+), 28 deletions(-) create mode 100644 cmake/Modules/FindGettextLib.cmake diff --git a/cmake/Modules/FindGettextLib.cmake b/cmake/Modules/FindGettextLib.cmake new file mode 100644 index 0000000..1ef8997 --- /dev/null +++ b/cmake/Modules/FindGettextLib.cmake @@ -0,0 +1,48 @@ +# 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 +# TODO check the requirements on other BSDs and older Linux +IF (WIN32) + FIND_LIBRARY(GETTEXT_LIBRARY + NAMES libintl.lib intl.lib libintl3.lib intl3.lib + PATHS "${CUSTOM_GETTEXT_PATH}/lib" + DOC "gettext *intl*.lib") + FIND_LIBRARY(GETTEXT_DLL + NAMES libintl.dll intl.dll libintl3.dll intl3.dll + PATHS "${CUSTOM_GETTEXT_PATH}/lib" + DOC "gettext *intl*.dll") + FIND_LIBRARY(GETTEXT_ICONV_DLL + NAMES libiconv2.dll + PATHS "${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) + SET(GETTEXT_FOUND TRUE) + ENDIF(WIN32) +ENDIF() + + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fb8f419..8785a0e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,12 +6,22 @@ if(RUN_IN_PLACE) endif(RUN_IN_PLACE) if(USE_GETTEXT) - add_definitions( -DUSE_GETTEXT ) - message(STATUS "GetText enabled") -else() - set(GETTEXT_INCLUDE_DIR "") - set(GETTEXT_BIN_DIR "") - set(GETTEXT_LIBRARIES "") + find_package(GettextLib REQUIRED) + if (GETTEXT_FOUND) + add_definitions( -DUSE_GETTEXT ) + message(STATUS "gettext include path: ${GETTEXT_INCLUDE_DIR}") + message(STATUS "gettext msgfmt path: ${GETTEXT_MSGFMT}") + if(WIN32) + message(STATUS "gettext library: ${GETTEXT_LIBRARY}") + message(STATUS "gettext dll: ${GETTEXT_DLL}") + message(STATUS "gettext iconv dll: ${GETTEXT_ICONV_DLL}") + endif() + message(STATUS "GetText enabled") + else() + message(ERROR "GetText enabled but not found, disabling") + set(USE_GETTEXT FALSE) + endif(GETTEXT_FOUND) +else(USE_GETTEXT) message(STATUS "GetText disabled") endif(USE_GETTEXT) @@ -39,14 +49,6 @@ if(WIN32) CACHE FILEPATH "Path to zlibwapi.dll (for installation)") set(IRRLICHT_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../irrlicht-1.7.2" CACHE PATH "irrlicht dir") - if (USE_GETTEXT) - set(GETTEXT_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/../../gettext/include" - CACHE PATH "gettext include directory") - set(GETTEXT_BIN_DIR "${PROJECT_SOURCE_DIR}/../../gettext/bin" - CACHE PATH "gettext bin directory") - set(GETTEXT_LIBRARIES "${PROJECT_SOURCE_DIR}/../../gettext/lib/libintl.lib" - CACHE FILEPATH "gettext libintl.lib") - endif(USE_GETTEXT) else() # Unix probably if(BUILD_CLIENT) @@ -175,7 +177,7 @@ if(BUILD_CLIENT) ${BZIP2_LIBRARIES} ${PNG_LIBRARIES} ${X11_LIBRARIES} - ${GETTEXT_LIBRARIES} + ${GETTEXT_LIBRARY} ${PLATFORM_LIBS} ${CLIENT_PLATFORM_LIBS} ${JTHREAD_LIBRARY} @@ -234,7 +236,7 @@ else() endif() if(WIN32 AND USE_GETTEXT) - set(CMAKE_EXE_LINKER_FLAGS "-lintl -L ${GETTEXT_BIN_DIR}") + set(CMAKE_EXE_LINKER_FLAGS "-l${GETTEXT_LIBRARY}") endif() set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${RELEASE_WARNING_FLAGS} ${WARNING_FLAGS} -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops") @@ -277,10 +279,14 @@ if(BUILD_CLIENT) if(DEFINED ZLIB_DLL) install(FILES ${ZLIB_DLL} DESTINATION ${BINDIR}) endif() - if(USE_GETTEXT AND DEFINED GETTEXT_BIN_DIR) - install(FILES ${GETTEXT_BIN_DIR}/libintl3.dll DESTINATION ${BINDIR}) - install(FILES ${GETTEXT_BIN_DIR}/libiconv2.dll DESTINATION ${BINDIR}) - endif() + if(USE_GETTEXT) + if(defined GETTEXT_DLL) + install(FILES ${GETTEXT_DLL} DESTINATION ${BINDIR}) + endif() + if(defined GETTEXT_ICONV_DLL) + install(FILES ${GETTEXT_ICONV_DLL} DESTINATION ${BINDIR}) + endif() + endif(USE_GETTEXT) endif() endif(BUILD_CLIENT) @@ -289,14 +295,6 @@ if(BUILD_SERVER) endif(BUILD_SERVER) if (USE_GETTEXT) - if(WIN32) - set(GETTEXT_MSGFMT "${GETTEXT_BIN_DIR}/msgfmt.exe" CACHE FILEPATH "path to msgfmt") - elseif(APPLE) - set(GETTEXT_MSGFMT "${GETTEXT_BIN_DIR}/msgfmt" CACHE FILEPATH "path to msgfmt") - else() - set(GETTEXT_MSGFMT "msgfmt") - endif() - add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMENT "mo-update [de]: Creating locale directory.") add_custom_command( From 2a6c0fc17f0ed113a6f46f852338b96bce4d966d Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Thu, 21 Jul 2011 13:24:37 +0200 Subject: [PATCH 081/158] updated some path because the dlls are mostly under bin not lib added explanation why libintl must not belinked under some oses --- cmake/Modules/FindGettextLib.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/FindGettextLib.cmake b/cmake/Modules/FindGettextLib.cmake index 1ef8997..3fb391e 100644 --- a/cmake/Modules/FindGettextLib.cmake +++ b/cmake/Modules/FindGettextLib.cmake @@ -17,6 +17,7 @@ FIND_PROGRAM(GETTEXT_MSGFMT 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) FIND_LIBRARY(GETTEXT_LIBRARY @@ -25,11 +26,11 @@ IF (WIN32) DOC "gettext *intl*.lib") FIND_LIBRARY(GETTEXT_DLL NAMES libintl.dll intl.dll libintl3.dll intl3.dll - PATHS "${CUSTOM_GETTEXT_PATH}/lib" + PATHS "${CUSTOM_GETTEXT_PATH}/bin" "${CUSTOM_GETTEXT_PATH}/lib" DOC "gettext *intl*.dll") FIND_LIBRARY(GETTEXT_ICONV_DLL NAMES libiconv2.dll - PATHS "${CUSTOM_GETTEXT_PATH}/lib" + PATHS "${CUSTOM_GETTEXT_PATH}/bin" "${CUSTOM_GETTEXT_PATH}/lib" DOC "gettext *iconv*.lib") ENDIF(WIN32) From d63c160bd68f878ef0ebd30f125deee0e78429eb Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 21 Jul 2011 13:59:50 +0200 Subject: [PATCH 082/158] Uppercase DEFINED or cmake 2.8.4 complains --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8785a0e..2d7a7fc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -280,10 +280,10 @@ if(BUILD_CLIENT) install(FILES ${ZLIB_DLL} DESTINATION ${BINDIR}) endif() if(USE_GETTEXT) - if(defined GETTEXT_DLL) + if(DEFINED GETTEXT_DLL) install(FILES ${GETTEXT_DLL} DESTINATION ${BINDIR}) endif() - if(defined GETTEXT_ICONV_DLL) + if(DEFINED GETTEXT_ICONV_DLL) install(FILES ${GETTEXT_ICONV_DLL} DESTINATION ${BINDIR}) endif() endif(USE_GETTEXT) From 3e78b29cae00b763e3350bccb27ad48ec3141ef5 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 21 Jul 2011 14:46:14 +0200 Subject: [PATCH 083/158] Only install locale files if using gettext --- src/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2d7a7fc..6cc5c03 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -270,8 +270,10 @@ if(BUILD_CLIENT) install(FILES ${images} DESTINATION ${DATADIR}) - install(FILES ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo DESTINATION locale/de/LC_MESSAGES) - + if (USE_GETTEXT) + install(FILES ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo DESTINATION locale/de/LC_MESSAGES) + endif() + if(WIN32) if(DEFINED IRRLICHT_DLL) install(FILES ${IRRLICHT_DLL} DESTINATION ${BINDIR}) From 9fa4b72a4752795962b0d17c485de92fdbd029fc Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 21 Jul 2011 14:50:15 +0200 Subject: [PATCH 084/158] Find correct library for MSVC vs MingW in Winows --- cmake/Modules/FindGettextLib.cmake | 9 ++++++++- src/CMakeLists.txt | 4 ---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cmake/Modules/FindGettextLib.cmake b/cmake/Modules/FindGettextLib.cmake index 3fb391e..1bc9270 100644 --- a/cmake/Modules/FindGettextLib.cmake +++ b/cmake/Modules/FindGettextLib.cmake @@ -20,8 +20,15 @@ FIND_PROGRAM(GETTEXT_MSGFMT # 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 libintl.lib intl.lib libintl3.lib intl3.lib + NAMES ${GETTEXT_LIB_NAMES} PATHS "${CUSTOM_GETTEXT_PATH}/lib" DOC "gettext *intl*.lib") FIND_LIBRARY(GETTEXT_DLL diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6cc5c03..c018d8e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -235,10 +235,6 @@ else() set(ARCH i386) endif() - if(WIN32 AND USE_GETTEXT) - set(CMAKE_EXE_LINKER_FLAGS "-l${GETTEXT_LIBRARY}") - endif() - set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${RELEASE_WARNING_FLAGS} ${WARNING_FLAGS} -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops") set(CMAKE_CXX_FLAGS_DEBUG "-g -O1 -Wall ${WARNING_FLAGS}") From 56a744599f842b2d61c1624f71c9d094e311197b Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 21 Jul 2011 15:12:58 +0200 Subject: [PATCH 085/158] Restore "Leave address blank" position --- src/guiMainMenu.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp index f557f4d..707a96e 100644 --- a/src/guiMainMenu.cpp +++ b/src/guiMainMenu.cpp @@ -217,6 +217,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) } { core::rect rect(0, 0, 400, 20); + rect += topleft_client + v2s32(160, 100+35); Environment->addStaticText(chartowchar_t(gettext("Leave address blank to start a local server.")), rect, false, true, this, -1); } { From 02b14090c2c097903d5a53b245684843e6e39537 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 21 Jul 2011 15:16:59 +0200 Subject: [PATCH 086/158] Reorganize cmake gettext message output to ease debugging --- src/CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c018d8e..8c6e1d4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,18 +7,18 @@ endif(RUN_IN_PLACE) if(USE_GETTEXT) find_package(GettextLib REQUIRED) + message(STATUS "gettext include path: ${GETTEXT_INCLUDE_DIR}") + message(STATUS "gettext msgfmt path: ${GETTEXT_MSGFMT}") + if(WIN32) + message(STATUS "gettext library: ${GETTEXT_LIBRARY}") + message(STATUS "gettext dll: ${GETTEXT_DLL}") + message(STATUS "gettext iconv dll: ${GETTEXT_ICONV_DLL}") + endif() if (GETTEXT_FOUND) add_definitions( -DUSE_GETTEXT ) - message(STATUS "gettext include path: ${GETTEXT_INCLUDE_DIR}") - message(STATUS "gettext msgfmt path: ${GETTEXT_MSGFMT}") - if(WIN32) - message(STATUS "gettext library: ${GETTEXT_LIBRARY}") - message(STATUS "gettext dll: ${GETTEXT_DLL}") - message(STATUS "gettext iconv dll: ${GETTEXT_ICONV_DLL}") - endif() message(STATUS "GetText enabled") else() - message(ERROR "GetText enabled but not found, disabling") + message(STATUS "ERROR: GetText enabled but not found, disabling") set(USE_GETTEXT FALSE) endif(GETTEXT_FOUND) else(USE_GETTEXT) From 5388e8b1243183cbf1806a657d580621e6b9b7c8 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Thu, 21 Jul 2011 15:40:00 +0200 Subject: [PATCH 087/158] * different collision box for fireflies so they now hover above the ground --- src/content_sao.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content_sao.cpp b/src/content_sao.cpp index aeeafc2..0b81855 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -809,7 +809,7 @@ void FireflySAO::step(float dtime, bool send_recommended) Move it, with collision detection */ - core::aabbox3d box(-BS/3.,0.0,-BS/3., BS/3.,BS*2./3.,BS/3.); + core::aabbox3d box(-BS/3.,-BS*2/3.0,-BS/3., BS/3.,BS*4./3.,BS/3.); collisionMoveResult moveresult; // Maximum movement without glitches f32 pos_max_d = BS*0.25; From 6875ead7cf6d2d0a72bca3d3fa4e675b7c4c0ad9 Mon Sep 17 00:00:00 2001 From: Cyriaque Skrapits Date: Thu, 21 Jul 2011 16:09:57 +0200 Subject: [PATCH 088/158] Added french translation. --- src/CMakeLists.txt | 16 +++++++++++++++- updatelocales.sh | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 72f7997..532ac9f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -257,7 +257,8 @@ if(BUILD_CLIENT) install(FILES ${images} DESTINATION ${DATADIR}) install(FILES ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo DESTINATION locale/de/LC_MESSAGES) - + install(FILES ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES/minetest-c55.mo DESTINATION locale/fr/LC_MESSAGES) + if(WIN32) if(DEFINED IRRLICHT_DLL) install(FILES ${IRRLICHT_DLL} DESTINATION ${BINDIR}) @@ -285,6 +286,7 @@ else() endif() add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMENT "mo-update [de]: Creating locale directory.") +add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES COMMENT "mo-update [fr]: Creating locale directory.") add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo @@ -295,7 +297,19 @@ add_custom_command( WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/po/de COMMENT "mo-update [de]: Creating mo file." ) +add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES/minetest-c55.mo + COMMAND ${GETTEXT_MSGFMT} -o ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES/minetest-c55.mo ${CMAKE_SOURCE_DIR}/po/fr/minetest-c55.po + DEPENDS + ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES + ${CMAKE_SOURCE_DIR}/po/fr/minetest-c55.po + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/po/fr + COMMENT "mo-update [fr]: Creating mo file." + ) + add_custom_target(translation_de ALL COMMENT "mo update [de]" DEPENDS ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-c55.mo) +add_custom_target(translation_fr ALL COMMENT "mo update [fr]" DEPENDS ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES/minetest-c55.mo) + # Subdirectories diff --git a/updatelocales.sh b/updatelocales.sh index 1ac4234..e841451 100755 --- a/updatelocales.sh +++ b/updatelocales.sh @@ -1,4 +1,5 @@ #! /bin/bash xgettext -n -o minetest-c55.pot ./src/*.cpp ./src/*.h msgmerge -U ./po/de/minetest-c55.po minetest-c55.pot +msgmerge -U ./po/fr/minetest-c55.po minetest-c55.pot rm minetest-c55.pot From 3f4f844eeb8ae8314c00fbd296997f761cd83e21 Mon Sep 17 00:00:00 2001 From: Cyriaque Skrapits Date: Thu, 21 Jul 2011 16:14:18 +0200 Subject: [PATCH 089/158] Added missing .po fil.e --- po/fr/minetest-c55.po | 125 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 po/fr/minetest-c55.po diff --git a/po/fr/minetest-c55.po b/po/fr/minetest-c55.po new file mode 100644 index 0000000..cfb76ae --- /dev/null +++ b/po/fr/minetest-c55.po @@ -0,0 +1,125 @@ +# French translations for minetest-c55 package. +# Copyright (C) 2011 celeron +# This file is distributed under the same license as the minetest-c55 package. +# Cyriaque 'Cisoun' Skrapits , 2011 +# +msgid "" +msgstr "" +"Project-Id-Version: 0.0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-07-21 02:00+0200\n" +"PO-Revision-Date: 2011-07-21 15:48+0200\n" +"Last-Translator: Cyriaque 'Cisoun' Skrapits \n" +"Language-Team: Français <>\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" + +#: src/guiMainMenu.cpp:180 +msgid "Name/Password" +msgstr "Nom / MdP" + +#: src/guiMainMenu.cpp:202 +msgid "Address/Port" +msgstr "Adresse / Port" + +#: src/guiMainMenu.cpp:220 +msgid "Leave address blank to start a local server." +msgstr "Laisser l'adresse vide pour lancer un serveur local." + +#: src/guiMainMenu.cpp:226 +msgid "Fancy trees" +msgstr "Arbres spéciaux" + +#: src/guiMainMenu.cpp:232 +msgid "Smooth Lighting" +msgstr "Lumière douce" + +#: src/guiMainMenu.cpp:239 +msgid "Start Game / Connect" +msgstr "Démarrer / Connecter" + +#: src/guiMainMenu.cpp:247 +msgid "Change keys" +msgstr "Changer touches" + +#: src/guiMainMenu.cpp:269 +msgid "Creative Mode" +msgstr "Mode créatif" + +#: src/guiMainMenu.cpp:274 +msgid "Enable Damage" +msgstr "Activer blessures" + +#: src/guiMainMenu.cpp:281 +msgid "Delete map" +msgstr "Supprimer carte" + +#: src/guiMessageMenu.cpp:92 +#: src/guiTextInputMenu.cpp:110 +msgid "Proceed" +msgstr "OK" + +#: src/guiPasswordChange.cpp:102 +msgid "Old Password" +msgstr "Ancien mot de passe" + +#: src/guiPasswordChange.cpp:116 +msgid "New Password" +msgstr "Nouveau mot de passe" + +#: src/guiPasswordChange.cpp:129 +msgid "Confirm Password" +msgstr "Confirmer mot de passe" + +#: src/guiPasswordChange.cpp:143 +msgid "Change" +msgstr "Changer" + +#: src/guiPasswordChange.cpp:151 +msgid "Passwords do not match!" +msgstr "Mauvaise correspondance!" + +#: src/guiPauseMenu.cpp:109 +msgid "Continue" +msgstr "Continuer" + +#: src/guiPauseMenu.cpp:115 +msgid "Change Password" +msgstr "Changer mot de passe" + +#: src/guiPauseMenu.cpp:121 +msgid "Disconnect" +msgstr "Déconnection" + +#: src/guiPauseMenu.cpp:127 +msgid "Exit to OS" +msgstr "Quitter le jeu" + +#: src/guiPauseMenu.cpp:134 +msgid "" +"Keys:\n" +"- WASD: Walk\n" +"- Mouse left: dig blocks\n" +"- Mouse right: place blocks\n" +"- Mouse wheel: select item\n" +"- 0...9: select item\n" +"- Shift: sneak\n" +"- R: Toggle viewing all loaded chunks\n" +"- I: Inventory menu\n" +"- ESC: This menu\n" +"- T: Chat\n" +msgstr "" +"Touches:\n" +"- WASD: Marcher\n" +"- Clic gauche: Creuser bloc\n" +"- Clic droite: Insérer bloc\n" +"- Roulette: Sélection élément\n" +"- 0...9: Sélection élément\n" +"- Shift: S'accroupir\n" +"- R: Active la vue de tous les blocs\n" +"- I: Inventaire\n" +"- T: Chat\n" + From fc95d00b2f9929d3fdb93fff9a971d26115c12f4 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Thu, 21 Jul 2011 16:21:01 +0200 Subject: [PATCH 090/158] fixed not finding dll for gettext in MSVC --- cmake/Modules/FindGettextLib.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/FindGettextLib.cmake b/cmake/Modules/FindGettextLib.cmake index 1bc9270..f7ac8de 100644 --- a/cmake/Modules/FindGettextLib.cmake +++ b/cmake/Modules/FindGettextLib.cmake @@ -31,11 +31,11 @@ IF (WIN32) NAMES ${GETTEXT_LIB_NAMES} PATHS "${CUSTOM_GETTEXT_PATH}/lib" DOC "gettext *intl*.lib") - FIND_LIBRARY(GETTEXT_DLL + 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_LIBRARY(GETTEXT_ICONV_DLL + FIND_FILE(GETTEXT_ICONV_DLL NAMES libiconv2.dll PATHS "${CUSTOM_GETTEXT_PATH}/bin" "${CUSTOM_GETTEXT_PATH}/lib" DOC "gettext *iconv*.lib") From 17a47b3335cc8797b3ce15b6023e3a5eef89d89d Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Thu, 21 Jul 2011 17:36:23 +0200 Subject: [PATCH 091/158] + unknown block is sick --- data/unknown_block.png | Bin 582 -> 287 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/data/unknown_block.png b/data/unknown_block.png index a27cb8ca9a6765af1d7a3a3885b0c7e3be9046d8..8a8e0109c90d86afb8be5fdf4ad71501cee1d459 100644 GIT binary patch delta 271 zcmV+q0r39D1fK$s8Gix*005AYXf^-<00DDSM?wIu&K&6g007xZL_t(2&z({+4udcZ zJXi3YPP8xRbJ&8E5tvXUvhfWzI#nGymkqJ=hpKZrm>P&O&{`3)2;J^irAzE9 zYjQd!XKV7E1f|OZcMg=KSrFu{W&*)I8|y%Pk~EVZ0IxO#u76Ay1efWeZ)$G%yT&Y% z*pt$wSn|dV;gl-~RKBf-t$|4d2B%Sy(uX#jmw2S?TnAX?|mLcJefn}Xnkx!fRV zYjSJycpM(@S3C}0tdS?FHii54muafHR`S{0Am#{;Pt~=84m=Id>pFOEOTRwv54@^% VzM5#CCjbBd00>D%PDHLkV1j%wckciI delta 568 zcmV-80>}NI0>%W88Gi-<001BJ|6u?C00eVFNmK|32nc)#WQYI&010qNS#tmY4#WTe z4#WYKD-Ig~00HPpL_t(Ijb)QRiyBcB#ee=;B+VdGNlY0QlVU)GMMN0vbP&==rkM|s z$}W&LevWAdEXC;}5|L>{m_}J_B`#S8d5}^};oi$6`xmW$PjT!5rp4~Uv=EX!6FM|LH|OI$zn-2oc(GcOo&RVzDtGYiZJpiYfyy0JDsTAlGa(oaDfD{}*Vy%x*@;4R zKJ^0z%Q>;@=~p}uWkm_}w+Z0tUuZRG8-42D% zpZeGQ@*@MxLa5|%2v(+QP>mV7Eu}SyDuE+6oBNUmNbWboEay;FpGj=`2mjN|r zu$*hgaj6O~e*`U++51AhS%)f Date: Thu, 21 Jul 2011 20:13:31 +0200 Subject: [PATCH 092/158] * nicer firefly texture --- data/firefly.png | Bin 150 -> 116 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/data/firefly.png b/data/firefly.png index d5a444b039f45e3bc76e692ed15b258357aa3047..40df7fa1cc62fd8daf90ba6ae24a93992551b9fd 100644 GIT binary patch literal 116 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|^gLZ0Lo7}w zCrGd!W-xd(>4LH0@AC%^94N?}Zq5t>-2t{?TYVNMT5w57NHDB<$-=Tymis4ACxfS} KpUXO@geCxZJRmm! literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|0z6$DLnJOI z>&&XZH>0t!aiRXj4?4_34V}i0KW7;*rg*Xef!d05uX%tVf4#w<`s&t)_C7*KuWS#O t`1il^<^TWZz3W9>eR!5IlxVMDX6SgU#+aC8egSAUgQu&X%Q~loCIFMSF>n9? From 5c66664aef852c01c8ec8f79856ba081cf01446b Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Thu, 21 Jul 2011 16:44:43 +0200 Subject: [PATCH 093/158] changed some lines to fit the 80chars limit --- src/guiMainMenu.cpp | 26 +++++++++++++++++--------- src/guiMessageMenu.cpp | 3 ++- src/guiPasswordChange.cpp | 13 +++++++++---- src/guiPauseMenu.cpp | 12 ++++++++---- src/guiTextInputMenu.cpp | 3 ++- 5 files changed, 38 insertions(+), 19 deletions(-) diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp index 707a96e..1d7f224 100644 --- a/src/guiMainMenu.cpp +++ b/src/guiMainMenu.cpp @@ -177,7 +177,8 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, 50+6); - Environment->addStaticText(chartowchar_t(gettext("Name/Password")), rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Name/Password")), + rect, false, true, this, -1); } { core::rect rect(0, 0, 230, 30); @@ -199,7 +200,8 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, 100+6); - Environment->addStaticText(chartowchar_t(gettext("Address/Port")), rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Address/Port")), + rect, false, true, this, -1); } { core::rect rect(0, 0, 230, 30); @@ -218,13 +220,14 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 400, 20); rect += topleft_client + v2s32(160, 100+35); - Environment->addStaticText(chartowchar_t(gettext("Leave address blank to start a local server.")), rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Leave address blank to start a local server.")), + rect, false, true, this, -1); } { core::rect rect(0, 0, 250, 30); rect += topleft_client + v2s32(35, 150); Environment->addCheckBox(fancy_trees, rect, this, GUI_ID_FANCYTREE_CB, - chartowchar_t(gettext("Fancy trees"))); + chartowchar_t(gettext("Fancy trees"))); } { core::rect rect(0, 0, 250, 30); @@ -237,7 +240,8 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 180, 30); //rect += topleft_client + v2s32(size_client.X/2-180/2, 225-30/2); rect += topleft_client + v2s32(size_client.X-180-40, 150+25); - Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON, chartowchar_t(gettext("Start Game / Connect"))); + Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON, + chartowchar_t(gettext("Start Game / Connect"))); } // Key change button @@ -245,7 +249,8 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 100, 30); //rect += topleft_client + v2s32(size_client.X/2-180/2, 225-30/2); rect += topleft_client + v2s32(size_client.X-180-40-100-20, 150+25); - Environment->addButton(rect, this, GUI_ID_CHANGE_KEYS_BUTTON, chartowchar_t(gettext("Change keys"))); + Environment->addButton(rect, this, GUI_ID_CHANGE_KEYS_BUTTON, + chartowchar_t(gettext("Change keys"))); } /* Server section @@ -267,19 +272,22 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 250, 30); rect += topleft_server + v2s32(35, 30); - Environment->addCheckBox(creative_mode, rect, this, GUI_ID_CREATIVE_CB, chartowchar_t(gettext("Creative Mode"))); + Environment->addCheckBox(creative_mode, rect, this, GUI_ID_CREATIVE_CB, + chartowchar_t(gettext("Creative Mode"))); } { core::rect rect(0, 0, 250, 30); rect += topleft_server + v2s32(35, 60); - Environment->addCheckBox(enable_damage, rect, this, GUI_ID_DAMAGE_CB, chartowchar_t(gettext("Enable Damage"))); + Environment->addCheckBox(enable_damage, rect, this, GUI_ID_DAMAGE_CB, + chartowchar_t(gettext("Enable Damage"))); } // Map delete button { core::rect rect(0, 0, 130, 30); //rect += topleft_server + v2s32(size_server.X-40-130, 100+25); rect += topleft_server + v2s32(40, 100+25); - Environment->addButton(rect, this, GUI_ID_DELETE_MAP_BUTTON, chartowchar_t(gettext("Delete map"))); + Environment->addButton(rect, this, GUI_ID_DELETE_MAP_BUTTON, + chartowchar_t(gettext("Delete map"))); } } diff --git a/src/guiMessageMenu.cpp b/src/guiMessageMenu.cpp index e4e582a..155be60 100644 --- a/src/guiMessageMenu.cpp +++ b/src/guiMessageMenu.cpp @@ -89,7 +89,8 @@ void GUIMessageMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25); gui::IGUIElement *e = - Environment->addButton(rect, this, 257, chartowchar_t(gettext("Proceed"))); + Environment->addButton(rect, this, 257, + chartowchar_t(gettext("Proceed"))); Environment->setFocus(e); } } diff --git a/src/guiPasswordChange.cpp b/src/guiPasswordChange.cpp index 79601a9..fabe751 100644 --- a/src/guiPasswordChange.cpp +++ b/src/guiPasswordChange.cpp @@ -99,7 +99,8 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - Environment->addStaticText(chartowchar_t(gettext("Old Password")), rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Old Password")), + rect, false, true, this, -1); } { core::rect rect(0, 0, 230, 30); @@ -113,7 +114,8 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - Environment->addStaticText(chartowchar_t(gettext("New Password")), rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("New Password")), + rect, false, true, this, -1); } { core::rect rect(0, 0, 230, 30); @@ -126,7 +128,8 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - Environment->addStaticText(chartowchar_t(gettext("Confirm Password")), rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Confirm Password")), + rect, false, true, this, -1); } { core::rect rect(0, 0, 230, 30); @@ -148,7 +151,9 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 300, 20); rect += topleft_client + v2s32(35, ypos); IGUIElement *e = - Environment->addStaticText(chartowchar_t(gettext("Passwords do not match!")), rect, false, true, this, ID_message); + Environment->addStaticText( + chartowchar_t(gettext("Passwords do not match!")), + rect, false, true, this, ID_message); e->setVisible(false); } diff --git a/src/guiPauseMenu.cpp b/src/guiPauseMenu.cpp index 5f40a48..6148551 100644 --- a/src/guiPauseMenu.cpp +++ b/src/guiPauseMenu.cpp @@ -106,25 +106,29 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); - Environment->addButton(rect, this, 256, chartowchar_t(gettext("Continue"))); + Environment->addButton(rect, this, 256, + chartowchar_t(gettext("Continue"))); } btn_y += btn_height + btn_gap; { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); - Environment->addButton(rect, this, 261, chartowchar_t(gettext("Change Password"))); + Environment->addButton(rect, this, 261, + chartowchar_t(gettext("Change Password"))); } btn_y += btn_height + btn_gap; { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); - Environment->addButton(rect, this, 260, chartowchar_t(gettext("Disconnect"))); + Environment->addButton(rect, this, 260, + chartowchar_t(gettext("Disconnect"))); } btn_y += btn_height + btn_gap; { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); - Environment->addButton(rect, this, 257, chartowchar_t(gettext("Exit to OS"))); + Environment->addButton(rect, this, 257, + chartowchar_t(gettext("Exit to OS"))); } { diff --git a/src/guiTextInputMenu.cpp b/src/guiTextInputMenu.cpp index b15f8bc..252e452 100644 --- a/src/guiTextInputMenu.cpp +++ b/src/guiTextInputMenu.cpp @@ -107,7 +107,8 @@ void GUITextInputMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25); - Environment->addButton(rect, this, 257, chartowchar_t(gettext("Proceed"))); + Environment->addButton(rect, this, 257, + chartowchar_t(gettext("Proceed"))); } } From 5a3218e53531bdad4866c1d4473be538132fd23d Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 22 Jul 2011 08:33:08 +0200 Subject: [PATCH 094/158] Use project name for mo files --- src/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f3dee7f..feaf0eb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -267,8 +267,8 @@ if(BUILD_CLIENT) install(FILES ${images} DESTINATION ${DATADIR}) if (USE_GETTEXT) - install(FILES ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo DESTINATION locale/de/LC_MESSAGES) - install(FILES ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES/minetest-c55.mo DESTINATION locale/fr/LC_MESSAGES) + install(FILES ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/${PROJECT_NAME}.mo DESTINATION locale/de/LC_MESSAGES) + install(FILES ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES/${PROJECT_NAME}.mo DESTINATION locale/fr/LC_MESSAGES) endif() if(WIN32) @@ -298,7 +298,7 @@ if (USE_GETTEXT) add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES COMMENT "mo-update [fr]: Creating locale directory.") add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo + OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/${PROJECT_NAME}.mo COMMAND ${GETTEXT_MSGFMT} -o ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo ${CMAKE_SOURCE_DIR}/po/de/minetest-c55.po DEPENDS ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES @@ -307,7 +307,7 @@ if (USE_GETTEXT) COMMENT "mo-update [de]: Creating mo file." ) add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES/minetest-c55.mo + OUTPUT ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES/${PROJECT_NAME}.mo COMMAND ${GETTEXT_MSGFMT} -o ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES/minetest-c55.mo ${CMAKE_SOURCE_DIR}/po/fr/minetest-c55.po DEPENDS ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES @@ -316,8 +316,8 @@ if (USE_GETTEXT) COMMENT "mo-update [fr]: Creating mo file." ) - add_custom_target(translation_de ALL COMMENT "mo update [de]" DEPENDS ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo) - add_custom_target(translation_fr ALL COMMENT "mo update [fr]" DEPENDS ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES/minetest-c55.mo) + add_custom_target(translation_de ALL COMMENT "mo update [de]" DEPENDS ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/${PROJECT_NAME}.mo) + add_custom_target(translation_fr ALL COMMENT "mo update [fr]" DEPENDS ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES/${PROJECT_NAME}.mo) endif(USE_GETTEXT) # Subdirectories From d386f02893e132317bd2641878d0b86b52347d15 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 22 Jul 2011 09:36:17 +0200 Subject: [PATCH 095/158] Refactor mo creation/installation --- cmake/Modules/FindGettextLib.cmake | 11 ++++++- src/CMakeLists.txt | 49 +++++++++++++++--------------- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/cmake/Modules/FindGettextLib.cmake b/cmake/Modules/FindGettextLib.cmake index f7ac8de..31b2615 100644 --- a/cmake/Modules/FindGettextLib.cmake +++ b/cmake/Modules/FindGettextLib.cmake @@ -53,4 +53,13 @@ IF(GETTEXT_INCLUDE_DIR AND GETTEXT_MSGFMT) 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 locale//LC_MESSAGES) + FILE(GLOB GETTEXT_AVAILABLE_LOCALES RELATIVE ${GETTEXT_PO_PATH} "${GETTEXT_PO_PATH}/*") + 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) +ENDIF() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index feaf0eb..4427a13 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -16,7 +16,7 @@ if(USE_GETTEXT) endif() if (GETTEXT_FOUND) add_definitions( -DUSE_GETTEXT ) - message(STATUS "GetText enabled") + message(STATUS "GetText enabled; locales found: ${GETTEXT_AVAILABLE_LOCALES}") else() message(STATUS "ERROR: GetText enabled but not found, disabling") set(USE_GETTEXT FALSE) @@ -267,8 +267,11 @@ if(BUILD_CLIENT) install(FILES ${images} DESTINATION ${DATADIR}) if (USE_GETTEXT) - install(FILES ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/${PROJECT_NAME}.mo DESTINATION locale/de/LC_MESSAGES) - install(FILES ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES/${PROJECT_NAME}.mo DESTINATION locale/fr/LC_MESSAGES) + foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) + set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE}) + set(MO_BUILD_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo") + install(FILES ${MO_BUILD_PATH} DESTINATION ${MO_DEST_PATH}) + endforeach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) endif() if(WIN32) @@ -294,30 +297,28 @@ if(BUILD_SERVER) endif(BUILD_SERVER) if (USE_GETTEXT) - add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES COMMENT "mo-update [de]: Creating locale directory.") - add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES COMMENT "mo-update [fr]: Creating locale directory.") + set(MO_FILES) + foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) + set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE}) + add_custom_command(OUTPUT ${MO_BUILD_PATH} + COMMAND ${CMAKE_COMMAND} -E make_directory ${MO_BUILD_PATH} + COMMENT "mo-update [${LOCALE}]: Creating locale directory.") - add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/${PROJECT_NAME}.mo - COMMAND ${GETTEXT_MSGFMT} -o ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/minetest-delta.mo ${CMAKE_SOURCE_DIR}/po/de/minetest-c55.po - DEPENDS - ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES - ${CMAKE_SOURCE_DIR}/po/de/minetest-c55.po - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/po/de - COMMENT "mo-update [de]: Creating mo file." - ) - add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES/${PROJECT_NAME}.mo - COMMAND ${GETTEXT_MSGFMT} -o ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES/minetest-c55.mo ${CMAKE_SOURCE_DIR}/po/fr/minetest-c55.po - DEPENDS - ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES - ${CMAKE_SOURCE_DIR}/po/fr/minetest-c55.po - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/po/fr - COMMENT "mo-update [fr]: Creating mo file." + set(MO_FILE_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo") + set(PO_FILE_PATH "${GETTEXT_PO_PATH}/${LOCALE}/minetest-c55.po") + + add_custom_command( + OUTPUT ${MO_FILE_PATH} + COMMAND ${GETTEXT_MSGFMT} -o ${MO_FILE_PATH} ${PO_FILE_PATH} + DEPENDS ${MO_BUILD_PATH} ${PO_FILE_PATH} + WORKING_DIRECTORY "${GETTEXT_PO_PATH}/${LOCALE}" + COMMENT "mo-update [${LOCALE}]: Creating mo file." ) - add_custom_target(translation_de ALL COMMENT "mo update [de]" DEPENDS ${CMAKE_BINARY_DIR}/locale/de/LC_MESSAGES/${PROJECT_NAME}.mo) - add_custom_target(translation_fr ALL COMMENT "mo update [fr]" DEPENDS ${CMAKE_BINARY_DIR}/locale/fr/LC_MESSAGES/${PROJECT_NAME}.mo) + set(MO_FILES ${MO_FILES} ${MO_FILE_PATH}) + endforeach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) + + add_custom_target(translations ALL COMMENT "mo update" DEPENDS ${MO_FILES}) endif(USE_GETTEXT) # Subdirectories From e61b2f99c14c307ae317a5aaba151cd0070c313d Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 22 Jul 2011 09:58:02 +0200 Subject: [PATCH 096/158] Static naming of po file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The po file should not be named c55 if we're in ∆. But since it is not exposed at installation time, we don't actually need its name to be based on the project name at all, so just call it minetest.po --- po/de/{minetest-c55.po => minetest.po} | 0 po/fr/{minetest-c55.po => minetest.po} | 0 src/CMakeLists.txt | 2 +- updatelocales.sh | 8 ++++---- 4 files changed, 5 insertions(+), 5 deletions(-) rename po/de/{minetest-c55.po => minetest.po} (100%) rename po/fr/{minetest-c55.po => minetest.po} (100%) diff --git a/po/de/minetest-c55.po b/po/de/minetest.po similarity index 100% rename from po/de/minetest-c55.po rename to po/de/minetest.po diff --git a/po/fr/minetest-c55.po b/po/fr/minetest.po similarity index 100% rename from po/fr/minetest-c55.po rename to po/fr/minetest.po diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4427a13..61fb206 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -305,7 +305,7 @@ if (USE_GETTEXT) COMMENT "mo-update [${LOCALE}]: Creating locale directory.") set(MO_FILE_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo") - set(PO_FILE_PATH "${GETTEXT_PO_PATH}/${LOCALE}/minetest-c55.po") + set(PO_FILE_PATH "${GETTEXT_PO_PATH}/${LOCALE}/minetest.po") add_custom_command( OUTPUT ${MO_FILE_PATH} diff --git a/updatelocales.sh b/updatelocales.sh index e841451..72ecd48 100755 --- a/updatelocales.sh +++ b/updatelocales.sh @@ -1,5 +1,5 @@ #! /bin/bash -xgettext -n -o minetest-c55.pot ./src/*.cpp ./src/*.h -msgmerge -U ./po/de/minetest-c55.po minetest-c55.pot -msgmerge -U ./po/fr/minetest-c55.po minetest-c55.pot -rm minetest-c55.pot +xgettext -n -o minetest.pot ./src/*.cpp ./src/*.h +msgmerge -U ./po/de/minetest.po minetest.pot +msgmerge -U ./po/fr/minetest.po minetest.pot +rm minetest.pot From d78e5e7329bc56255288c32193504ca97dbf15db Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 22 Jul 2011 10:55:05 +0200 Subject: [PATCH 097/158] updatepo cmake rule Get rid of the system-specific updatelocales.sh and introduce an updatepo cmake rule. po files are also updated before creating the mo files, and we now keep the .pot file (in the po/en directory). To stabilize the po file creation, file contents are sorted by source filename. Update po files in the process. --- cmake/Modules/FindGettextLib.cmake | 15 ++++ po/de/minetest.po | 42 +++++------ po/en/minetest.pot | 113 +++++++++++++++++++++++++++++ po/fr/minetest.po | 42 +++++------ src/CMakeLists.txt | 54 ++++++++++---- updatelocales.sh | 5 -- 6 files changed, 208 insertions(+), 63 deletions(-) create mode 100644 po/en/minetest.pot delete mode 100755 updatelocales.sh diff --git a/cmake/Modules/FindGettextLib.cmake b/cmake/Modules/FindGettextLib.cmake index 31b2615..b99fd33 100644 --- a/cmake/Modules/FindGettextLib.cmake +++ b/cmake/Modules/FindGettextLib.cmake @@ -16,6 +16,21 @@ FIND_PROGRAM(GETTEXT_MSGFMT PATHS "${CUSTOM_GETTEXT_PATH}/bin" DOC "path to msgfmt") +FIND_PROGRAM(GETTEXT_MSGMERGE + NAMES msgmerge + PATHS "${CUSTOM_GETTEXT_PATH}/bin" + DOC "path to msgmerge") + +FIND_PROGRAM(GETTEXT_MSGEN + NAMES msgen + PATHS "${CUSTOM_GETTEXT_PATH}/bin" + DOC "path to msgen") + +FIND_PROGRAM(GETTEXT_EXTRACT + NAMES xgettext + PATHS "${CUSTOM_GETTEXT_PATH}/bin" + DOC "path to xgettext") + # 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 diff --git a/po/de/minetest.po b/po/de/minetest.po index c5ec1c7..69b57fd 100644 --- a/po/de/minetest.po +++ b/po/de/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-20 16:57+0200\n" +"POT-Creation-Date: 2011-07-22 11:00+0200\n" "PO-Revision-Date: 2011-07-20 16:58+0100\n" "Last-Translator: Constantin Wenger \n" "Language-Team: Deutsch <>\n" @@ -21,44 +21,43 @@ msgstr "" msgid "Name/Password" msgstr "Name/Passwort" -#: src/guiMainMenu.cpp:202 +#: src/guiMainMenu.cpp:203 msgid "Address/Port" msgstr "Adresse / Port" -#: src/guiMainMenu.cpp:220 +#: src/guiMainMenu.cpp:223 msgid "Leave address blank to start a local server." msgstr "Lasse die Adresse frei um einen eigenen Server zu starten" -#: src/guiMainMenu.cpp:226 +#: src/guiMainMenu.cpp:230 msgid "Fancy trees" msgstr "Schöne Bäume" -#: src/guiMainMenu.cpp:232 +#: src/guiMainMenu.cpp:236 msgid "Smooth Lighting" msgstr "Besseres Licht" -#: src/guiMainMenu.cpp:239 +#: src/guiMainMenu.cpp:244 msgid "Start Game / Connect" msgstr "Spiel starten / Verbinden" -#: src/guiMainMenu.cpp:247 +#: src/guiMainMenu.cpp:253 msgid "Change keys" msgstr "Tastenbelegung ändern" -#: src/guiMainMenu.cpp:269 +#: src/guiMainMenu.cpp:276 msgid "Creative Mode" msgstr "Kreativitätsmodus" -#: src/guiMainMenu.cpp:274 +#: src/guiMainMenu.cpp:282 msgid "Enable Damage" msgstr "Schaden einschalten" -#: src/guiMainMenu.cpp:281 +#: src/guiMainMenu.cpp:290 msgid "Delete map" msgstr "Karte löschen" -#: src/guiMessageMenu.cpp:92 -#: src/guiTextInputMenu.cpp:110 +#: src/guiMessageMenu.cpp:93 src/guiTextInputMenu.cpp:111 msgid "Proceed" msgstr "Fortsetzen" @@ -66,39 +65,39 @@ msgstr "Fortsetzen" msgid "Old Password" msgstr "Altes Passwort" -#: src/guiPasswordChange.cpp:116 +#: src/guiPasswordChange.cpp:117 msgid "New Password" msgstr "Neues Passwort" -#: src/guiPasswordChange.cpp:129 +#: src/guiPasswordChange.cpp:131 msgid "Confirm Password" msgstr "Passwort wiederholen" -#: src/guiPasswordChange.cpp:143 +#: src/guiPasswordChange.cpp:146 msgid "Change" msgstr "Ändern" -#: src/guiPasswordChange.cpp:151 +#: src/guiPasswordChange.cpp:155 msgid "Passwords do not match!" msgstr "Passwörter passen nicht zusammen" -#: src/guiPauseMenu.cpp:109 +#: src/guiPauseMenu.cpp:110 msgid "Continue" msgstr "Weiter" -#: src/guiPauseMenu.cpp:115 +#: src/guiPauseMenu.cpp:117 msgid "Change Password" msgstr "Passwort ändern" -#: src/guiPauseMenu.cpp:121 +#: src/guiPauseMenu.cpp:124 msgid "Disconnect" msgstr "Verbindung trennen" -#: src/guiPauseMenu.cpp:127 +#: src/guiPauseMenu.cpp:131 msgid "Exit to OS" msgstr "Programm beenden" -#: src/guiPauseMenu.cpp:134 +#: src/guiPauseMenu.cpp:138 msgid "" "Keys:\n" "- WASD: Walk\n" @@ -122,4 +121,3 @@ msgstr "" "- R: Alle geladenen Kartenteile anzeigen, umschalten\n" "- I: Inventarmenü\n" "- T: Chat\n" - diff --git a/po/en/minetest.pot b/po/en/minetest.pot new file mode 100644 index 0000000..e242c49 --- /dev/null +++ b/po/en/minetest.pot @@ -0,0 +1,113 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: minetest\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-07-22 11:02+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/guiMainMenu.cpp:180 +msgid "Name/Password" +msgstr "" + +#: src/guiMainMenu.cpp:203 +msgid "Address/Port" +msgstr "" + +#: src/guiMainMenu.cpp:223 +msgid "Leave address blank to start a local server." +msgstr "" + +#: src/guiMainMenu.cpp:230 +msgid "Fancy trees" +msgstr "" + +#: src/guiMainMenu.cpp:236 +msgid "Smooth Lighting" +msgstr "" + +#: src/guiMainMenu.cpp:244 +msgid "Start Game / Connect" +msgstr "" + +#: src/guiMainMenu.cpp:253 +msgid "Change keys" +msgstr "" + +#: src/guiMainMenu.cpp:276 +msgid "Creative Mode" +msgstr "" + +#: src/guiMainMenu.cpp:282 +msgid "Enable Damage" +msgstr "" + +#: src/guiMainMenu.cpp:290 +msgid "Delete map" +msgstr "" + +#: src/guiMessageMenu.cpp:93 src/guiTextInputMenu.cpp:111 +msgid "Proceed" +msgstr "" + +#: src/guiPasswordChange.cpp:102 +msgid "Old Password" +msgstr "" + +#: src/guiPasswordChange.cpp:117 +msgid "New Password" +msgstr "" + +#: src/guiPasswordChange.cpp:131 +msgid "Confirm Password" +msgstr "" + +#: src/guiPasswordChange.cpp:146 +msgid "Change" +msgstr "" + +#: src/guiPasswordChange.cpp:155 +msgid "Passwords do not match!" +msgstr "" + +#: src/guiPauseMenu.cpp:110 +msgid "Continue" +msgstr "" + +#: src/guiPauseMenu.cpp:117 +msgid "Change Password" +msgstr "" + +#: src/guiPauseMenu.cpp:124 +msgid "Disconnect" +msgstr "" + +#: src/guiPauseMenu.cpp:131 +msgid "Exit to OS" +msgstr "" + +#: src/guiPauseMenu.cpp:138 +msgid "" +"Keys:\n" +"- WASD: Walk\n" +"- Mouse left: dig blocks\n" +"- Mouse right: place blocks\n" +"- Mouse wheel: select item\n" +"- 0...9: select item\n" +"- Shift: sneak\n" +"- R: Toggle viewing all loaded chunks\n" +"- I: Inventory menu\n" +"- ESC: This menu\n" +"- T: Chat\n" +msgstr "" diff --git a/po/fr/minetest.po b/po/fr/minetest.po index cfb76ae..b060c42 100644 --- a/po/fr/minetest.po +++ b/po/fr/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-21 02:00+0200\n" +"POT-Creation-Date: 2011-07-22 11:00+0200\n" "PO-Revision-Date: 2011-07-21 15:48+0200\n" "Last-Translator: Cyriaque 'Cisoun' Skrapits \n" "Language-Team: Français <>\n" @@ -21,44 +21,43 @@ msgstr "" msgid "Name/Password" msgstr "Nom / MdP" -#: src/guiMainMenu.cpp:202 +#: src/guiMainMenu.cpp:203 msgid "Address/Port" msgstr "Adresse / Port" -#: src/guiMainMenu.cpp:220 +#: src/guiMainMenu.cpp:223 msgid "Leave address blank to start a local server." msgstr "Laisser l'adresse vide pour lancer un serveur local." -#: src/guiMainMenu.cpp:226 +#: src/guiMainMenu.cpp:230 msgid "Fancy trees" msgstr "Arbres spéciaux" -#: src/guiMainMenu.cpp:232 +#: src/guiMainMenu.cpp:236 msgid "Smooth Lighting" msgstr "Lumière douce" -#: src/guiMainMenu.cpp:239 +#: src/guiMainMenu.cpp:244 msgid "Start Game / Connect" msgstr "Démarrer / Connecter" -#: src/guiMainMenu.cpp:247 +#: src/guiMainMenu.cpp:253 msgid "Change keys" msgstr "Changer touches" -#: src/guiMainMenu.cpp:269 +#: src/guiMainMenu.cpp:276 msgid "Creative Mode" msgstr "Mode créatif" -#: src/guiMainMenu.cpp:274 +#: src/guiMainMenu.cpp:282 msgid "Enable Damage" msgstr "Activer blessures" -#: src/guiMainMenu.cpp:281 +#: src/guiMainMenu.cpp:290 msgid "Delete map" msgstr "Supprimer carte" -#: src/guiMessageMenu.cpp:92 -#: src/guiTextInputMenu.cpp:110 +#: src/guiMessageMenu.cpp:93 src/guiTextInputMenu.cpp:111 msgid "Proceed" msgstr "OK" @@ -66,39 +65,39 @@ msgstr "OK" msgid "Old Password" msgstr "Ancien mot de passe" -#: src/guiPasswordChange.cpp:116 +#: src/guiPasswordChange.cpp:117 msgid "New Password" msgstr "Nouveau mot de passe" -#: src/guiPasswordChange.cpp:129 +#: src/guiPasswordChange.cpp:131 msgid "Confirm Password" msgstr "Confirmer mot de passe" -#: src/guiPasswordChange.cpp:143 +#: src/guiPasswordChange.cpp:146 msgid "Change" msgstr "Changer" -#: src/guiPasswordChange.cpp:151 +#: src/guiPasswordChange.cpp:155 msgid "Passwords do not match!" msgstr "Mauvaise correspondance!" -#: src/guiPauseMenu.cpp:109 +#: src/guiPauseMenu.cpp:110 msgid "Continue" msgstr "Continuer" -#: src/guiPauseMenu.cpp:115 +#: src/guiPauseMenu.cpp:117 msgid "Change Password" msgstr "Changer mot de passe" -#: src/guiPauseMenu.cpp:121 +#: src/guiPauseMenu.cpp:124 msgid "Disconnect" msgstr "Déconnection" -#: src/guiPauseMenu.cpp:127 +#: src/guiPauseMenu.cpp:131 msgid "Exit to OS" msgstr "Quitter le jeu" -#: src/guiPauseMenu.cpp:134 +#: src/guiPauseMenu.cpp:138 msgid "" "Keys:\n" "- WASD: Walk\n" @@ -122,4 +121,3 @@ msgstr "" "- R: Active la vue de tous les blocs\n" "- I: Inventaire\n" "- T: Chat\n" - diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 61fb206..0c4b418 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -297,28 +297,54 @@ if(BUILD_SERVER) endif(BUILD_SERVER) if (USE_GETTEXT) + add_custom_command(OUTPUT "${GETTEXT_PO_PATH}/en" + COMMAND ${CMAKE_COMMAND} -E make_directory "${GETTEXT_PO_PATH}/en" + COMMENT "po-update [en]: creating translation template base directory") + set(POT_FILE "${GETTEXT_PO_PATH}/en/minetest.pot") + file(GLOB GETTEXT_POT_DEPS *.cpp *.h) + file(GLOB GETTEXT_POT_DEPS_REL RELATIVE ${CMAKE_SOURCE_DIR} *.cpp *.h) + add_custom_command(OUTPUT ${POT_FILE} + COMMAND ${GETTEXT_EXTRACT} -F -n -o ${POT_FILE} ${GETTEXT_POT_DEPS_REL} + DEPENDS "${GETTEXT_PO_PATH}/en" ${GETTEXT_POT_DEPS} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMENT "po-update [en]: updating translation template") + + set(PO_FILES) set(MO_FILES) + foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) - set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE}) - add_custom_command(OUTPUT ${MO_BUILD_PATH} - COMMAND ${CMAKE_COMMAND} -E make_directory ${MO_BUILD_PATH} - COMMENT "mo-update [${LOCALE}]: Creating locale directory.") + # skip the 'en' locale which is treated separately + if (NOT LOCALE STREQUAL "en") + set(PO_FILE_PATH "${GETTEXT_PO_PATH}/${LOCALE}/minetest.po") + add_custom_command(OUTPUT ${PO_FILE_PATH} + COMMAND ${GETTEXT_MSGMERGE} -F -U ${PO_FILE_PATH} ${POT_FILE} + DEPENDS ${POT_FILE} + WORKING_DIRECTORY "${GETTEXT_PO_PATH}/${LOCALE}" + COMMENT "po-update [${LOCALE}]: updating strings") - set(MO_FILE_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo") - set(PO_FILE_PATH "${GETTEXT_PO_PATH}/${LOCALE}/minetest.po") - add_custom_command( - OUTPUT ${MO_FILE_PATH} - COMMAND ${GETTEXT_MSGFMT} -o ${MO_FILE_PATH} ${PO_FILE_PATH} - DEPENDS ${MO_BUILD_PATH} ${PO_FILE_PATH} - WORKING_DIRECTORY "${GETTEXT_PO_PATH}/${LOCALE}" - COMMENT "mo-update [${LOCALE}]: Creating mo file." - ) + set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE}) + add_custom_command(OUTPUT ${MO_BUILD_PATH} + COMMAND ${CMAKE_COMMAND} -E make_directory ${MO_BUILD_PATH} + COMMENT "mo-update [${LOCALE}]: Creating locale directory.") - set(MO_FILES ${MO_FILES} ${MO_FILE_PATH}) + set(MO_FILE_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo") + + add_custom_command( + OUTPUT ${MO_FILE_PATH} + COMMAND ${GETTEXT_MSGFMT} -o ${MO_FILE_PATH} ${PO_FILE_PATH} + DEPENDS ${MO_BUILD_PATH} ${PO_FILE_PATH} + WORKING_DIRECTORY "${GETTEXT_PO_PATH}/${LOCALE}" + COMMENT "mo-update [${LOCALE}]: Creating mo file." + ) + + set(MO_FILES ${MO_FILES} ${MO_FILE_PATH}) + set(PO_FILES ${PO_FILES} ${PO_FILE_PATH}) + endif(NOT LOCALE STREQUAL "en") endforeach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) add_custom_target(translations ALL COMMENT "mo update" DEPENDS ${MO_FILES}) + add_custom_target(updatepo COMMENT "po update" DEPENDS ${PO_FILES}) endif(USE_GETTEXT) # Subdirectories diff --git a/updatelocales.sh b/updatelocales.sh deleted file mode 100755 index 72ecd48..0000000 --- a/updatelocales.sh +++ /dev/null @@ -1,5 +0,0 @@ -#! /bin/bash -xgettext -n -o minetest.pot ./src/*.cpp ./src/*.h -msgmerge -U ./po/de/minetest.po minetest.pot -msgmerge -U ./po/fr/minetest.po minetest.pot -rm minetest.pot From a09660dc85a6dd6eed83f72a85bacd62f1d9eb1a Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Fri, 22 Jul 2011 12:54:07 +0200 Subject: [PATCH 098/158] fixed problem with displaying special chars --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index b6a5356..a7634a3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1132,7 +1132,7 @@ int main(int argc, char *argv[]) // Create user data directory fs::CreateDir(porting::path_userdata); - setlocale(LC_ALL, ""); + setlocale(LC_MESSAGES, ""); bindtextdomain("minetest-c55", (porting::path_userdata+"/locale").c_str()); textdomain("minetest-c55"); From 7d9dd352cfd680ef31bb309138939d37e4cbf90a Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 22 Jul 2011 14:42:04 +0200 Subject: [PATCH 099/158] Declare USE_GETTEXT option --- src/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0c4b418..dc9dc03 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,6 +5,8 @@ if(RUN_IN_PLACE) add_definitions ( -DRUN_IN_PLACE ) endif(RUN_IN_PLACE) +OPTION(USE_GETTEXT "Use GetText for internationalization" OFF) + if(USE_GETTEXT) find_package(GettextLib REQUIRED) message(STATUS "gettext include path: ${GETTEXT_INCLUDE_DIR}") From 96ad0c86380a3386d4ad4d021a9d604569fd5883 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Wed, 20 Jul 2011 19:57:44 +0200 Subject: [PATCH 100/158] updated some parts which don't really make a problem but are better this way --- README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.txt b/README.txt index 662f277..763974f 100644 --- a/README.txt +++ b/README.txt @@ -153,7 +153,7 @@ Compiling on Windows: ZLIB_LIBRARIES DIR/zlib125dll/dll32/zlibwapi.lib GETTEXT_BIN_DIR DIR/gettext/bin GETTEXT_INCLUDE_DIR DIR/gettext/include - GETTEXT_LIBRARIES DIR/gettext/lib/intl.lib + GETTEXT_LIBRARIES DIR/gettext/lib/libintl.lib GETTEXT_MSGFMT DIR/gettext/bin/msgfmt ----------------- - Hit "Configure" From fb4c3ab4fbd29498a72a488199be58ead7505cc7 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Fri, 22 Jul 2011 20:19:43 +0200 Subject: [PATCH 101/158] fixed some problems with filenames of the translations --- src/CMakeLists.txt | 2 +- src/main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dc9dc03..c93762c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -330,7 +330,7 @@ if (USE_GETTEXT) COMMAND ${CMAKE_COMMAND} -E make_directory ${MO_BUILD_PATH} COMMENT "mo-update [${LOCALE}]: Creating locale directory.") - set(MO_FILE_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo") + set(MO_FILE_PATH "${MO_BUILD_PATH}/minetest.mo") add_custom_command( OUTPUT ${MO_FILE_PATH} diff --git a/src/main.cpp b/src/main.cpp index a7634a3..b94d0c3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1133,8 +1133,8 @@ int main(int argc, char *argv[]) fs::CreateDir(porting::path_userdata); setlocale(LC_MESSAGES, ""); - bindtextdomain("minetest-c55", (porting::path_userdata+"/locale").c_str()); - textdomain("minetest-c55"); + bindtextdomain("minetest", (porting::path_userdata+"/locale").c_str()); + textdomain("minetest"); // Initialize debug streams #ifdef RUN_IN_PLACE From 4771b4951d2e36794d8f077bdea2bdfcaec87b0b Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Fri, 22 Jul 2011 20:55:00 +0200 Subject: [PATCH 102/158] change in readme of a lib --- README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.txt b/README.txt index 763974f..662f277 100644 --- a/README.txt +++ b/README.txt @@ -153,7 +153,7 @@ Compiling on Windows: ZLIB_LIBRARIES DIR/zlib125dll/dll32/zlibwapi.lib GETTEXT_BIN_DIR DIR/gettext/bin GETTEXT_INCLUDE_DIR DIR/gettext/include - GETTEXT_LIBRARIES DIR/gettext/lib/libintl.lib + GETTEXT_LIBRARIES DIR/gettext/lib/intl.lib GETTEXT_MSGFMT DIR/gettext/bin/msgfmt ----------------- - Hit "Configure" From a7daf8e652a3354c5e5128d070b8547722a0d7ca Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Fri, 22 Jul 2011 21:56:00 +0200 Subject: [PATCH 103/158] * README updated --- .hgtags | 17 +++++++++++++++++ README | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.hgtags b/.hgtags index 95bda33..2911487 100644 --- a/.hgtags +++ b/.hgtags @@ -1 +1,18 @@ c37bcfd89dd627fdb131ae3f77fcaab02721bf76 working +69547bd6be420eb40f55524fd2131cbbaa2e0e29 110107195706-exp +e3c3c8e27bbc8c9b61710517a78944deb1c61696 110211211322 +23880c78e40c50ad54fcd8844510f7a423b37f2a 110212200513 +20c49c98c92a62df457b773c562df41d4167492b 110214175330 +10be2b71f965585af90af96903e83b4ddff52bf9 20110424_0 +9b05d4bfee9312aef4182fa6f63b4237368cec34 0.2.20110529_0 +6fa0a8b40406aa567f8fa84b5e2045a7e3762c1d 0.2.20110529_1 +cf6dd618ef0b7514c81ae87749733b5a328fc763 0.2.20110529_2 +96efc17b4cd92aacbe947b520a6ba91727d42f03 0.2.20110602_0 +0000000000000000000000000000000000000000 0.2.20110602_0 +6f17cd3f6c5481e6abc906fc441980c764632cbc 0.2.20110602_0 +dd08a9b5cb84d55b7576bb3fde3068dd263bc3bc 0.2.20110618_0_dev +25aa2021937f7a8b36808390983cebbc16ae6965 0.2.20110704_0 +25aa2021937f7a8b36808390983cebbc16ae6965 0.2.20110704_0 +0000000000000000000000000000000000000000 0.2.20110704_0 +0000000000000000000000000000000000000000 0.2.20110704_0 +65263ec55caf526e3f3e0bdc6657ce42daee46bc 0.2.20110704_0 diff --git a/README b/README index e03bdae..82fcdd3 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ Minetest Δ (“Minetest Delta”) is a fork of Minetest-c55 , incorporating experimental features that are not (yet) included in Minetest-c55. New features: -* Submenu for key assignment (changes apply after restart) +* Submenu for key assignment * configurable far mesh tree display (boolean) * configurable far mesh rendering distance * volumetric clouds (using fake shading) From f6d9bcc9bb020f79f73bc2cf0187f73a6d1d9275 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Sat, 23 Jul 2011 22:36:11 +0200 Subject: [PATCH 104/158] updated cmakerules to autodetect if gettext can be used fixed error if gettext is disabled --- cmake/Modules/FindGettextLib.cmake | 3 +++ src/CMakeLists.txt | 31 ++++++++++++++---------------- src/gettext.h | 6 ++++++ src/main.cpp | 4 +++- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/cmake/Modules/FindGettextLib.cmake b/cmake/Modules/FindGettextLib.cmake index b99fd33..1c36f8c 100644 --- a/cmake/Modules/FindGettextLib.cmake +++ b/cmake/Modules/FindGettextLib.cmake @@ -77,4 +77,7 @@ IF(GETTEXT_FOUND) 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/src/CMakeLists.txt b/src/CMakeLists.txt index c93762c..5554ec4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,10 +5,11 @@ if(RUN_IN_PLACE) add_definitions ( -DRUN_IN_PLACE ) endif(RUN_IN_PLACE) -OPTION(USE_GETTEXT "Use GetText for internationalization" OFF) +OPTION(USE_GETTEXT "Use GetText for internationalization" ON) -if(USE_GETTEXT) - find_package(GettextLib REQUIRED) +find_package(GettextLib) + +if(GETTEXT_FOUND AND USE_GETTEXT) message(STATUS "gettext include path: ${GETTEXT_INCLUDE_DIR}") message(STATUS "gettext msgfmt path: ${GETTEXT_MSGFMT}") if(WIN32) @@ -16,16 +17,12 @@ if(USE_GETTEXT) message(STATUS "gettext dll: ${GETTEXT_DLL}") message(STATUS "gettext iconv dll: ${GETTEXT_ICONV_DLL}") endif() - if (GETTEXT_FOUND) - add_definitions( -DUSE_GETTEXT ) - message(STATUS "GetText enabled; locales found: ${GETTEXT_AVAILABLE_LOCALES}") - else() - message(STATUS "ERROR: GetText enabled but not found, disabling") - set(USE_GETTEXT FALSE) - endif(GETTEXT_FOUND) -else(USE_GETTEXT) + message(STATUS "GetText enabled; locales found: ${GETTEXT_AVAILABLE_LOCALES}") +elseif(GETTEXT_FOUND AND NOT USE_GETTEXT) + MESSAGE(STATUS "GetText found but disabled;") +else(GETTEXT_FOUND AND USE_GETTEXT) message(STATUS "GetText disabled") -endif(USE_GETTEXT) +endif(GETTEXT_FOUND AND USE_GETTEXT) if(NOT MSVC) set(USE_GPROF 0 CACHE BOOL "Use -pg flag for g++") @@ -268,7 +265,7 @@ if(BUILD_CLIENT) install(FILES ${images} DESTINATION ${DATADIR}) - if (USE_GETTEXT) + if(GETTEXT_FOUND AND USE_GETTEXT) foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE}) set(MO_BUILD_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo") @@ -283,14 +280,14 @@ if(BUILD_CLIENT) if(DEFINED ZLIB_DLL) install(FILES ${ZLIB_DLL} DESTINATION ${BINDIR}) endif() - if(USE_GETTEXT) + if(GETTEXT_FOUND AND USE_GETTEXT) if(DEFINED GETTEXT_DLL) install(FILES ${GETTEXT_DLL} DESTINATION ${BINDIR}) endif() if(DEFINED GETTEXT_ICONV_DLL) install(FILES ${GETTEXT_ICONV_DLL} DESTINATION ${BINDIR}) endif() - endif(USE_GETTEXT) + endif(GETTEXT_FOUND AND USE_GETTEXT) endif() endif(BUILD_CLIENT) @@ -298,7 +295,7 @@ if(BUILD_SERVER) install(TARGETS ${PROJECT_NAME}server DESTINATION ${BINDIR}) endif(BUILD_SERVER) -if (USE_GETTEXT) +if (GETTEXT_FOUND AND USE_GETTEXT) add_custom_command(OUTPUT "${GETTEXT_PO_PATH}/en" COMMAND ${CMAKE_COMMAND} -E make_directory "${GETTEXT_PO_PATH}/en" COMMENT "po-update [en]: creating translation template base directory") @@ -347,7 +344,7 @@ if (USE_GETTEXT) add_custom_target(translations ALL COMMENT "mo update" DEPENDS ${MO_FILES}) add_custom_target(updatepo COMMENT "po update" DEPENDS ${PO_FILES}) -endif(USE_GETTEXT) +endif(GETTEXT_FOUND AND USE_GETTEXT) # Subdirectories diff --git a/src/gettext.h b/src/gettext.h index 8ddb953..e74b4eb 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -1,3 +1,4 @@ +#ifdef GETTEXT_FOUND #ifdef USE_GETTEXT #include #else @@ -5,6 +6,11 @@ #define bindtextdomain(domain, dir) /* */ #define textdomain(domain) /* */ #endif +#else +#define gettext(String) String +#define bindtextdomain(domain, dir) /* */ +#define textdomain(domain) /* */ +#endif #define _(String) gettext(String) #define gettext_noop(String) String diff --git a/src/main.cpp b/src/main.cpp index b94d0c3..11941a4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1132,10 +1132,12 @@ int main(int argc, char *argv[]) // Create user data directory fs::CreateDir(porting::path_userdata); +#ifdef LC_MESSAGES setlocale(LC_MESSAGES, ""); bindtextdomain("minetest", (porting::path_userdata+"/locale").c_str()); textdomain("minetest"); - +#endif + // Initialize debug streams #ifdef RUN_IN_PLACE std::string debugfile = DEBUGFILE; From 4ffba76bb39363a01647acb19667cd33bbbd700b Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sat, 23 Jul 2011 15:47:09 +0200 Subject: [PATCH 105/158] Place project name and gettext use in config --- src/cmake_config.h.in | 3 ++- src/config.h | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cmake_config.h.in b/src/cmake_config.h.in index 5e37519..6a8f93b 100644 --- a/src/cmake_config.h.in +++ b/src/cmake_config.h.in @@ -3,6 +3,7 @@ #ifndef CMAKE_CONFIG_H #define CMAKE_CONFIG_H +#define PROJECT_NAME "@PROJECT_NAME@" #define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" #define VERSION_STRING "@VERSION_STRING@" #ifdef NDEBUG @@ -10,7 +11,7 @@ #else #define BUILD_TYPE "Debug" #endif -#define BUILD_INFO "VER="VERSION_STRING" RUN_IN_PLACE=@RUN_IN_PLACE@ INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@ BUILD_TYPE="BUILD_TYPE +#define BUILD_INFO "VER="VERSION_STRING" RUN_IN_PLACE=@RUN_IN_PLACE@ USE_GETTEXT=@USE_GETTEXT@ INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@ BUILD_TYPE="BUILD_TYPE #endif diff --git a/src/config.h b/src/config.h index b24cf6a..eb1d1a9 100644 --- a/src/config.h +++ b/src/config.h @@ -9,6 +9,8 @@ #ifdef USE_CMAKE_CONFIG_H #include "cmake_config.h" #else + #define PROJECT_NAME "minetest" + //#define INSTALL_PREFIX "" #define VERSION_STRING "unknown" #ifdef NDEBUG @@ -21,7 +23,12 @@ #else #define RUN_IN_PLACE_BOOLSTRING "0" #endif - #define BUILD_INFO "NON-CMAKE RUN_IN_PLACE="RUN_IN_PLACE_BOOLSTRING" BUILD_TYPE="BUILD_TYPE + #ifdef USE_GETTEXT + #define USE_GETTEXT_BOOLSTRING "ON" + #else + #define USE_GETTEXT_BOOLSTRING "OFF" + #endif + #define BUILD_INFO "NON-CMAKE RUN_IN_PLACE="RUN_IN_PLACE_BOOLSTRING" USE_GETTEXT="USE_GETTEXT_BOOLSTRING" BUILD_TYPE="BUILD_TYPE #endif #endif From d4e7faca219ca2d9d84b02e46d591799afed32d8 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sat, 23 Jul 2011 15:49:06 +0200 Subject: [PATCH 106/158] Gettext domain should match the project name This partially reverts 023cc0d37776976b4b192b7363f73a5d2debdef6, goes back to using PROJECT_NAME for the filename and also uses PROJECT_NAME as text domain in the source code. --- src/CMakeLists.txt | 2 +- src/main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5554ec4..6daf938 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -327,7 +327,7 @@ if (GETTEXT_FOUND AND USE_GETTEXT) COMMAND ${CMAKE_COMMAND} -E make_directory ${MO_BUILD_PATH} COMMENT "mo-update [${LOCALE}]: Creating locale directory.") - set(MO_FILE_PATH "${MO_BUILD_PATH}/minetest.mo") + set(MO_FILE_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo") add_custom_command( OUTPUT ${MO_FILE_PATH} diff --git a/src/main.cpp b/src/main.cpp index 11941a4..2f48d22 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1134,8 +1134,8 @@ int main(int argc, char *argv[]) #ifdef LC_MESSAGES setlocale(LC_MESSAGES, ""); - bindtextdomain("minetest", (porting::path_userdata+"/locale").c_str()); - textdomain("minetest"); + bindtextdomain(PROJECT_NAME, (porting::path_userdata+"/locale").c_str()); + textdomain(PROJECT_NAME); #endif // Initialize debug streams From 5aa2679be7696862066edf617dc5a8261b7325ab Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sat, 23 Jul 2011 16:15:29 +0200 Subject: [PATCH 107/158] Do not package en translation, since we don't build it --- src/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6daf938..c50b74d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -267,9 +267,11 @@ if(BUILD_CLIENT) if(GETTEXT_FOUND AND USE_GETTEXT) foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) - set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE}) - set(MO_BUILD_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo") - install(FILES ${MO_BUILD_PATH} DESTINATION ${MO_DEST_PATH}) + if (NOT LOCALE STREQUAL "en") + set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE}) + set(MO_BUILD_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo") + install(FILES ${MO_BUILD_PATH} DESTINATION ${MO_DEST_PATH}) + endif(NOT LOCALE STREQUAL "en") endforeach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) endif() From c578efb32b57b08275b9a0a2fd4a76b4e4b9e87d Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sat, 23 Jul 2011 16:38:37 +0200 Subject: [PATCH 108/158] Refactor gettext init Put the gettext init code in a macro and define it appropriately depending on whether gettext is actually available or not. --- src/gettext.h | 18 +++++++++--------- src/main.cpp | 6 +----- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/gettext.h b/src/gettext.h index e74b4eb..751b837 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -1,21 +1,21 @@ -#ifdef GETTEXT_FOUND -#ifdef USE_GETTEXT +#if defined(GETTEXT_FOUND) && defined(USE_GETTEXT) #include #else #define gettext(String) String -#define bindtextdomain(domain, dir) /* */ -#define textdomain(domain) /* */ -#endif -#else -#define gettext(String) String -#define bindtextdomain(domain, dir) /* */ -#define textdomain(domain) /* */ #endif #define _(String) gettext(String) #define gettext_noop(String) String #define N_(String) gettext_noop (String) +inline void init_gettext(const char *path) { +#if USE_GETTEXT + setlocale(LC_MESSAGES, ""); + bindtextdomain(PROJECT_NAME, path); + textdomain(PROJECT_NAME); +#endif +} + inline wchar_t* chartowchar_t(const char *str) { size_t l = strlen(str)+1; diff --git a/src/main.cpp b/src/main.cpp index 2f48d22..bdfbc35 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1132,11 +1132,7 @@ int main(int argc, char *argv[]) // Create user data directory fs::CreateDir(porting::path_userdata); -#ifdef LC_MESSAGES - setlocale(LC_MESSAGES, ""); - bindtextdomain(PROJECT_NAME, (porting::path_userdata+"/locale").c_str()); - textdomain(PROJECT_NAME); -#endif + init_gettext((porting::path_userdata+"/locale").c_str()); // Initialize debug streams #ifdef RUN_IN_PLACE From 47381bde3b4d7a9ee9780786c9a993f2b63a488a Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 24 Jul 2011 10:19:31 +0200 Subject: [PATCH 109/158] Bring po update out of cmake again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This solves two issues at once: * CMake would delete po files during ‘make clean’ because it thought they were autogenerated and not just managed * the only gettext tools readily available in Windows are so old they don't support options like --package-name The change also moves minetest.pot down one level, so we don't need to special case ‘en’ anymore. The downside is of course that you need some sane POSIX shell to update the po files. --- cmake/Modules/FindGettextLib.cmake | 16 +------- po/{en => }/minetest.pot | 2 +- src/CMakeLists.txt | 61 ++++++++-------------------- util/updatepo.sh | 65 ++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 60 deletions(-) rename po/{en => }/minetest.pot (97%) create mode 100755 util/updatepo.sh diff --git a/cmake/Modules/FindGettextLib.cmake b/cmake/Modules/FindGettextLib.cmake index 1c36f8c..a215f3f 100644 --- a/cmake/Modules/FindGettextLib.cmake +++ b/cmake/Modules/FindGettextLib.cmake @@ -16,21 +16,6 @@ FIND_PROGRAM(GETTEXT_MSGFMT PATHS "${CUSTOM_GETTEXT_PATH}/bin" DOC "path to msgfmt") -FIND_PROGRAM(GETTEXT_MSGMERGE - NAMES msgmerge - PATHS "${CUSTOM_GETTEXT_PATH}/bin" - DOC "path to msgmerge") - -FIND_PROGRAM(GETTEXT_MSGEN - NAMES msgen - PATHS "${CUSTOM_GETTEXT_PATH}/bin" - DOC "path to msgen") - -FIND_PROGRAM(GETTEXT_EXTRACT - NAMES xgettext - PATHS "${CUSTOM_GETTEXT_PATH}/bin" - DOC "path to xgettext") - # 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 @@ -73,6 +58,7 @@ IF(GETTEXT_FOUND) SET(GETTEXT_MO_BUILD_PATH ${CMAKE_BINARY_DIR}/locale//LC_MESSAGES) SET(GETTEXT_MO_DEST_PATH locale//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}) diff --git a/po/en/minetest.pot b/po/minetest.pot similarity index 97% rename from po/en/minetest.pot rename to po/minetest.pot index e242c49..7b95d21 100644 --- a/po/en/minetest.pot +++ b/po/minetest.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-22 11:02+0200\n" +"POT-Creation-Date: 2011-07-24 10:16+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c50b74d..c897f4b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -267,11 +267,9 @@ if(BUILD_CLIENT) if(GETTEXT_FOUND AND USE_GETTEXT) foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) - if (NOT LOCALE STREQUAL "en") - set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE}) - set(MO_BUILD_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo") - install(FILES ${MO_BUILD_PATH} DESTINATION ${MO_DEST_PATH}) - endif(NOT LOCALE STREQUAL "en") + set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE}) + set(MO_BUILD_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo") + install(FILES ${MO_BUILD_PATH} DESTINATION ${MO_DEST_PATH}) endforeach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) endif() @@ -298,54 +296,29 @@ if(BUILD_SERVER) endif(BUILD_SERVER) if (GETTEXT_FOUND AND USE_GETTEXT) - add_custom_command(OUTPUT "${GETTEXT_PO_PATH}/en" - COMMAND ${CMAKE_COMMAND} -E make_directory "${GETTEXT_PO_PATH}/en" - COMMENT "po-update [en]: creating translation template base directory") - set(POT_FILE "${GETTEXT_PO_PATH}/en/minetest.pot") - file(GLOB GETTEXT_POT_DEPS *.cpp *.h) - file(GLOB GETTEXT_POT_DEPS_REL RELATIVE ${CMAKE_SOURCE_DIR} *.cpp *.h) - add_custom_command(OUTPUT ${POT_FILE} - COMMAND ${GETTEXT_EXTRACT} -F -n -o ${POT_FILE} ${GETTEXT_POT_DEPS_REL} - DEPENDS "${GETTEXT_PO_PATH}/en" ${GETTEXT_POT_DEPS} - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - COMMENT "po-update [en]: updating translation template") - - set(PO_FILES) set(MO_FILES) foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) - # skip the 'en' locale which is treated separately - if (NOT LOCALE STREQUAL "en") - set(PO_FILE_PATH "${GETTEXT_PO_PATH}/${LOCALE}/minetest.po") - add_custom_command(OUTPUT ${PO_FILE_PATH} - COMMAND ${GETTEXT_MSGMERGE} -F -U ${PO_FILE_PATH} ${POT_FILE} - DEPENDS ${POT_FILE} - WORKING_DIRECTORY "${GETTEXT_PO_PATH}/${LOCALE}" - COMMENT "po-update [${LOCALE}]: updating strings") + set(PO_FILE_PATH "${GETTEXT_PO_PATH}/${LOCALE}/minetest.po") + set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE}) + set(MO_FILE_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo") + add_custom_command(OUTPUT ${MO_BUILD_PATH} + COMMAND ${CMAKE_COMMAND} -E make_directory ${MO_BUILD_PATH} + COMMENT "mo-update [${LOCALE}]: Creating locale directory.") - set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE}) - add_custom_command(OUTPUT ${MO_BUILD_PATH} - COMMAND ${CMAKE_COMMAND} -E make_directory ${MO_BUILD_PATH} - COMMENT "mo-update [${LOCALE}]: Creating locale directory.") + add_custom_command( + OUTPUT ${MO_FILE_PATH} + COMMAND ${GETTEXT_MSGFMT} -o ${MO_FILE_PATH} ${PO_FILE_PATH} + DEPENDS ${MO_BUILD_PATH} ${PO_FILE_PATH} + WORKING_DIRECTORY "${GETTEXT_PO_PATH}/${LOCALE}" + COMMENT "mo-update [${LOCALE}]: Creating mo file." + ) - set(MO_FILE_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo") - - add_custom_command( - OUTPUT ${MO_FILE_PATH} - COMMAND ${GETTEXT_MSGFMT} -o ${MO_FILE_PATH} ${PO_FILE_PATH} - DEPENDS ${MO_BUILD_PATH} ${PO_FILE_PATH} - WORKING_DIRECTORY "${GETTEXT_PO_PATH}/${LOCALE}" - COMMENT "mo-update [${LOCALE}]: Creating mo file." - ) - - set(MO_FILES ${MO_FILES} ${MO_FILE_PATH}) - set(PO_FILES ${PO_FILES} ${PO_FILE_PATH}) - endif(NOT LOCALE STREQUAL "en") + set(MO_FILES ${MO_FILES} ${MO_FILE_PATH}) endforeach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) add_custom_target(translations ALL COMMENT "mo update" DEPENDS ${MO_FILES}) - add_custom_target(updatepo COMMENT "po update" DEPENDS ${PO_FILES}) endif(GETTEXT_FOUND AND USE_GETTEXT) # Subdirectories diff --git a/util/updatepo.sh b/util/updatepo.sh new file mode 100755 index 0000000..bcfa4c4 --- /dev/null +++ b/util/updatepo.sh @@ -0,0 +1,65 @@ +#!/bin/sh + +# Update/create minetest po files + +# an auxiliary function to abort processing with an optional error +# message +abort() { + test -n "$1" && echo >&2 "$1" + exit 1 +} + +# The po/ directory is assumed to be parallel to the directory where +# this script is. Relative paths are fine for us so we can just +# use the following trick (works both for manual invocations and for +# script found from PATH) +scriptisin="$(dirname "$(which "$0")")" + +# The script is executed from the parent of po/, which is also the +# parent of the script directory and of the src/ directory. +# We go through $scriptisin so that it can be executed from whatever +# directory and still work correctly +cd "$scriptisin/.." + +test -e po || abort "po/ directory not found" +test -d po || abort "po/ is not a directory!" + +# Get a list of the languages we have to update/create + +cd po || abort "couldn't change directory to po!" + +# This assumes that we won't have dirnames with space, which is +# the case for language codes, which are the only subdirs we expect to +# find in po/ anyway. If you put anything else there, you need to suffer +# the consequences of your actions, so we don't do sanity checks +langs="" + +for lang in * ; do + if test ! -d $lang; then + continue + fi + langs="$langs $lang" +done + +# go back +cd .. + +# First thing first, update the .pot template. We place it in the po/ +# directory at the top level. You a recent enough xgettext that supports +# --package-name +potfile=po/minetest.pot +xgettext --package-name=minetest -F -n -o $potfile src/*.cpp src/*.h + +# Now iterate on all languages and create the po file if missing, or update it +# if it exists already +for lang in $langs ; do # note the missing quotes around $langs + pofile=po/$lang/minetest.po + if test -e $pofile; then + echo "[$lang]: updating strings" + msgmerge -F -U $pofile $potfile + else + # This will ask for the translator identity + echo "[$lang]: NEW strings" + msginit -l $lang -o $pofile -i $potfile + fi +done From e034f8a2a372279edfc5a6c69dc14fb31c9a7685 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 24 Jul 2011 13:58:51 +0200 Subject: [PATCH 110/158] Sanitize GETTEXT usage macros Now the user-level option is called ENABLE_GETTEXT, and USE_GETTEXT is only set to true if gettext was enabled and found. This simplifies all check to USE_GETTEXT only rather than the double checks for it being enabled and found. --- src/CMakeLists.txt | 25 +++++++++++++++---------- src/config.h | 8 ++++---- src/gettext.h | 2 +- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c897f4b..fcdb3cc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,11 +5,15 @@ if(RUN_IN_PLACE) add_definitions ( -DRUN_IN_PLACE ) endif(RUN_IN_PLACE) -OPTION(USE_GETTEXT "Use GetText for internationalization" ON) +# user-visible option to enable/disable gettext usage +OPTION(ENABLE_GETTEXT "Use GetText for internationalization" ON) + +# this is only set to 1 if gettext is enabled _and_ available +set(USE_GETTEXT 0) find_package(GettextLib) -if(GETTEXT_FOUND AND USE_GETTEXT) +if(GETTEXT_FOUND AND ENABLE_GETTEXT) message(STATUS "gettext include path: ${GETTEXT_INCLUDE_DIR}") message(STATUS "gettext msgfmt path: ${GETTEXT_MSGFMT}") if(WIN32) @@ -17,12 +21,13 @@ if(GETTEXT_FOUND AND USE_GETTEXT) message(STATUS "gettext dll: ${GETTEXT_DLL}") message(STATUS "gettext iconv dll: ${GETTEXT_ICONV_DLL}") endif() + set(USE_GETTEXT 1) message(STATUS "GetText enabled; locales found: ${GETTEXT_AVAILABLE_LOCALES}") -elseif(GETTEXT_FOUND AND NOT USE_GETTEXT) +elseif(GETTEXT_FOUND AND NOT ENABLE_GETTEXT) MESSAGE(STATUS "GetText found but disabled;") -else(GETTEXT_FOUND AND USE_GETTEXT) +else(GETTEXT_FOUND AND ENABLE_GETTEXT) message(STATUS "GetText disabled") -endif(GETTEXT_FOUND AND USE_GETTEXT) +endif(GETTEXT_FOUND AND ENABLE_GETTEXT) if(NOT MSVC) set(USE_GPROF 0 CACHE BOOL "Use -pg flag for g++") @@ -265,7 +270,7 @@ if(BUILD_CLIENT) install(FILES ${images} DESTINATION ${DATADIR}) - if(GETTEXT_FOUND AND USE_GETTEXT) + if(USE_GETTEXT) foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE}) set(MO_BUILD_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo") @@ -280,14 +285,14 @@ if(BUILD_CLIENT) if(DEFINED ZLIB_DLL) install(FILES ${ZLIB_DLL} DESTINATION ${BINDIR}) endif() - if(GETTEXT_FOUND AND USE_GETTEXT) + if(USE_GETTEXT) if(DEFINED GETTEXT_DLL) install(FILES ${GETTEXT_DLL} DESTINATION ${BINDIR}) endif() if(DEFINED GETTEXT_ICONV_DLL) install(FILES ${GETTEXT_ICONV_DLL} DESTINATION ${BINDIR}) endif() - endif(GETTEXT_FOUND AND USE_GETTEXT) + endif(USE_GETTEXT) endif() endif(BUILD_CLIENT) @@ -295,7 +300,7 @@ if(BUILD_SERVER) install(TARGETS ${PROJECT_NAME}server DESTINATION ${BINDIR}) endif(BUILD_SERVER) -if (GETTEXT_FOUND AND USE_GETTEXT) +if (USE_GETTEXT) set(MO_FILES) foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) @@ -319,7 +324,7 @@ if (GETTEXT_FOUND AND USE_GETTEXT) endforeach(LOCALE ${GETTEXT_AVAILABLE_LOCALES}) add_custom_target(translations ALL COMMENT "mo update" DEPENDS ${MO_FILES}) -endif(GETTEXT_FOUND AND USE_GETTEXT) +endif(USE_GETTEXT) # Subdirectories diff --git a/src/config.h b/src/config.h index eb1d1a9..54b89a0 100644 --- a/src/config.h +++ b/src/config.h @@ -23,13 +23,13 @@ #else #define RUN_IN_PLACE_BOOLSTRING "0" #endif - #ifdef USE_GETTEXT - #define USE_GETTEXT_BOOLSTRING "ON" + #if USE_GETTEXT + #define USE_GETTEXT_BOOLSTRING "1" #else - #define USE_GETTEXT_BOOLSTRING "OFF" + #define USE_GETTEXT_BOOLSTRING "0" #endif + #define BUILD_INFO "NON-CMAKE RUN_IN_PLACE="RUN_IN_PLACE_BOOLSTRING" USE_GETTEXT="USE_GETTEXT_BOOLSTRING" BUILD_TYPE="BUILD_TYPE #endif - #endif diff --git a/src/gettext.h b/src/gettext.h index 751b837..7c3a6ff 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -1,4 +1,4 @@ -#if defined(GETTEXT_FOUND) && defined(USE_GETTEXT) +#if USE_GETTEXT #include #else #define gettext(String) String From 423109e64c9e723f9f2a52e3537892f584383865 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 24 Jul 2011 18:12:11 +0200 Subject: [PATCH 111/158] Two more instances of unhardcoding the project name --- src/main.cpp | 2 +- src/servermain.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index bdfbc35..0001d33 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1153,7 +1153,7 @@ int main(int argc, char *argv[]) BEGIN_DEBUG_EXCEPTION_HANDLER // Print startup message - dstream< Date: Sun, 24 Jul 2011 18:34:10 +0200 Subject: [PATCH 112/158] Actually make USE_GETTEXT available in the source --- src/cmake_config.h.in | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmake_config.h.in b/src/cmake_config.h.in index 6a8f93b..7cbb11f 100644 --- a/src/cmake_config.h.in +++ b/src/cmake_config.h.in @@ -6,6 +6,7 @@ #define PROJECT_NAME "@PROJECT_NAME@" #define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" #define VERSION_STRING "@VERSION_STRING@" +#define USE_GETTEXT @USE_GETTEXT@ #ifdef NDEBUG #define BUILD_TYPE "Release" #else From ad6b0873532d769e108930734f17d2b5dfd0c49d Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sun, 24 Jul 2011 18:51:44 +0200 Subject: [PATCH 113/158] + 24x24 rendering of SVG minetest icon, polished manually to look crisp --- minetest-icon-24x24.png | Bin 0 -> 913 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 minetest-icon-24x24.png diff --git a/minetest-icon-24x24.png b/minetest-icon-24x24.png new file mode 100644 index 0000000000000000000000000000000000000000..4d587c410f81f7f8dcbca6e814212b51aa3a5e60 GIT binary patch literal 913 zcmV;C18)3@P)Px&OG!jQR7l6QmTzcVWfaDL@4dH8v#tNrkX%rQ+n_QR*WJu?LnbI?W1V9*cB70T zg6N3Dvd?8h#C{!A#$Ym67~+R!mQ9E&s|dq^w=+di=5#o*i%qAk)z-FY{@lF#(B;-N zsm=a)KEC(7&vTyVobz(we-3rI557aV*KR@`{hs8*5QwD*8`~*&)@pg6Q9Yyb4%r7G z(3T!JYqg|%lVWL(1$F6JQvMs76(u7cT7mx!P3nH7Xkt8?rS=b{;d(4H4)Da2*;QYK zNvuSm+)p*vW0~=`o_bz>zn+m_lsVl{!+QI(l9B-_*#F1P)T=JA`}1 z9+VnaPEG>goplrE4%TXIsvKZRuksW`Kgfu9G)rb4TY4rTh)1(DwO0X<7?)f*Imyn7 z^+bXpB4HoKGc~g0G1U!4>PEhEJKm~8+{+xhYH{=1DI&oT^_xfRoaSQ@0OZgb)_LbD z`vy`oc^2io?C5o&#w@%a{RKemXahnl7U+FWrOsDF>$y{yn_B@$r5B6oJL6~n>(PH8 zC2Wg~Mvv4Dg+0d_nESnq=?RB@VS2@~QfC1XtcOj)@{cEt*Gfd}>^O(0`gZFLHWhQW~ za7=d}|C+(>1)!XwV!-y42tix>F8af;!K(vs Date: Sun, 24 Jul 2011 19:06:17 +0200 Subject: [PATCH 114/158] Italian translations --- po/it/minetest.po | 124 ++++++++++++++++++++++++++++++++++++++++++++++ po/minetest.pot | 2 +- 2 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 po/it/minetest.po diff --git a/po/it/minetest.po b/po/it/minetest.po new file mode 100644 index 0000000..8f66311 --- /dev/null +++ b/po/it/minetest.po @@ -0,0 +1,124 @@ +# Italian translations for minetest package. +# Copyright (C) 2011 THE minetest'S COPYRIGHT HOLDER +# This file is distributed under the same license as the minetest package. +# Giuseppe Bilotta , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: minetest\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-07-24 18:56+0200\n" +"PO-Revision-Date: 2011-07-24 18:56+0200\n" +"Last-Translator: Giuseppe Bilotta \n" +"Language-Team: Italian\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/guiMainMenu.cpp:180 +msgid "Name/Password" +msgstr "Nome/Password" + +#: src/guiMainMenu.cpp:203 +msgid "Address/Port" +msgstr "Indirizzo/Porta" + +#: src/guiMainMenu.cpp:223 +msgid "Leave address blank to start a local server." +msgstr "Lascia vuoto l'indirizzo per avviare un server locale" + +#: src/guiMainMenu.cpp:230 +msgid "Fancy trees" +msgstr "Alberi strani" + +#: src/guiMainMenu.cpp:236 +msgid "Smooth Lighting" +msgstr "" + +#: src/guiMainMenu.cpp:244 +msgid "Start Game / Connect" +msgstr "Avvia Gioco / Connetti" + +#: src/guiMainMenu.cpp:253 +msgid "Change keys" +msgstr "Modifica tasti" + +#: src/guiMainMenu.cpp:276 +msgid "Creative Mode" +msgstr "Modalità creativa" + +#: src/guiMainMenu.cpp:282 +msgid "Enable Damage" +msgstr "Attiva Danno" + +#: src/guiMainMenu.cpp:290 +msgid "Delete map" +msgstr "Cancella mappa" + +#: src/guiMessageMenu.cpp:93 src/guiTextInputMenu.cpp:111 +msgid "Proceed" +msgstr "Procedi" + +#: src/guiPasswordChange.cpp:102 +msgid "Old Password" +msgstr "Vecchia password" + +#: src/guiPasswordChange.cpp:117 +msgid "New Password" +msgstr "Nuova password" + +#: src/guiPasswordChange.cpp:131 +msgid "Confirm Password" +msgstr "Conferma password" + +#: src/guiPasswordChange.cpp:146 +msgid "Change" +msgstr "Modifica" + +#: src/guiPasswordChange.cpp:155 +msgid "Passwords do not match!" +msgstr "Le password non corrispondono!" + +#: src/guiPauseMenu.cpp:110 +msgid "Continue" +msgstr "Continua" + +#: src/guiPauseMenu.cpp:117 +msgid "Change Password" +msgstr "Cambia password" + +#: src/guiPauseMenu.cpp:124 +msgid "Disconnect" +msgstr "Disconnetti" + +#: src/guiPauseMenu.cpp:131 +msgid "Exit to OS" +msgstr "Esci al S.O." + +#: src/guiPauseMenu.cpp:138 +msgid "" +"Keys:\n" +"- WASD: Walk\n" +"- Mouse left: dig blocks\n" +"- Mouse right: place blocks\n" +"- Mouse wheel: select item\n" +"- 0...9: select item\n" +"- Shift: sneak\n" +"- R: Toggle viewing all loaded chunks\n" +"- I: Inventory menu\n" +"- ESC: This menu\n" +"- T: Chat\n" +msgstr "" +"Tasti:\n" +"- WASD: Cammina\n" +"- Mouse left: scava blocchi\n" +"- Mouse right: piazza blocchi\n" +"- Mouse wheel: seleziona oggetto\n" +"- 0...9: seleziona oggetto\n" +"- Shift: furtivo\n" +"- R: (Dis)attiva motra tutti i blocchi caricati\n" +"- I: Inventario\n" +"- ESC: Questo menu\n" +"- T: Parla\n" diff --git a/po/minetest.pot b/po/minetest.pot index 7b95d21..e359bf4 100644 --- a/po/minetest.pot +++ b/po/minetest.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-24 10:16+0200\n" +"POT-Creation-Date: 2011-07-24 18:56+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" From a8e493122e436b3202b266db23e200e764bdabc5 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 24 Jul 2011 19:13:30 +0200 Subject: [PATCH 115/158] Read config from gettext.h Otherwise the USE_GETTEXT define might not be visible. --- src/gettext.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gettext.h b/src/gettext.h index 7c3a6ff..493f9b2 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -1,3 +1,5 @@ +#include "config.h" // for USE_GETTEXT + #if USE_GETTEXT #include #else From cce210f6768ab9960248f07d2b203dfae660daac Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 24 Jul 2011 19:20:40 +0200 Subject: [PATCH 116/158] Locale dir should be parallel to global data dir --- cmake/Modules/FindGettextLib.cmake | 2 +- src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/FindGettextLib.cmake b/cmake/Modules/FindGettextLib.cmake index a215f3f..18935ea 100644 --- a/cmake/Modules/FindGettextLib.cmake +++ b/cmake/Modules/FindGettextLib.cmake @@ -56,7 +56,7 @@ 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 locale//LC_MESSAGES) + SET(GETTEXT_MO_DEST_PATH ${DATADIR}/../locale//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) diff --git a/src/main.cpp b/src/main.cpp index 0001d33..bcca60d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1132,7 +1132,7 @@ int main(int argc, char *argv[]) // Create user data directory fs::CreateDir(porting::path_userdata); - init_gettext((porting::path_userdata+"/locale").c_str()); + init_gettext((porting::path_data+"/../locale").c_str()); // Initialize debug streams #ifdef RUN_IN_PLACE From a4fe2a7c757cea570f5bba1caae2ad1ec1b84dfa Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sat, 30 Jul 2011 19:28:44 +0200 Subject: [PATCH 117/158] - compiling with translations works again --- po/en/minetest.pot | 113 --------------------------------------------- 1 file changed, 113 deletions(-) delete mode 100644 po/en/minetest.pot diff --git a/po/en/minetest.pot b/po/en/minetest.pot deleted file mode 100644 index 8fbac78..0000000 --- a/po/en/minetest.pot +++ /dev/null @@ -1,113 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-24 11:32+0300\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: src/guiMainMenu.cpp:180 -msgid "Name/Password" -msgstr "" - -#: src/guiMainMenu.cpp:203 -msgid "Address/Port" -msgstr "" - -#: src/guiMainMenu.cpp:223 -msgid "Leave address blank to start a local server." -msgstr "" - -#: src/guiMainMenu.cpp:230 -msgid "Fancy trees" -msgstr "" - -#: src/guiMainMenu.cpp:236 -msgid "Smooth Lighting" -msgstr "" - -#: src/guiMainMenu.cpp:244 -msgid "Start Game / Connect" -msgstr "" - -#: src/guiMainMenu.cpp:253 -msgid "Change keys" -msgstr "" - -#: src/guiMainMenu.cpp:276 -msgid "Creative Mode" -msgstr "" - -#: src/guiMainMenu.cpp:282 -msgid "Enable Damage" -msgstr "" - -#: src/guiMainMenu.cpp:290 -msgid "Delete map" -msgstr "" - -#: src/guiMessageMenu.cpp:93 src/guiTextInputMenu.cpp:111 -msgid "Proceed" -msgstr "" - -#: src/guiPasswordChange.cpp:102 -msgid "Old Password" -msgstr "" - -#: src/guiPasswordChange.cpp:117 -msgid "New Password" -msgstr "" - -#: src/guiPasswordChange.cpp:131 -msgid "Confirm Password" -msgstr "" - -#: src/guiPasswordChange.cpp:146 -msgid "Change" -msgstr "" - -#: src/guiPasswordChange.cpp:155 -msgid "Passwords do not match!" -msgstr "" - -#: src/guiPauseMenu.cpp:110 -msgid "Continue" -msgstr "" - -#: src/guiPauseMenu.cpp:117 -msgid "Change Password" -msgstr "" - -#: src/guiPauseMenu.cpp:124 -msgid "Disconnect" -msgstr "" - -#: src/guiPauseMenu.cpp:131 -msgid "Exit to OS" -msgstr "" - -#: src/guiPauseMenu.cpp:138 -msgid "" -"Keys:\n" -"- WASD: Walk\n" -"- Mouse left: dig blocks\n" -"- Mouse right: place blocks\n" -"- Mouse wheel: select item\n" -"- 0...9: select item\n" -"- Shift: sneak\n" -"- R: Toggle viewing all loaded chunks\n" -"- I: Inventory menu\n" -"- ESC: This menu\n" -"- T: Chat\n" -msgstr "" From 82ea53499710c9a4e92ec595d8c14c417bdd0ee6 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sat, 30 Jul 2011 19:30:43 +0200 Subject: [PATCH 118/158] * README updated --- README | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/README b/README index 82fcdd3..60601eb 100644 --- a/README +++ b/README @@ -1,27 +1,9 @@ Minetest Δ (“Minetest Delta”) is a fork of Minetest-c55 , incorporating experimental features that are not (yet) included in Minetest-c55. +Currently it is considered the unstable development branch of Minetest-c55, which means almost everything is merged upstream from Minetest Δ. New features: -* Submenu for key assignment -* configurable far mesh tree display (boolean) -* configurable far mesh rendering distance -* volumetric clouds (using fake shading) -* translation support (including questionable translation into german) -* build system uses local jthread & sqlite libraries if available - -New bricks: -* Sandstone (crafted from 4 sand, yields sand) -* Cactus (plant that grows on sand) -* Clay (found in sand at sea level, yields 4 lumps of clay) -* Brick (made from 4 clay bricks, yields 4 clay bricks) -* Papyrus (plant that grows in shallow water) -* Book shelf (made from 6 wood and 3 books, sandwhiched) -* Rail (made from 6 iron ingots and 3 sticks, vertically sandwhiched) - -New materials: -* Lump of clay -* Clay brick (made from lumps of clay in the furnace) -* Paper (made from 3 papyrus horizontally) -* Book (made from 3 paper vertically) +* refactored liquids (currently broken, water does not flow) +* translation support (including german, french, italian) Alternate graphics: * Player From edbcf7c0394758663712edf66d30bd578df6cc16 Mon Sep 17 00:00:00 2001 From: Wolfgang Fellger Date: Sat, 30 Jul 2011 20:35:55 +0200 Subject: [PATCH 119/158] * support for content types extension in minetestmapper --- util/colors.txt | 47 ++++++------ util/minetestmapper.py | 158 +++++++++++++++++++++++------------------ 2 files changed, 114 insertions(+), 91 deletions(-) diff --git a/util/colors.txt b/util/colors.txt index c16fd3e..2dceb91 100644 --- a/util/colors.txt +++ b/util/colors.txt @@ -1,21 +1,26 @@ -0 128 128 128 -1 107 134 51 -2 39 66 106 -3 255 255 0 -4 86 58 31 -5 48 95 8 -6 102 129 38 -7 178 178 0 -8 101 84 36 -9 39 66 106 -12 104 78 42 -13 210 194 156 -14 117 86 41 -15 128 79 0 -16 118 118 118 -18 123 123 123 -19 199 199 199 -20 183 183 222 -21 103 78 42 -22 108 138 108 -23 90 90 90 +0 128 128 128 # CONTENT_STONE +800 107 134 51 # CONTENT_GRASS +2 39 66 106 # CONTENT_WATER +3 255 255 0 # CONTENT_TORCH +801 86 58 31 # CONTENT_TREE +802 48 95 8 # CONTENT_LEAVES +803 102 129 38 # CONTENT_GRASS_FOOTSTEPS +804 178 178 0 # CONTENT_MESE +805 101 84 36 # CONTENT_MUD +9 39 66 106 # CONTENT_WATERSOURCE +808 104 78 42 # CONTENT_WOOD +809 210 194 156 # CONTENT_SAND +e 117 86 41 # CONTENT_SIGN_WALL +f 128 79 0 # CONTENT_CHEST +10 118 118 118 # CONTENT_FURNACE +80a 123 123 123 # CONTENT_COBBLE +80b 199 199 199 # CONTENT_STEEL +80c 183 183 222 # CONENT_GLASS +15 103 78 42 # CONTENT_FENCE +80d 219 202 178 # CONTENT_MOSSYCOBBLE +80e 78 154 6 # CONTENT_GRAVEL +80f 204 0 0 # CONTENT_SANDSTONE +810 211 215 207 # CONTENT_CACTUS +811 170 50 25 # CONTENT_BRICK +812 104 78 42 # CONTENT_CLAY +813 58 105 18 # CONTENT_PAPYRUS diff --git a/util/minetestmapper.py b/util/minetestmapper.py index 162ceb2..868f82c 100755 --- a/util/minetestmapper.py +++ b/util/minetestmapper.py @@ -13,6 +13,7 @@ # 2011-06-02: j0gge: command line parameters, coordinates, players, ... # 2011-06-04: celeron55: added #!/usr/bin/python2 and converted \r\n to \n # to make it easily executable on Linux +# 2011-07-30: WF: Support for content types extension, refactoring # Requires Python Imaging Library: http://www.pythonware.com/products/pil/ @@ -27,6 +28,33 @@ import string import time import getopt import sys +import array + +CONTENT_WATER = [2, 9] + +TRANSLATION_TABLE = { + 1: 0x800, # CONTENT_GRASS + 4: 0x801, # CONTENT_TREE + 5: 0x802, # CONTENT_LEAVES + 6: 0x803, # CONTENT_GRASS_FOOTSTEPS + 7: 0x804, # CONTENT_MESE + 8: 0x805, # CONTENT_MUD + 10: 0x806, # CONTENT_CLOUD + 11: 0x807, # CONTENT_COALSTONE + 12: 0x808, # CONTENT_WOOD + 13: 0x809, # CONTENT_SAND + 18: 0x80a, # CONTENT_COBBLE + 19: 0x80b, # CONTENT_STEEL + 20: 0x80c, # CONTENT_GLASS + 22: 0x80d, # CONTENT_MOSSYCOBBLE + 23: 0x80e, # CONTENT_GRAVEL + 24: 0x80f, #CONTENT_SANDSTONE + 25: 0x810, #CONTENT_CACTUS + 26: 0x811, #CONTENT_BRICK + 27: 0x812, #CONTENT_CLAY + 28: 0x813, #CONTENT_PAPYRUS + 29: 0x814 #CONTENT_BOOKSHELF +} def hex_to_int(h): i = int(h, 16) @@ -70,7 +98,7 @@ except getopt.GetoptError, err: sys.exit(2) path = "../world/" -output = "uloste.png" +output = "map.png" border = 0 scalecolor = "black" bgcolor = "white" @@ -119,14 +147,14 @@ colors = {} f = file("colors.txt") for line in f: values = string.split(line) - colors[int(values[0])] = (int(values[1]), int(values[2]), int(values[3])) + colors[int(values[0], 16)] = (int(values[1]), int(values[2]), int(values[3])) f.close() xlist = [] zlist = [] # List all sectors to memory and calculate the width and heigth of the resulting picture. -try: +if os.path.exists(path + "sectors2"): for filename in os.listdir(path + "sectors2"): for filename2 in os.listdir(path + "sectors2/" + filename): x = hex_to_int(filename) @@ -137,9 +165,8 @@ try: continue xlist.append(x) zlist.append(z) -except OSError: - pass -try: + +if os.path.exists(path + "sectors"): for filename in os.listdir(path + "sectors"): x = hex4_to_int(filename[:4]) z = hex4_to_int(filename[-4:]) @@ -149,8 +176,6 @@ try: continue xlist.append(x) zlist.append(z) -except OSError: - pass minx = min(xlist) minz = min(zlist) @@ -171,7 +196,54 @@ stuff = {} starttime = time.time() def data_is_air(d): - return (d == 254 or d == 126) + return d in [126, 127, 254] + +def read_blocknum(mapdata, version, datapos): + if version == 20: + if mapdata[datapos] < 0x80: + return mapdata[datapos] + else: + return (mapdata[datapos] << 4) | (mapdata[datapos + 0x2000] >> 4) + elif 16 <= version < 20: + return TRANSLATION_TABLE.get(mapdata[datapos], mapdata[datapos]) + else: + raise Exception("Unsupported map format: " + str(version)) + +def read_mapdata(f, version, pixellist, water): + global stuff # oh my :-) + + dec_o = zlib.decompressobj() + try: + mapdata = array.array("B", dec_o.decompress(f.read())) + except: + mapdata = [] + + f.close() + + if(len(mapdata) < 4096): + print "bad: " + xhex + "/" + zhex + "/" + yhex + " " + str(len(mapdata)) + else: + chunkxpos = xpos * 16 + chunkypos = ypos * 16 + chunkzpos = zpos * 16 + blocknum = 0 + datapos = 0 + for (x, z) in reversed(pixellist): + for y in reversed(range(16)): + datapos = x + y * 16 + z * 256 + blocknum = read_blocknum(mapdata, version, datapos) + if not data_is_air(blocknum) and blocknum in colors: + if blocknum in CONTENT_WATER: + water[(x, z)] += 1 + # Add dummy stuff for drawing sea without seabed + stuff[(chunkxpos + x, chunkzpos + z)] = (chunkypos + y, blocknum, water[(x, z)]) + else: + pixellist.remove((x, z)) + # Memorize information on the type and height of the block and for drawing the picture. + stuff[(chunkxpos + x, chunkzpos + z)] = (chunkypos + y, blocknum, water[(x, z)]) + break + elif not data_is_air(blocknum) and blocknum not in colors: + print "strange block: %s/%s/%s x: %d y: %d z: %d block id: %x" % (xhex, zhex, yhex, x, y, z, blocknum) # Go through all sectors. for n in range(len(xlist)): @@ -238,6 +310,7 @@ for n in range(len(xlist)): ylist.sort() + # Make a list of pixels of the sector that are to be looked for. pixellist = [] water = {} @@ -260,7 +333,8 @@ for n in range(len(xlist)): f = file(filename, "rb") - version = f.read(1) + # Let's just memorize these even though it's not really necessary. + version = ord(f.read(1)) flags = f.read(1) # Checking day and night differs -flag @@ -269,35 +343,7 @@ for n in range(len(xlist)): f.close() continue - dec_o = zlib.decompressobj() - try: - mapdata = dec_o.decompress(f.read()) - except: - mapdata = [] - - f.close() - - if(len(mapdata) < 4096): - print "bad: " + xhex + "/" + zhex + "/" + yhex + " " + str(len(mapdata)) - else: - chunkxpos = xpos * 16 - chunkypos = ypos * 16 - chunkzpos = zpos * 16 - for (x, z) in reversed(pixellist): - for y in reversed(range(16)): - datapos = x + y * 16 + z * 256 - if(not data_is_air(ord(mapdata[datapos])) and ord(mapdata[datapos]) in colors): - if(ord(mapdata[datapos]) == 2 or ord(mapdata[datapos]) == 9): - water[(x, z)] += 1 - # Add dummy stuff for drawing sea without seabed - stuff[(chunkxpos + x, chunkzpos + z)] = (chunkypos + y, ord(mapdata[datapos]), water[(x, z)]) - else: - pixellist.remove((x, z)) - # Memorize information on the type and height of the block and for drawing the picture. - stuff[(chunkxpos + x, chunkzpos + z)] = (chunkypos + y, ord(mapdata[datapos]), water[(x, z)]) - break - elif(not data_is_air(ord(mapdata[datapos])) and ord(mapdata[datapos]) not in colors): - print "strange block: " + xhex + "/" + zhex + "/" + yhex + " x: " + str(x) + " y: " + str(y) + " z: " + str(z) + " palikka: " + str(ord(mapdata[datapos])) + read_mapdata(f, version, pixellist, water) # After finding all the pixels in the sector, we can move on to the next sector without having to continue the Y axis. if(len(pixellist) == 0): @@ -307,38 +353,10 @@ for n in range(len(xlist)): for (ypos, filename) in ylist2: f = file(filename, "rb") - version = f.read(1) + version = ord(f.read(1)) flags = f.read(1) - - dec_o = zlib.decompressobj() - try: - mapdata = dec_o.decompress(f.read()) - except: - mapdata = [] - - f.close() - if(len(mapdata) < 4096): - print "bad: " + xhex + "/" + zhex + "/" + yhex + " " + str(len(mapdata)) - else: - chunkxpos = xpos * 16 - chunkypos = ypos * 16 - chunkzpos = zpos * 16 - for (x, z) in reversed(pixellist): - for y in reversed(range(16)): - datapos = x + y * 16 + z * 256 - if(not data_is_air(ord(mapdata[datapos])) and ord(mapdata[datapos]) in colors): - if(ord(mapdata[datapos]) == 2 or ord(mapdata[datapos]) == 9): - water[(x, z)] += 1 - # Add dummy stuff for drawing sea without seabed - stuff[(chunkxpos + x, chunkzpos + z)] = (chunkypos + y, ord(mapdata[datapos]), water[(x, z)]) - else: - pixellist.remove((x, z)) - # Memorize information on the type and height of the block and for drawing the picture. - stuff[(chunkxpos + x, chunkzpos + z)] = (chunkypos + y, ord(mapdata[datapos]), water[(x, z)]) - break - elif(not data_is_air(ord(mapdata[datapos])) and ord(mapdata[datapos]) not in colors): - print "outo palikka: " + xhex + "/" + zhex + "/" + yhex + " x: " + str(x) + " y: " + str(y) + " z: " + str(z) + " palikka: " + str(ord(mapdata[datapos])) + read_mapdata(f, version, pixellist, water) # After finding all the pixels in the sector, we can move on to the next sector without having to continue the Y axis. if(len(pixellist) == 0): @@ -375,7 +393,7 @@ for (x, z) in stuff.iterkeys(): c1 = stuff[(x - 1, z)][1] c2 = stuff[(x, z + 1)][1] c = stuff[(x, z)][1] - if c1 != 2 and c1 != 9 and c2 != 2 and c2 != 9 and c != 2 and c != 9: + if c1 not in CONTENT_WATER and c2 not in CONTENT_WATER and c not in CONTENT_WATER: y1 = stuff[(x - 1, z)][0] y2 = stuff[(x, z + 1)][0] y = stuff[(x, z)][0] From 17830c5894fb6c2bbae73c3ce1046f8783b15e04 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sat, 30 Jul 2011 20:37:53 +0200 Subject: [PATCH 120/158] - removed old minetestmapper --- minetestmapper/colors.txt | 25 --- minetestmapper/minetestmapper2.py | 275 ------------------------------ 2 files changed, 300 deletions(-) delete mode 100644 minetestmapper/colors.txt delete mode 100755 minetestmapper/minetestmapper2.py diff --git a/minetestmapper/colors.txt b/minetestmapper/colors.txt deleted file mode 100644 index e70f56e..0000000 --- a/minetestmapper/colors.txt +++ /dev/null @@ -1,25 +0,0 @@ -0 128 128 128 -1 107 134 51 -2 39 66 106 -3 255 255 0 -4 86 58 31 -5 48 95 8 -6 102 129 38 -7 178 178 0 -8 101 84 36 -9 39 66 106 -12 104 78 42 -13 210 194 156 -14 117 86 41 -15 128 79 0 -16 118 118 118 -18 123 123 123 -19 199 199 199 -20 183 183 222 -21 103 78 42 -22 219 202 178 -23 78 154 6 -24 204 0 0 -25 211 215 207 -26 138 226 52 -27 104 78 42 diff --git a/minetestmapper/minetestmapper2.py b/minetestmapper/minetestmapper2.py deleted file mode 100755 index 8dc3de2..0000000 --- a/minetestmapper/minetestmapper2.py +++ /dev/null @@ -1,275 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# Made by j0gge, modified by celeron55 - -# This program is free software. It comes without any warranty, to -# the extent permitted by applicable law. You can redistribute it -# and/or modify it under the terms of the Do What The Fuck You Want -# To Public License, Version 2, as published by Sam Hocevar. See -# http://sam.zoy.org/wtfpl/COPYING for more details. - -# Requires Python Imaging Library: http://www.pythonware.com/products/pil/ - -# Some speed-up: ...lol, actually it slows it down. -#import psyco ; psyco.full() -#from psyco.classes import * - -import zlib -import Image, ImageDraw -import os -import string -import time - -def hex_to_int(h): - i = int(h,16) - if(i > 2047): - i-=4096 - return i - -def hex4_to_int(h): - i = int(h,16) - if(i > 32767): - i-=65536 - return i - -def int_to_hex3(i): - if(i < 0): - return "%03X" % (i + 4096) - else: - return "%03X" % i - -def int_to_hex4(i): - if(i < 0): - return "%04X" % (i + 65536) - else: - return "%04X" % i - -def limit(i,l,h): - if(i>h): - i=h - if(i sector_xmax: - continue - if z < sector_zmin or z > sector_zmax: - continue - xlist.append(x) - zlist.append(z) - -if os.path.exists(path + "sectors"): - for filename in os.listdir(path + "sectors"): - x = hex4_to_int(filename[:4]) - z = hex4_to_int(filename[-4:]) - if x < sector_xmin or x > sector_xmax: - continue - if z < sector_zmin or z > sector_zmax: - continue - xlist.append(x) - zlist.append(z) - -w = (max(xlist) - min(xlist)) * 16 + 16 -h = (max(zlist) - min(zlist)) * 16 + 16 - -print "w="+str(w)+" h="+str(h) - -im = Image.new("RGB", (w, h), "white") -impix = im.load() - -stuff={} - -starttime = time.time() - -# Go through all sectors. -for n in range(len(xlist)): - #if n > 500: - # break - if n % 200 == 0: - nowtime = time.time() - dtime = nowtime - starttime - n_per_second = 1.0 * n / dtime - if n_per_second != 0: - seconds_per_n = 1.0 / n_per_second - time_guess = seconds_per_n * len(xlist) - remaining_s = time_guess - dtime - remaining_minutes = int(remaining_s / 60) - remaining_s -= remaining_minutes * 60; - print("Processing sector "+str(n)+" of "+str(len(xlist)) - +" ("+str(round(100.0*n/len(xlist), 1))+"%)" - +" (ETA: "+str(remaining_minutes)+"m " - +str(int(remaining_s))+"s)") - - xpos = xlist[n] - zpos = zlist[n] - - xhex = int_to_hex3(xpos) - zhex = int_to_hex3(zpos) - xhex4 = int_to_hex4(xpos) - zhex4 = int_to_hex4(zpos) - - sector1 = xhex4.lower() + zhex4.lower() - sector2 = xhex.lower() + "/" + zhex.lower() - - ylist=[] - - sectortype = "" - - try: - for filename in os.listdir(path + "sectors/" + sector1): - if(filename != "meta"): - pos = int(filename,16) - if(pos > 32767): - pos-=65536 - ylist.append(pos) - sectortype = "old" - except OSError: - pass - - if sectortype != "old": - try: - for filename in os.listdir(path + "sectors2/" + sector2): - if(filename != "meta"): - pos = int(filename,16) - if(pos > 32767): - pos-=65536 - ylist.append(pos) - sectortype = "new" - except OSError: - pass - - if sectortype == "": - continue - - ylist.sort() - - # Make a list of pixels of the sector that are to be looked for. - pixellist = [] - for x in range(16): - for y in range(16): - pixellist.append((x,y)) - - # Go through the Y axis from top to bottom. - for ypos in reversed(ylist): - - yhex = int_to_hex4(ypos) - - filename = "" - if sectortype == "old": - filename = path + "sectors/" + sector1 + "/" + yhex.lower() - else: - filename = path + "sectors2/" + sector2 + "/" + yhex.lower() - - f = file(filename, "rb") - - # Let's just memorize these even though it's not really necessary. - version = f.read(1) - flags = f.read(1) - - dec_o = zlib.decompressobj() - try: - mapdata = dec_o.decompress(f.read()) - except: - mapdata = [] - - f.close() - - if(len(mapdata)<4096): - print "bad: " + xhex+zhex+"/"+yhex + " " + len(mapdata) - else: - chunkxpos=xpos*16 - chunkypos=ypos*16 - chunkzpos=zpos*16 - for (x,z) in reversed(pixellist): - for y in reversed(range(16)): - datapos=x+y*16+z*256 - if(ord(mapdata[datapos])!=254): - try: - pixellist.remove((x,z)) - # Memorize information on the type and height of the block and for drawing the picture. - stuff[(chunkxpos+x,chunkzpos+z)]=(chunkypos+y,ord(mapdata[datapos])) - break - except: - print "strange block: " + xhex+zhex+"/"+yhex + " x: " + str(x) + " y: " + str(y) + " z: " + str(z) + " block: " + str(ord(mapdata[datapos])) - - # After finding all the pixeld in the sector, we can move on to the next sector without having to continue the Y axis. - if(len(pixellist)==0): - break - -print "Drawing image" -# Drawing the picture -starttime = time.time() -n = 0 -minx = min(xlist) -minz = min(zlist) -for (x,z) in stuff.iterkeys(): - if n % 500000 == 0: - nowtime = time.time() - dtime = nowtime - starttime - n_per_second = 1.0 * n / dtime - if n_per_second != 0: - listlen = len(stuff) - seconds_per_n = 1.0 / n_per_second - time_guess = seconds_per_n * listlen - remaining_s = time_guess - dtime - remaining_minutes = int(remaining_s / 60) - remaining_s -= remaining_minutes * 60; - print("Drawing pixel "+str(n)+" of "+str(listlen) - +" ("+str(round(100.0*n/listlen, 1))+"%)" - +" (ETA: "+str(remaining_minutes)+"m " - +str(int(remaining_s))+"s)") - n += 1 - - (r,g,b)=colors[stuff[(x,z)][1]] - - # Comparing heights of a couple of adjacent blocks and changing brightness accordingly. - try: - y1=stuff[(x-1,z)][0] - y2=stuff[(x,z-1)][0] - y=stuff[(x,z)][0] - - d=(y-y1+y-y2)*12 - - if(d>36): - d=36 - - r=limit(r+d,0,255) - g=limit(g+d,0,255) - b=limit(b+d,0,255) - except: - pass - #impix[w-1-(x-minx*16),h-1-(z-minz*16)]=(r,g,b) - impix[x-minx*16,h-1-(z-minz*16)]=(r,g,b) - -# Flip the picture to make it right and save. -#print "Transposing" -#im=im.transpose(Image.FLIP_TOP_BOTTOM) -print "Saving" -im.save(output) From 4681392bace0f72bdbff21c2bb805e04e010e43f Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sat, 30 Jul 2011 21:05:33 +0200 Subject: [PATCH 121/158] * PEP 8 compliance --- util/minetestmapper.py | 699 +++++++++++++++++++++-------------------- 1 file changed, 365 insertions(+), 334 deletions(-) diff --git a/util/minetestmapper.py b/util/minetestmapper.py index 868f82c..5b17551 100755 --- a/util/minetestmapper.py +++ b/util/minetestmapper.py @@ -9,93 +9,101 @@ # Made by Jogge, modified by celeron55 # 2011-05-29: j0gge: initial release -# 2011-05-30: celeron55: simultaneous support for sectors/sectors2, removed +# 2011-05-30: celeron55: simultaneous support for sectors/sectors2, removed # 2011-06-02: j0gge: command line parameters, coordinates, players, ... # 2011-06-04: celeron55: added #!/usr/bin/python2 and converted \r\n to \n # to make it easily executable on Linux # 2011-07-30: WF: Support for content types extension, refactoring +# 2011-07-30: erlehmann: PEP 8 compliance. # Requires Python Imaging Library: http://www.pythonware.com/products/pil/ # Some speed-up: ...lol, actually it slows it down. -#import psyco ; psyco.full() +#import psyco ; psyco.full() #from psyco.classes import * import zlib -import Image, ImageDraw, ImageFont, ImageColor import os import string import time import getopt import sys import array +from PIL import Image, ImageDraw, ImageFont, ImageColor CONTENT_WATER = [2, 9] TRANSLATION_TABLE = { - 1: 0x800, # CONTENT_GRASS - 4: 0x801, # CONTENT_TREE - 5: 0x802, # CONTENT_LEAVES - 6: 0x803, # CONTENT_GRASS_FOOTSTEPS - 7: 0x804, # CONTENT_MESE - 8: 0x805, # CONTENT_MUD - 10: 0x806, # CONTENT_CLOUD - 11: 0x807, # CONTENT_COALSTONE - 12: 0x808, # CONTENT_WOOD - 13: 0x809, # CONTENT_SAND - 18: 0x80a, # CONTENT_COBBLE - 19: 0x80b, # CONTENT_STEEL - 20: 0x80c, # CONTENT_GLASS - 22: 0x80d, # CONTENT_MOSSYCOBBLE - 23: 0x80e, # CONTENT_GRAVEL - 24: 0x80f, #CONTENT_SANDSTONE - 25: 0x810, #CONTENT_CACTUS - 26: 0x811, #CONTENT_BRICK - 27: 0x812, #CONTENT_CLAY - 28: 0x813, #CONTENT_PAPYRUS - 29: 0x814 #CONTENT_BOOKSHELF -} + 1: 0x800, # CONTENT_GRASS + 4: 0x801, # CONTENT_TREE + 5: 0x802, # CONTENT_LEAVES + 6: 0x803, # CONTENT_GRASS_FOOTSTEPS + 7: 0x804, # CONTENT_MESE + 8: 0x805, # CONTENT_MUD + 10: 0x806, # CONTENT_CLOUD + 11: 0x807, # CONTENT_COALSTONE + 12: 0x808, # CONTENT_WOOD + 13: 0x809, # CONTENT_SAND + 18: 0x80a, # CONTENT_COBBLE + 19: 0x80b, # CONTENT_STEEL + 20: 0x80c, # CONTENT_GLASS + 22: 0x80d, # CONTENT_MOSSYCOBBLE + 23: 0x80e, # CONTENT_GRAVEL + 24: 0x80f, # CONTENT_SANDSTONE + 25: 0x810, # CONTENT_CACTUS + 26: 0x811, # CONTENT_BRICK + 27: 0x812, # CONTENT_CLAY + 28: 0x813, # CONTENT_PAPYRUS + 29: 0x814} # CONTENT_BOOKSHELF + def hex_to_int(h): - i = int(h, 16) - if(i > 2047): - i -= 4096 - return i + i = int(h, 16) + if(i > 2047): + i -= 4096 + return i + def hex4_to_int(h): - i = int(h, 16) - if(i > 32767): - i -= 65536 - return i + i = int(h, 16) + if(i > 32767): + i -= 65536 + return i + def int_to_hex3(i): - if(i < 0): - return "%03X" % (i + 4096) - else: - return "%03X" % i + if(i < 0): + return "%03X" % (i + 4096) + else: + return "%03X" % i + def int_to_hex4(i): - if(i < 0): - return "%04X" % (i + 65536) - else: - return "%04X" % i + if(i < 0): + return "%04X" % (i + 65536) + else: + return "%04X" % i + def limit(i, l, h): - if(i > h): - i = h - if(i < l): - i = l - return i + if(i > h): + i = h + if(i < l): + i = l + return i + def usage(): - print "TODO: Help" + print "TODO: Help" try: - opts, args = getopt.getopt(sys.argv[1:], "hi:o:", ["help", "input=", "output=", "bgcolor=", "scalecolor=", "origincolor=", "playercolor=", "draworigin", "drawplayers", "drawscale"]) + opts, args = getopt.getopt(sys.argv[1:], "hi:o:", ["help", "input=", + "output=", "bgcolor=", "scalecolor=", "origincolor=", + "playercolor=", "draworigin", "drawplayers", "drawscale"]) except getopt.GetoptError, err: - # print help information and exit: - print str(err) # will print something like "option -a not recognized" - usage() - sys.exit(2) + # print help information and exit: + print str(err) # will print something like "option -a not recognized" + usage() + sys.exit(2) path = "../world/" output = "map.png" @@ -114,68 +122,72 @@ sector_zmin = -1500 / 16 sector_zmax = 1500 / 16 for o, a in opts: - if o in ("-h", "--help"): - usage() - sys.exit() - elif o in ("-i", "--input"): - path = a - elif o in ("-o", "--output"): - output = a - elif o == "--bgcolor": - bgcolor = ImageColor.getrgb(a) - elif o == "--scalecolor": - scalecolor = ImageColor.getrgb(a) - elif o == "--playercolor": - playercolor = ImageColor.getrgb(a) - elif o == "--origincolor": - origincolor = ImageColor.getrgb(a) - elif o == "--drawscale": - drawscale = True - border = 40 - elif o == "--drawplayers": - drawplayers = True - elif o == "--draworigin": - draworigin = True - else: - assert False, "unhandled option" - -if path[-1:]!="/" and path[-1:]!="\\": - path = path + "/" + if o in ("-h", "--help"): + usage() + sys.exit() + elif o in ("-i", "--input"): + path = a + elif o in ("-o", "--output"): + output = a + elif o == "--bgcolor": + bgcolor = ImageColor.getrgb(a) + elif o == "--scalecolor": + scalecolor = ImageColor.getrgb(a) + elif o == "--playercolor": + playercolor = ImageColor.getrgb(a) + elif o == "--origincolor": + origincolor = ImageColor.getrgb(a) + elif o == "--drawscale": + drawscale = True + border = 40 + elif o == "--drawplayers": + drawplayers = True + elif o == "--draworigin": + draworigin = True + else: + assert False, "unhandled option" + +if path[-1:] != "/" and path[-1:] != "\\": + path = path + "/" # Load color information for the blocks. colors = {} f = file("colors.txt") for line in f: - values = string.split(line) - colors[int(values[0], 16)] = (int(values[1]), int(values[2]), int(values[3])) + values = string.split(line) + colors[int(values[0], 16)] = ( + int(values[1]), + int(values[2]), + int(values[3])) f.close() xlist = [] zlist = [] -# List all sectors to memory and calculate the width and heigth of the resulting picture. +# List all sectors to memory and calculate the width and heigth of the +# resulting picture. if os.path.exists(path + "sectors2"): - for filename in os.listdir(path + "sectors2"): - for filename2 in os.listdir(path + "sectors2/" + filename): - x = hex_to_int(filename) - z = hex_to_int(filename2) - if x < sector_xmin or x > sector_xmax: - continue - if z < sector_zmin or z > sector_zmax: - continue - xlist.append(x) - zlist.append(z) + for filename in os.listdir(path + "sectors2"): + for filename2 in os.listdir(path + "sectors2/" + filename): + x = hex_to_int(filename) + z = hex_to_int(filename2) + if x < sector_xmin or x > sector_xmax: + continue + if z < sector_zmin or z > sector_zmax: + continue + xlist.append(x) + zlist.append(z) if os.path.exists(path + "sectors"): - for filename in os.listdir(path + "sectors"): - x = hex4_to_int(filename[:4]) - z = hex4_to_int(filename[-4:]) - if x < sector_xmin or x > sector_xmax: - continue - if z < sector_zmin or z > sector_zmax: - continue - xlist.append(x) - zlist.append(z) + for filename in os.listdir(path + "sectors"): + x = hex4_to_int(filename[:4]) + z = hex4_to_int(filename[-4:]) + if x < sector_xmin or x > sector_xmax: + continue + if z < sector_zmin or z > sector_zmax: + continue + xlist.append(x) + zlist.append(z) minx = min(xlist) minz = min(zlist) @@ -185,7 +197,7 @@ maxz = max(zlist) w = (maxx - minx) * 16 + 16 h = (maxz - minz) * 16 + 16 -print "w="+str(w)+" h="+str(h) +print "w=" + str(w) + " h=" + str(h) im = Image.new("RGB", (w + border, h + border), bgcolor) draw = ImageDraw.Draw(im) @@ -195,271 +207,290 @@ stuff = {} starttime = time.time() + def data_is_air(d): - return d in [126, 127, 254] + return d in [126, 127, 254] + def read_blocknum(mapdata, version, datapos): - if version == 20: - if mapdata[datapos] < 0x80: - return mapdata[datapos] - else: - return (mapdata[datapos] << 4) | (mapdata[datapos + 0x2000] >> 4) - elif 16 <= version < 20: - return TRANSLATION_TABLE.get(mapdata[datapos], mapdata[datapos]) - else: - raise Exception("Unsupported map format: " + str(version)) + if version == 20: + if mapdata[datapos] < 0x80: + return mapdata[datapos] + else: + return (mapdata[datapos] << 4) | (mapdata[datapos + 0x2000] >> 4) + elif 16 <= version < 20: + return TRANSLATION_TABLE.get(mapdata[datapos], mapdata[datapos]) + else: + raise Exception("Unsupported map format: " + str(version)) + def read_mapdata(f, version, pixellist, water): - global stuff # oh my :-) - - dec_o = zlib.decompressobj() - try: - mapdata = array.array("B", dec_o.decompress(f.read())) - except: - mapdata = [] - - f.close() - - if(len(mapdata) < 4096): - print "bad: " + xhex + "/" + zhex + "/" + yhex + " " + str(len(mapdata)) - else: - chunkxpos = xpos * 16 - chunkypos = ypos * 16 - chunkzpos = zpos * 16 - blocknum = 0 - datapos = 0 - for (x, z) in reversed(pixellist): - for y in reversed(range(16)): - datapos = x + y * 16 + z * 256 - blocknum = read_blocknum(mapdata, version, datapos) - if not data_is_air(blocknum) and blocknum in colors: - if blocknum in CONTENT_WATER: - water[(x, z)] += 1 - # Add dummy stuff for drawing sea without seabed - stuff[(chunkxpos + x, chunkzpos + z)] = (chunkypos + y, blocknum, water[(x, z)]) - else: - pixellist.remove((x, z)) - # Memorize information on the type and height of the block and for drawing the picture. - stuff[(chunkxpos + x, chunkzpos + z)] = (chunkypos + y, blocknum, water[(x, z)]) - break - elif not data_is_air(blocknum) and blocknum not in colors: - print "strange block: %s/%s/%s x: %d y: %d z: %d block id: %x" % (xhex, zhex, yhex, x, y, z, blocknum) + global stuff # oh my :-) + + dec_o = zlib.decompressobj() + try: + mapdata = array.array("B", dec_o.decompress(f.read())) + except: + mapdata = [] + + f.close() + + if(len(mapdata) < 4096): + print "bad: " + xhex + "/" + zhex + "/" + yhex + " " + \ + str(len(mapdata)) + else: + chunkxpos = xpos * 16 + chunkypos = ypos * 16 + chunkzpos = zpos * 16 + blocknum = 0 + datapos = 0 + for (x, z) in reversed(pixellist): + for y in reversed(range(16)): + datapos = x + y * 16 + z * 256 + blocknum = read_blocknum(mapdata, version, datapos) + if not data_is_air(blocknum) and blocknum in colors: + if blocknum in CONTENT_WATER: + water[(x, z)] += 1 + # Add dummy stuff for drawing sea without seabed + stuff[(chunkxpos + x, chunkzpos + z)] = ( + chunkypos + y, blocknum, water[(x, z)]) + else: + pixellist.remove((x, z)) + # Memorize information on the type and height of + # the block and for drawing the picture. + stuff[(chunkxpos + x, chunkzpos + z)] = ( + chunkypos + y, blocknum, water[(x, z)]) + break + elif not data_is_air(blocknum) and blocknum not in colors: + print "strange block: %s/%s/%s x: %d y: %d z: %d \ +block id: %x" % (xhex, zhex, yhex, x, y, z, blocknum) # Go through all sectors. for n in range(len(xlist)): - #if n > 500: - # break - if n % 200 == 0: - nowtime = time.time() - dtime = nowtime - starttime - try: - n_per_second = 1.0 * n / dtime - except ZeroDivisionError: - n_per_second = 0 - if n_per_second != 0: - seconds_per_n = 1.0 / n_per_second - time_guess = seconds_per_n * len(xlist) - remaining_s = time_guess - dtime - remaining_minutes = int(remaining_s / 60) - remaining_s -= remaining_minutes * 60; - print("Processing sector "+str(n)+" of "+str(len(xlist)) - +" ("+str(round(100.0*n/len(xlist), 1))+"%)" - +" (ETA: "+str(remaining_minutes)+"m " - +str(int(remaining_s))+"s)") + #if n > 500: + # break + if n % 200 == 0: + nowtime = time.time() + dtime = nowtime - starttime + try: + n_per_second = 1.0 * n / dtime + except ZeroDivisionError: + n_per_second = 0 + if n_per_second != 0: + seconds_per_n = 1.0 / n_per_second + time_guess = seconds_per_n * len(xlist) + remaining_s = time_guess - dtime + remaining_minutes = int(remaining_s / 60) + remaining_s -= remaining_minutes * 60 + print("Processing sector " + str(n) + " of " + str(len(xlist)) + + " (" + str(round(100.0 * n / len(xlist), 1)) + "%)" + + " (ETA: " + str(remaining_minutes) + "m " + + str(int(remaining_s)) + "s)") - xpos = xlist[n] - zpos = zlist[n] - - xhex = int_to_hex3(xpos) - zhex = int_to_hex3(zpos) - xhex4 = int_to_hex4(xpos) - zhex4 = int_to_hex4(zpos) - - sector1 = xhex4.lower() + zhex4.lower() - sector2 = xhex.lower() + "/" + zhex.lower() - - ylist = [] - - sectortype = "" - - try: - for filename in os.listdir(path + "sectors/" + sector1): - if(filename != "meta"): - pos = int(filename, 16) - if(pos > 32767): - pos -= 65536 - ylist.append(pos) - sectortype = "old" - except OSError: - pass - - if sectortype != "old": - try: - for filename in os.listdir(path + "sectors2/" + sector2): - if(filename != "meta"): - pos = int(filename, 16) - if(pos > 32767): - pos -= 65536 - ylist.append(pos) - sectortype = "new" - except OSError: - pass - - if sectortype == "": - continue + xpos = xlist[n] + zpos = zlist[n] - ylist.sort() - - - # Make a list of pixels of the sector that are to be looked for. - pixellist = [] - water = {} - for x in range(16): - for z in range(16): - pixellist.append((x, z)) - water[(x, z)] = 0 - - # Go through the Y axis from top to bottom. - ylist2=[] - for ypos in reversed(ylist): - - yhex = int_to_hex4(ypos) + xhex = int_to_hex3(xpos) + zhex = int_to_hex3(zpos) + xhex4 = int_to_hex4(xpos) + zhex4 = int_to_hex4(zpos) - filename = "" - if sectortype == "old": - filename = path + "sectors/" + sector1 + "/" + yhex.lower() - else: - filename = path + "sectors2/" + sector2 + "/" + yhex.lower() + sector1 = xhex4.lower() + zhex4.lower() + sector2 = xhex.lower() + "/" + zhex.lower() - f = file(filename, "rb") + ylist = [] - # Let's just memorize these even though it's not really necessary. - version = ord(f.read(1)) - flags = f.read(1) - - # Checking day and night differs -flag - if not ord(flags) & 2: - ylist2.append((ypos,filename)) - f.close() - continue + sectortype = "" - read_mapdata(f, version, pixellist, water) - - # After finding all the pixels in the sector, we can move on to the next sector without having to continue the Y axis. - if(len(pixellist) == 0): - break - - if len(pixellist) > 0: - for (ypos, filename) in ylist2: - f = file(filename, "rb") + try: + for filename in os.listdir(path + "sectors/" + sector1): + if(filename != "meta"): + pos = int(filename, 16) + if(pos > 32767): + pos -= 65536 + ylist.append(pos) + sectortype = "old" + except OSError: + pass - version = ord(f.read(1)) - flags = f.read(1) - - read_mapdata(f, version, pixellist, water) - - # After finding all the pixels in the sector, we can move on to the next sector without having to continue the Y axis. - if(len(pixellist) == 0): - break + if sectortype != "old": + try: + for filename in os.listdir(path + "sectors2/" + sector2): + if(filename != "meta"): + pos = int(filename, 16) + if(pos > 32767): + pos -= 65536 + ylist.append(pos) + sectortype = "new" + except OSError: + pass + + if sectortype == "": + continue + + ylist.sort() + + # Make a list of pixels of the sector that are to be looked for. + pixellist = [] + water = {} + for x in range(16): + for z in range(16): + pixellist.append((x, z)) + water[(x, z)] = 0 + + # Go through the Y axis from top to bottom. + ylist2 = [] + for ypos in reversed(ylist): + + yhex = int_to_hex4(ypos) + + filename = "" + if sectortype == "old": + filename = path + "sectors/" + sector1 + "/" + yhex.lower() + else: + filename = path + "sectors2/" + sector2 + "/" + yhex.lower() + + f = file(filename, "rb") + + # Let's just memorize these even though it's not really necessary. + version = ord(f.read(1)) + flags = f.read(1) + + # Checking day and night differs -flag + if not ord(flags) & 2: + ylist2.append((ypos, filename)) + f.close() + continue + + read_mapdata(f, version, pixellist, water) + + # After finding all the pixels in the sector, we can move on to + # the next sector without having to continue the Y axis. + if(len(pixellist) == 0): + break + + if len(pixellist) > 0: + for (ypos, filename) in ylist2: + f = file(filename, "rb") + + version = ord(f.read(1)) + flags = f.read(1) + + read_mapdata(f, version, pixellist, water) + + # After finding all the pixels in the sector, we can move on + # to the next sector without having to continue the Y axis. + if(len(pixellist) == 0): + break print "Drawing image" # Drawing the picture starttime = time.time() n = 0 for (x, z) in stuff.iterkeys(): - if n % 500000 == 0: - nowtime = time.time() - dtime = nowtime - starttime - try: - n_per_second = 1.0 * n / dtime - except ZeroDivisionError: - n_per_second = 0 - if n_per_second != 0: - listlen = len(stuff) - seconds_per_n = 1.0 / n_per_second - time_guess = seconds_per_n * listlen - remaining_s = time_guess - dtime - remaining_minutes = int(remaining_s / 60) - remaining_s -= remaining_minutes * 60; - print("Drawing pixel "+str(n)+" of "+str(listlen) - +" ("+str(round(100.0*n/listlen, 1))+"%)" - +" (ETA: "+str(remaining_minutes)+"m " - +str(int(remaining_s))+"s)") - n += 1 + if n % 500000 == 0: + nowtime = time.time() + dtime = nowtime - starttime + try: + n_per_second = 1.0 * n / dtime + except ZeroDivisionError: + n_per_second = 0 + if n_per_second != 0: + listlen = len(stuff) + seconds_per_n = 1.0 / n_per_second + time_guess = seconds_per_n * listlen + remaining_s = time_guess - dtime + remaining_minutes = int(remaining_s / 60) + remaining_s -= remaining_minutes * 60 + print("Drawing pixel " + str(n) + " of " + str(listlen) + + " (" + str(round(100.0 * n / listlen, 1)) + "%)" + + " (ETA: " + str(remaining_minutes) + "m " + + str(int(remaining_s)) + "s)") + n += 1 - (r, g, b) = colors[stuff[(x,z)][1]] - # Comparing heights of a couple of adjacent blocks and changing brightness accordingly. - try: - c1 = stuff[(x - 1, z)][1] - c2 = stuff[(x, z + 1)][1] - c = stuff[(x, z)][1] - if c1 not in CONTENT_WATER and c2 not in CONTENT_WATER and c not in CONTENT_WATER: - y1 = stuff[(x - 1, z)][0] - y2 = stuff[(x, z + 1)][0] - y = stuff[(x, z)][0] - - d = ((y - y1) + (y - y2)) * 12 - else: - d = 0 - - if(d > 36): - d = 36 - - r = limit(r + d, 0, 255) - g = limit(g + d, 0, 255) - b = limit(b + d, 0, 255) - except: - pass - - # Water - if(stuff[(x,z)][2] > 0): - r=int(r * .15 + colors[2][0] * .85) - g=int(g * .15 + colors[2][1] * .85) - b=int(b * .15 + colors[2][2] * .85) - - impix[x - minx * 16 + border, h - 1 - (z - minz * 16) + border] = (r, g, b) + (r, g, b) = colors[stuff[(x, z)][1]] + # Comparing heights of a couple of adjacent blocks and changing + # brightness accordingly. + try: + c1 = stuff[(x - 1, z)][1] + c2 = stuff[(x, z + 1)][1] + c = stuff[(x, z)][1] + if c1 not in CONTENT_WATER and c2 not in CONTENT_WATER and \ + c not in CONTENT_WATER: + y1 = stuff[(x - 1, z)][0] + y2 = stuff[(x, z + 1)][0] + y = stuff[(x, z)][0] + + d = ((y - y1) + (y - y2)) * 12 + else: + d = 0 + + if(d > 36): + d = 36 + + r = limit(r + d, 0, 255) + g = limit(g + d, 0, 255) + b = limit(b + d, 0, 255) + except: + pass + + # Water + if(stuff[(x, z)][2] > 0): + r = int(r * .15 + colors[2][0] * .85) + g = int(g * .15 + colors[2][1] * .85) + b = int(b * .15 + colors[2][2] * .85) + + impix[x - minx * 16 + border, h - 1 - (z - minz * 16) + border] = (r, g, b) if draworigin: - draw.ellipse((minx * -16 - 5 + border, h - minz * -16 - 6 + border, minx * -16 + 5 + border, h - minz * -16 + 4 + border), outline = origincolor) + draw.ellipse((minx * -16 - 5 + border, h - minz * -16 - 6 + border, + minx * -16 + 5 + border, h - minz * -16 + 4 + border), + outline=origincolor) font = ImageFont.load_default() if drawscale: - draw.text((24, 0), "X", font = font, fill = scalecolor) - draw.text((2, 24), "Z", font = font, fill = scalecolor) + draw.text((24, 0), "X", font=font, fill=scalecolor) + draw.text((2, 24), "Z", font=font, fill=scalecolor) - for n in range(int(minx / -4) * -4, maxx, 4): - draw.text((minx * -16 + n * 16 + 2 + border, 0), str(n * 16), font = font, fill = scalecolor) - draw.line((minx * -16 + n * 16 + border, 0, minx * -16 + n * 16 + border, border - 1), fill = scalecolor) + for n in range(int(minx / -4) * -4, maxx, 4): + draw.text((minx * -16 + n * 16 + 2 + border, 0), str(n * 16), + font=font, fill=scalecolor) + draw.line((minx * -16 + n * 16 + border, 0, + minx * -16 + n * 16 + border, border - 1), fill=scalecolor) - for n in range(int(maxz / 4) * 4, minz, -4): - draw.text((2, h - 1 - (n * 16 - minz * 16) + border), str(n * 16), font = font, fill = scalecolor) - draw.line((0, h - 1 - (n * 16 - minz * 16) + border, border - 1, h - 1 - (n * 16 - minz * 16) + border), fill = scalecolor) + for n in range(int(maxz / 4) * 4, minz, -4): + draw.text((2, h - 1 - (n * 16 - minz * 16) + border), str(n * 16), + font=font, fill=scalecolor) + draw.line((0, h - 1 - (n * 16 - minz * 16) + border, border - 1, + h - 1 - (n * 16 - minz * 16) + border), fill=scalecolor) if drawplayers: - try: - for filename in os.listdir(path + "players"): - f = file(path + "players/" + filename) - lines = f.readlines() - name="" - position=[] - for line in lines: - p = string.split(line) - if p[0] == "name": - name = p[2] - print filename + ": name = " + name - if p[0] == "position": - position = string.split(p[2][1:-1], ",") - print filename + ": position = " + p[2] - if len(name) > 0 and len(position) == 3: - x=(int(float(position[0]) / 10 - minx * 16)) - z=int(h - (float(position[2]) / 10 - minz * 16)) - draw.ellipse((x - 2 + border, z - 2 + border, x + 2 + border, z + 2 + border), outline = playercolor) - draw.text((x + 2 + border, z + 2 + border), name, font = font, fill = playercolor) - f.close() - except OSError: - pass + try: + for filename in os.listdir(path + "players"): + f = file(path + "players/" + filename) + lines = f.readlines() + name = "" + position = [] + for line in lines: + p = string.split(line) + if p[0] == "name": + name = p[2] + print filename + ": name = " + name + if p[0] == "position": + position = string.split(p[2][1:-1], ",") + print filename + ": position = " + p[2] + if len(name) > 0 and len(position) == 3: + x = (int(float(position[0]) / 10 - minx * 16)) + z = int(h - (float(position[2]) / 10 - minz * 16)) + draw.ellipse((x - 2 + border, z - 2 + border, + x + 2 + border, z + 2 + border), outline=playercolor) + draw.text((x + 2 + border, z + 2 + border), name, + font=font, fill=playercolor) + f.close() + except OSError: + pass print "Saving" im.save(output) From 75816150ec3f95a3d0f60f3b70d281e5d83c584c Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sat, 30 Jul 2011 21:12:49 +0200 Subject: [PATCH 122/158] * honor environment variables, use utf-8 --- util/minetestmapper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/minetestmapper.py b/util/minetestmapper.py index 5b17551..cf2a577 100755 --- a/util/minetestmapper.py +++ b/util/minetestmapper.py @@ -1,5 +1,5 @@ -#!/usr/bin/python2 -# -*- coding: windows-1252 -*- +#!/usr/bin/env python +# -*- coding: utf-8 -*- # This program is free software. It comes without any warranty, to # the extent permitted by applicable law. You can redistribute it From 92f504f98d4af7a31df7b1bfa80fce114638f4cf Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Fri, 29 Jul 2011 23:33:33 +0200 Subject: [PATCH 123/158] fixed displaying "umlauts" (deutsch umlaute) and hopefully other non ASCII chars, too --- src/guiMainMenu.cpp | 6 ++++++ src/guiMessageMenu.cpp | 2 ++ src/guiPasswordChange.cpp | 8 ++++++++ src/guiPauseMenu.cpp | 2 ++ src/guiTextInputMenu.cpp | 2 ++ 5 files changed, 20 insertions(+) diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp index 1d7f224..0365b61 100644 --- a/src/guiMainMenu.cpp +++ b/src/guiMainMenu.cpp @@ -164,6 +164,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) v2s32 topleft_client(40, 0); v2s32 size_client = size - v2s32(40, 0); + setlocale(LC_CTYPE, ""); { core::rect rect(0, 0, 20, 125); rect += topleft_client + v2s32(-15, 60); @@ -180,6 +181,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) Environment->addStaticText(chartowchar_t(gettext("Name/Password")), rect, false, true, this, -1); } + setlocale(LC_CTYPE, "en_US"); { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, 50); @@ -196,6 +198,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) e->setPasswordBox(true); } + setlocale(LC_CTYPE, ""); // Address + port { core::rect rect(0, 0, 110, 20); @@ -203,6 +206,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) Environment->addStaticText(chartowchar_t(gettext("Address/Port")), rect, false, true, this, -1); } + setlocale(LC_CTYPE, "en_US"); { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, 100); @@ -217,6 +221,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) rect += topleft_client + v2s32(size_client.X-60-100, 100); Environment->addEditBox(text_port.c_str(), rect, true, this, GUI_ID_PORT_INPUT); } + setlocale(LC_CTYPE, ""); { core::rect rect(0, 0, 400, 20); rect += topleft_client + v2s32(160, 100+35); @@ -289,6 +294,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) Environment->addButton(rect, this, GUI_ID_DELETE_MAP_BUTTON, chartowchar_t(gettext("Delete map"))); } + setlocale(LC_CTYPE, "en_US"); } void GUIMainMenu::drawMenu() diff --git a/src/guiMessageMenu.cpp b/src/guiMessageMenu.cpp index 155be60..b03f87b 100644 --- a/src/guiMessageMenu.cpp +++ b/src/guiMessageMenu.cpp @@ -85,6 +85,7 @@ void GUIMessageMenu::regenerateGui(v2u32 screensize) Environment->addStaticText(m_message_text.c_str(), rect, false, true, this, 256); } + setlocale(LC_CTYPE, ""); { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25); @@ -93,6 +94,7 @@ void GUIMessageMenu::regenerateGui(v2u32 screensize) chartowchar_t(gettext("Proceed"))); Environment->setFocus(e); } + setlocale(LC_CTYPE, "en_US"); } void GUIMessageMenu::drawMenu() diff --git a/src/guiPasswordChange.cpp b/src/guiPasswordChange.cpp index fabe751..89a6ce6 100644 --- a/src/guiPasswordChange.cpp +++ b/src/guiPasswordChange.cpp @@ -96,12 +96,14 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) Add stuff */ s32 ypos = 50; + setlocale(LC_CTYPE, ""); { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); Environment->addStaticText(chartowchar_t(gettext("Old Password")), rect, false, true, this, -1); } + setlocale(LC_CTYPE, "en_US"); { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, ypos); @@ -111,12 +113,14 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) e->setPasswordBox(true); } ypos += 50; + setlocale(LC_CTYPE, ""); { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); Environment->addStaticText(chartowchar_t(gettext("New Password")), rect, false, true, this, -1); } + setlocale(LC_CTYPE, "en_US"); { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, ypos); @@ -125,12 +129,14 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) e->setPasswordBox(true); } ypos += 50; + setlocale(LC_CTYPE, ""); { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); Environment->addStaticText(chartowchar_t(gettext("Confirm Password")), rect, false, true, this, -1); } + setlocale(LC_CTYPE, "en_US"); { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, ypos); @@ -140,6 +146,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) } ypos += 50; + setlocale(LC_CTYPE, ""); { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, ypos); @@ -156,6 +163,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) rect, false, true, this, ID_message); e->setVisible(false); } + setlocale(LC_CTYPE, "en_US"); } diff --git a/src/guiPauseMenu.cpp b/src/guiPauseMenu.cpp index c704cd3..3a5d245 100644 --- a/src/guiPauseMenu.cpp +++ b/src/guiPauseMenu.cpp @@ -103,6 +103,7 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) const s32 btn_gap = 20; const s32 btn_num = 4; s32 btn_y = size.Y/2-((btn_num*btn_height+(btn_num-1)*btn_gap))/2; + setlocale(LC_CTYPE, ""); { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); @@ -180,6 +181,7 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) Environment->addStaticText(narrow_to_wide(os.str()).c_str(), rect, false, true, this, 259); } + setlocale(LC_CTYPE, "en_US"); } void GUIPauseMenu::drawMenu() diff --git a/src/guiTextInputMenu.cpp b/src/guiTextInputMenu.cpp index 252e452..8c32490 100644 --- a/src/guiTextInputMenu.cpp +++ b/src/guiTextInputMenu.cpp @@ -104,12 +104,14 @@ void GUITextInputMenu::regenerateGui(v2u32 screensize) Environment->addEditBox(text.c_str(), rect, true, this, 256); Environment->setFocus(e); } + setlocale(LC_CTYPE, ""); { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25); Environment->addButton(rect, this, 257, chartowchar_t(gettext("Proceed"))); } + setlocale(LC_CTYPE, "en_US"); } void GUITextInputMenu::drawMenu() From 9baae3a701f7bdf50972d8381904d11eee77aa4e Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Sat, 30 Jul 2011 10:14:58 +0200 Subject: [PATCH 124/158] set locales to C because en_US not installed on some systems, only UTF-8 version and en_US.UTF-8 does not work. --- src/gettext.h | 10 ++++++++++ src/guiMainMenu.cpp | 12 ++++++------ src/guiMessageMenu.cpp | 4 ++-- src/guiPasswordChange.cpp | 16 ++++++++-------- src/guiPauseMenu.cpp | 4 ++-- src/guiTextInputMenu.cpp | 4 ++-- 6 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/gettext.h b/src/gettext.h index 493f9b2..7903751 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -25,3 +25,13 @@ inline wchar_t* chartowchar_t(const char *str) mbstowcs(nstr, str, l); return nstr; } + +inline void changeCtype(const char *l) +{ + char *ret = NULL; + ret = setlocale(LC_CTYPE, l); + if(ret == NULL) + std::cout<<"locale could not be set"< rect(0, 0, 20, 125); rect += topleft_client + v2s32(-15, 60); @@ -181,7 +181,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) Environment->addStaticText(chartowchar_t(gettext("Name/Password")), rect, false, true, this, -1); } - setlocale(LC_CTYPE, "en_US"); + changeCtype("C"); { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, 50); @@ -198,7 +198,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) e->setPasswordBox(true); } - setlocale(LC_CTYPE, ""); + changeCtype(""); // Address + port { core::rect rect(0, 0, 110, 20); @@ -206,7 +206,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) Environment->addStaticText(chartowchar_t(gettext("Address/Port")), rect, false, true, this, -1); } - setlocale(LC_CTYPE, "en_US"); + changeCtype("C"); { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, 100); @@ -221,7 +221,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) rect += topleft_client + v2s32(size_client.X-60-100, 100); Environment->addEditBox(text_port.c_str(), rect, true, this, GUI_ID_PORT_INPUT); } - setlocale(LC_CTYPE, ""); + changeCtype(""); { core::rect rect(0, 0, 400, 20); rect += topleft_client + v2s32(160, 100+35); @@ -294,7 +294,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) Environment->addButton(rect, this, GUI_ID_DELETE_MAP_BUTTON, chartowchar_t(gettext("Delete map"))); } - setlocale(LC_CTYPE, "en_US"); + changeCtype("C"); } void GUIMainMenu::drawMenu() diff --git a/src/guiMessageMenu.cpp b/src/guiMessageMenu.cpp index b03f87b..27ff3da 100644 --- a/src/guiMessageMenu.cpp +++ b/src/guiMessageMenu.cpp @@ -85,7 +85,7 @@ void GUIMessageMenu::regenerateGui(v2u32 screensize) Environment->addStaticText(m_message_text.c_str(), rect, false, true, this, 256); } - setlocale(LC_CTYPE, ""); + changeCtype(""); { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25); @@ -94,7 +94,7 @@ void GUIMessageMenu::regenerateGui(v2u32 screensize) chartowchar_t(gettext("Proceed"))); Environment->setFocus(e); } - setlocale(LC_CTYPE, "en_US"); + changeCtype("en_US.UTF-8"); } void GUIMessageMenu::drawMenu() diff --git a/src/guiPasswordChange.cpp b/src/guiPasswordChange.cpp index 89a6ce6..2a7fb00 100644 --- a/src/guiPasswordChange.cpp +++ b/src/guiPasswordChange.cpp @@ -96,14 +96,14 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) Add stuff */ s32 ypos = 50; - setlocale(LC_CTYPE, ""); + changeCtype(""); { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); Environment->addStaticText(chartowchar_t(gettext("Old Password")), rect, false, true, this, -1); } - setlocale(LC_CTYPE, "en_US"); + changeCtype("C"); { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, ypos); @@ -113,14 +113,14 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) e->setPasswordBox(true); } ypos += 50; - setlocale(LC_CTYPE, ""); + changeCtype(""); { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); Environment->addStaticText(chartowchar_t(gettext("New Password")), rect, false, true, this, -1); } - setlocale(LC_CTYPE, "en_US"); + changeCtype("C"); { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, ypos); @@ -129,14 +129,14 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) e->setPasswordBox(true); } ypos += 50; - setlocale(LC_CTYPE, ""); + changeCtype(""); { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); Environment->addStaticText(chartowchar_t(gettext("Confirm Password")), rect, false, true, this, -1); } - setlocale(LC_CTYPE, "en_US"); + changeCtype("C"); { core::rect rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, ypos); @@ -146,7 +146,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) } ypos += 50; - setlocale(LC_CTYPE, ""); + changeCtype(""); { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, ypos); @@ -163,7 +163,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) rect, false, true, this, ID_message); e->setVisible(false); } - setlocale(LC_CTYPE, "en_US"); + changeCtype("C"); } diff --git a/src/guiPauseMenu.cpp b/src/guiPauseMenu.cpp index 3a5d245..6cf364e 100644 --- a/src/guiPauseMenu.cpp +++ b/src/guiPauseMenu.cpp @@ -103,7 +103,7 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) const s32 btn_gap = 20; const s32 btn_num = 4; s32 btn_y = size.Y/2-((btn_num*btn_height+(btn_num-1)*btn_gap))/2; - setlocale(LC_CTYPE, ""); + changeCtype(""); { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); @@ -181,7 +181,7 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) Environment->addStaticText(narrow_to_wide(os.str()).c_str(), rect, false, true, this, 259); } - setlocale(LC_CTYPE, "en_US"); + changeCtype("C"); } void GUIPauseMenu::drawMenu() diff --git a/src/guiTextInputMenu.cpp b/src/guiTextInputMenu.cpp index 8c32490..a596025 100644 --- a/src/guiTextInputMenu.cpp +++ b/src/guiTextInputMenu.cpp @@ -104,14 +104,14 @@ void GUITextInputMenu::regenerateGui(v2u32 screensize) Environment->addEditBox(text.c_str(), rect, true, this, 256); Environment->setFocus(e); } - setlocale(LC_CTYPE, ""); + changeCtype(""); { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25); Environment->addButton(rect, this, 257, chartowchar_t(gettext("Proceed"))); } - setlocale(LC_CTYPE, "en_US"); + changeCtype("C"); } void GUITextInputMenu::drawMenu() From cd6d204a9d18df19320ca2a7adecdbc3fa519ebf Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Sat, 30 Jul 2011 10:22:32 +0200 Subject: [PATCH 125/158] changed some strings of the german translation to fit in the areas --- po/de/minetest.po | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/po/de/minetest.po b/po/de/minetest.po index 69b57fd..a3fb251 100644 --- a/po/de/minetest.po +++ b/po/de/minetest.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: 0.0.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2011-07-22 11:00+0200\n" -"PO-Revision-Date: 2011-07-20 16:58+0100\n" +"PO-Revision-Date: 2011-07-30 10:20+0100\n" "Last-Translator: Constantin Wenger \n" "Language-Team: Deutsch <>\n" "Language: de\n" @@ -43,7 +43,7 @@ msgstr "Spiel starten / Verbinden" #: src/guiMainMenu.cpp:253 msgid "Change keys" -msgstr "Tastenbelegung ändern" +msgstr "Tasten ändern" #: src/guiMainMenu.cpp:276 msgid "Creative Mode" @@ -57,7 +57,8 @@ msgstr "Schaden einschalten" msgid "Delete map" msgstr "Karte löschen" -#: src/guiMessageMenu.cpp:93 src/guiTextInputMenu.cpp:111 +#: src/guiMessageMenu.cpp:93 +#: src/guiTextInputMenu.cpp:111 msgid "Proceed" msgstr "Fortsetzen" @@ -113,11 +114,12 @@ msgid "" msgstr "" "Tastenkürzel:\n" "- WASD: Gehen\n" -"- linke Maustaste: dig blocks\n" -"- rechte Maustaste: place blocks\n" +"- linke Maustaste: Blöcke aufnehmen \n" +"- rechte Maustaste: Blöche ablegen\n" "- Mausrad: Item auswählen\n" "- 0...9: Item auswählen\n" "- Shift: ducken\n" -"- R: Alle geladenen Kartenteile anzeigen, umschalten\n" +"- R: alle geladenen Blöcke anzeigen (wechseln)\n" "- I: Inventarmenü\n" "- T: Chat\n" + From 37bf9a666aaa37b21d944ac7cca73c2b92f92c68 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Sat, 30 Jul 2011 11:43:20 +0200 Subject: [PATCH 126/158] set some more text to gettext and updated po files --- po/de/minetest.po | 431 ++++++++++++++++++++++++++++++++++++--- po/fr/minetest.po | 420 ++++++++++++++++++++++++++++++++++++-- po/it/minetest.po | 420 ++++++++++++++++++++++++++++++++++++-- po/minetest.pot | 418 +++++++++++++++++++++++++++++++++++-- src/guiKeyChangeMenu.cpp | 84 ++++---- src/guiKeyChangeMenu.h | 35 ++-- 6 files changed, 1660 insertions(+), 148 deletions(-) diff --git a/po/de/minetest.po b/po/de/minetest.po index a3fb251..fb7da44 100644 --- a/po/de/minetest.po +++ b/po/de/minetest.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: 0.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-22 11:00+0200\n" -"PO-Revision-Date: 2011-07-30 10:20+0100\n" +"POT-Creation-Date: 2011-07-30 11:20+0200\n" +"PO-Revision-Date: 2011-07-30 11:38+0100\n" "Last-Translator: Constantin Wenger \n" "Language-Team: Deutsch <>\n" "Language: de\n" @@ -17,88 +17,471 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n" -#: src/guiMainMenu.cpp:180 +#: src/guiKeyChangeMenu.cpp:84 +msgid "KEYBINDINGS" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:94 +msgid "Forward" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:111 +msgid "Backward" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:127 +#: src/guiKeyChangeMenu.h:38 +msgid "Left" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:142 +#: src/guiKeyChangeMenu.h:38 +msgid "Right" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:158 +msgid "Use" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:173 +msgid "Sneak" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:189 +msgid "Jump" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:204 +msgid "Inventory" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:220 +msgid "Chat" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:236 +msgid "Toggle fly" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:251 +msgid "Toggle fast" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:267 +msgid "Range select" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:285 +msgid "Print stacks" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:300 +msgid "Save" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:306 +#: src/guiKeyChangeMenu.h:33 +msgid "Cancel" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:531 +#: src/guiKeyChangeMenu.cpp:536 +#: src/guiKeyChangeMenu.cpp:541 +#: src/guiKeyChangeMenu.cpp:546 +#: src/guiKeyChangeMenu.cpp:551 +#: src/guiKeyChangeMenu.cpp:556 +#: src/guiKeyChangeMenu.cpp:561 +#: src/guiKeyChangeMenu.cpp:566 +#: src/guiKeyChangeMenu.cpp:571 +#: src/guiKeyChangeMenu.cpp:576 +#: src/guiKeyChangeMenu.cpp:581 +#: src/guiKeyChangeMenu.cpp:586 +#: src/guiKeyChangeMenu.cpp:591 +msgid "press Key" +msgstr "" + +#: src/guiKeyChangeMenu.h:33 +msgid "Left Button" +msgstr "" + +#: src/guiKeyChangeMenu.h:33 +msgid "Middle Button" +msgstr "" + +#: src/guiKeyChangeMenu.h:33 +msgid "Right Button" +msgstr "" + +#: src/guiKeyChangeMenu.h:33 +msgid "X Button 1" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Back" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Clear" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Return" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Tab" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "X Button 2" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Capital" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Control" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Kana" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Menu" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Pause" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Shift" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Convert" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Escape" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Final" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Junja" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Kanji" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Nonconvert" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Accept" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "End" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Home" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Mode Change" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Next" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Priot" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Space" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Down" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Execute" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Print" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Select" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Up" +msgstr "" + +#: src/guiKeyChangeMenu.h:39 +msgid "Delete" +msgstr "Delete" + +#: src/guiKeyChangeMenu.h:39 +msgid "Help" +msgstr "" + +#: src/guiKeyChangeMenu.h:39 +msgid "Insert" +msgstr "" + +#: src/guiKeyChangeMenu.h:39 +msgid "Snapshot" +msgstr "" + +#: src/guiKeyChangeMenu.h:42 +msgid "Left Windows" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Apps" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Numpad 0" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Numpad 1" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Right Windows" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Sleep" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 2" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 3" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 4" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 5" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 6" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 7" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad *" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad +" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad -" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad /" +msgstr "Ziffernblock /" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad 8" +msgstr "Ziffernblock 8" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad 9" +msgstr "Ziffernblock 9" + +#: src/guiKeyChangeMenu.h:49 +msgid "Num Lock" +msgstr "Num" + +#: src/guiKeyChangeMenu.h:49 +msgid "Scroll Lock" +msgstr "Rollen" + +#: src/guiKeyChangeMenu.h:50 +msgid "Left Shift" +msgstr "Umschalten links" + +#: src/guiKeyChangeMenu.h:50 +msgid "Right Shight" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Left Control" +msgstr "Strg links" + +#: src/guiKeyChangeMenu.h:51 +msgid "Left Menu" +msgstr "Menü links" + +#: src/guiKeyChangeMenu.h:51 +msgid "Right Control" +msgstr "Strg rechts" + +#: src/guiKeyChangeMenu.h:51 +msgid "Right Menu" +msgstr "Menü rechts" + +#: src/guiKeyChangeMenu.h:53 +msgid "Comma" +msgstr "Komma" + +#: src/guiKeyChangeMenu.h:53 +msgid "Minus" +msgstr "Minus" + +#: src/guiKeyChangeMenu.h:53 +msgid "Period" +msgstr "Periode" + +#: src/guiKeyChangeMenu.h:53 +msgid "Plus" +msgstr "Plus" + +#: src/guiKeyChangeMenu.h:57 +msgid "Attn" +msgstr "" + +#: src/guiKeyChangeMenu.h:57 +msgid "CrSel" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "Erase OEF" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "ExSel" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "OEM Clear" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "PA1" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "Play" +msgstr "Play" + +#: src/guiKeyChangeMenu.h:58 +msgid "Zoom" +msgstr "Zoom" + +#: src/guiMainMenu.cpp:181 msgid "Name/Password" msgstr "Name/Passwort" -#: src/guiMainMenu.cpp:203 +#: src/guiMainMenu.cpp:206 msgid "Address/Port" msgstr "Adresse / Port" -#: src/guiMainMenu.cpp:223 +#: src/guiMainMenu.cpp:228 msgid "Leave address blank to start a local server." msgstr "Lasse die Adresse frei um einen eigenen Server zu starten" -#: src/guiMainMenu.cpp:230 +#: src/guiMainMenu.cpp:235 msgid "Fancy trees" msgstr "Schöne Bäume" -#: src/guiMainMenu.cpp:236 +#: src/guiMainMenu.cpp:241 msgid "Smooth Lighting" msgstr "Besseres Licht" -#: src/guiMainMenu.cpp:244 +#: src/guiMainMenu.cpp:249 msgid "Start Game / Connect" msgstr "Spiel starten / Verbinden" -#: src/guiMainMenu.cpp:253 +#: src/guiMainMenu.cpp:258 msgid "Change keys" msgstr "Tasten ändern" -#: src/guiMainMenu.cpp:276 +#: src/guiMainMenu.cpp:281 msgid "Creative Mode" msgstr "Kreativitätsmodus" -#: src/guiMainMenu.cpp:282 +#: src/guiMainMenu.cpp:287 msgid "Enable Damage" msgstr "Schaden einschalten" -#: src/guiMainMenu.cpp:290 +#: src/guiMainMenu.cpp:295 msgid "Delete map" msgstr "Karte löschen" -#: src/guiMessageMenu.cpp:93 -#: src/guiTextInputMenu.cpp:111 +#: src/guiMessageMenu.cpp:94 +#: src/guiTextInputMenu.cpp:112 msgid "Proceed" msgstr "Fortsetzen" -#: src/guiPasswordChange.cpp:102 +#: src/guiPasswordChange.cpp:103 msgid "Old Password" msgstr "Altes Passwort" -#: src/guiPasswordChange.cpp:117 +#: src/guiPasswordChange.cpp:120 msgid "New Password" msgstr "Neues Passwort" -#: src/guiPasswordChange.cpp:131 +#: src/guiPasswordChange.cpp:136 msgid "Confirm Password" msgstr "Passwort wiederholen" -#: src/guiPasswordChange.cpp:146 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Ändern" -#: src/guiPasswordChange.cpp:155 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Passwörter passen nicht zusammen" -#: src/guiPauseMenu.cpp:110 +#: src/guiPauseMenu.cpp:111 msgid "Continue" msgstr "Weiter" -#: src/guiPauseMenu.cpp:117 +#: src/guiPauseMenu.cpp:118 msgid "Change Password" msgstr "Passwort ändern" -#: src/guiPauseMenu.cpp:124 +#: src/guiPauseMenu.cpp:125 msgid "Disconnect" msgstr "Verbindung trennen" -#: src/guiPauseMenu.cpp:131 +#: src/guiPauseMenu.cpp:132 msgid "Exit to OS" msgstr "Programm beenden" -#: src/guiPauseMenu.cpp:138 +#: src/guiPauseMenu.cpp:139 msgid "" "Keys:\n" "- WASD: Walk\n" diff --git a/po/fr/minetest.po b/po/fr/minetest.po index b060c42..c1133fa 100644 --- a/po/fr/minetest.po +++ b/po/fr/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-22 11:00+0200\n" +"POT-Creation-Date: 2011-07-30 11:20+0200\n" "PO-Revision-Date: 2011-07-21 15:48+0200\n" "Last-Translator: Cyriaque 'Cisoun' Skrapits \n" "Language-Team: Français <>\n" @@ -17,87 +17,463 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n" -#: src/guiMainMenu.cpp:180 +#: src/guiKeyChangeMenu.cpp:84 +msgid "KEYBINDINGS" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:94 +msgid "Forward" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:111 +msgid "Backward" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:127 src/guiKeyChangeMenu.h:38 +msgid "Left" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:142 src/guiKeyChangeMenu.h:38 +msgid "Right" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:158 +msgid "Use" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:173 +msgid "Sneak" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:189 +msgid "Jump" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:204 +msgid "Inventory" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:220 +msgid "Chat" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:236 +msgid "Toggle fly" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:251 +msgid "Toggle fast" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:267 +msgid "Range select" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:285 +msgid "Print stacks" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:300 +msgid "Save" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:306 src/guiKeyChangeMenu.h:33 +msgid "Cancel" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:531 src/guiKeyChangeMenu.cpp:536 +#: src/guiKeyChangeMenu.cpp:541 src/guiKeyChangeMenu.cpp:546 +#: src/guiKeyChangeMenu.cpp:551 src/guiKeyChangeMenu.cpp:556 +#: src/guiKeyChangeMenu.cpp:561 src/guiKeyChangeMenu.cpp:566 +#: src/guiKeyChangeMenu.cpp:571 src/guiKeyChangeMenu.cpp:576 +#: src/guiKeyChangeMenu.cpp:581 src/guiKeyChangeMenu.cpp:586 +#: src/guiKeyChangeMenu.cpp:591 +msgid "press Key" +msgstr "" + +#: src/guiKeyChangeMenu.h:33 +msgid "Left Button" +msgstr "" + +#: src/guiKeyChangeMenu.h:33 +msgid "Middle Button" +msgstr "" + +#: src/guiKeyChangeMenu.h:33 +msgid "Right Button" +msgstr "" + +#: src/guiKeyChangeMenu.h:33 +msgid "X Button 1" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Back" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Clear" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Return" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Tab" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "X Button 2" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Capital" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Control" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Kana" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Menu" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Pause" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Shift" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Convert" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Escape" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Final" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Junja" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Kanji" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Nonconvert" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Accept" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "End" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Home" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +#, fuzzy +msgid "Mode Change" +msgstr "Changer" + +#: src/guiKeyChangeMenu.h:37 +msgid "Next" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Priot" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Space" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Down" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Execute" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Print" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Select" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Up" +msgstr "" + +#: src/guiKeyChangeMenu.h:39 +#, fuzzy +msgid "Delete" +msgstr "Supprimer carte" + +#: src/guiKeyChangeMenu.h:39 +msgid "Help" +msgstr "" + +#: src/guiKeyChangeMenu.h:39 +msgid "Insert" +msgstr "" + +#: src/guiKeyChangeMenu.h:39 +msgid "Snapshot" +msgstr "" + +#: src/guiKeyChangeMenu.h:42 +msgid "Left Windows" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Apps" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Numpad 0" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Numpad 1" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Right Windows" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Sleep" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 2" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 3" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 4" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 5" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 6" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 7" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad *" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad +" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad -" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad /" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad 8" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad 9" +msgstr "" + +#: src/guiKeyChangeMenu.h:49 +msgid "Num Lock" +msgstr "" + +#: src/guiKeyChangeMenu.h:49 +msgid "Scroll Lock" +msgstr "" + +#: src/guiKeyChangeMenu.h:50 +msgid "Left Shift" +msgstr "" + +#: src/guiKeyChangeMenu.h:50 +msgid "Right Shight" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Left Control" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Left Menu" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Right Control" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Right Menu" +msgstr "" + +#: src/guiKeyChangeMenu.h:53 +msgid "Comma" +msgstr "" + +#: src/guiKeyChangeMenu.h:53 +msgid "Minus" +msgstr "" + +#: src/guiKeyChangeMenu.h:53 +msgid "Period" +msgstr "" + +#: src/guiKeyChangeMenu.h:53 +msgid "Plus" +msgstr "" + +#: src/guiKeyChangeMenu.h:57 +msgid "Attn" +msgstr "" + +#: src/guiKeyChangeMenu.h:57 +msgid "CrSel" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "Erase OEF" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "ExSel" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "OEM Clear" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "PA1" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "Play" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "Zoom" +msgstr "" + +#: src/guiMainMenu.cpp:181 msgid "Name/Password" msgstr "Nom / MdP" -#: src/guiMainMenu.cpp:203 +#: src/guiMainMenu.cpp:206 msgid "Address/Port" msgstr "Adresse / Port" -#: src/guiMainMenu.cpp:223 +#: src/guiMainMenu.cpp:228 msgid "Leave address blank to start a local server." msgstr "Laisser l'adresse vide pour lancer un serveur local." -#: src/guiMainMenu.cpp:230 +#: src/guiMainMenu.cpp:235 msgid "Fancy trees" msgstr "Arbres spéciaux" -#: src/guiMainMenu.cpp:236 +#: src/guiMainMenu.cpp:241 msgid "Smooth Lighting" msgstr "Lumière douce" -#: src/guiMainMenu.cpp:244 +#: src/guiMainMenu.cpp:249 msgid "Start Game / Connect" msgstr "Démarrer / Connecter" -#: src/guiMainMenu.cpp:253 +#: src/guiMainMenu.cpp:258 msgid "Change keys" msgstr "Changer touches" -#: src/guiMainMenu.cpp:276 +#: src/guiMainMenu.cpp:281 msgid "Creative Mode" msgstr "Mode créatif" -#: src/guiMainMenu.cpp:282 +#: src/guiMainMenu.cpp:287 msgid "Enable Damage" msgstr "Activer blessures" -#: src/guiMainMenu.cpp:290 +#: src/guiMainMenu.cpp:295 msgid "Delete map" msgstr "Supprimer carte" -#: src/guiMessageMenu.cpp:93 src/guiTextInputMenu.cpp:111 +#: src/guiMessageMenu.cpp:94 src/guiTextInputMenu.cpp:112 msgid "Proceed" msgstr "OK" -#: src/guiPasswordChange.cpp:102 +#: src/guiPasswordChange.cpp:103 msgid "Old Password" msgstr "Ancien mot de passe" -#: src/guiPasswordChange.cpp:117 +#: src/guiPasswordChange.cpp:120 msgid "New Password" msgstr "Nouveau mot de passe" -#: src/guiPasswordChange.cpp:131 +#: src/guiPasswordChange.cpp:136 msgid "Confirm Password" msgstr "Confirmer mot de passe" -#: src/guiPasswordChange.cpp:146 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Changer" -#: src/guiPasswordChange.cpp:155 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Mauvaise correspondance!" -#: src/guiPauseMenu.cpp:110 +#: src/guiPauseMenu.cpp:111 msgid "Continue" msgstr "Continuer" -#: src/guiPauseMenu.cpp:117 +#: src/guiPauseMenu.cpp:118 msgid "Change Password" msgstr "Changer mot de passe" -#: src/guiPauseMenu.cpp:124 +#: src/guiPauseMenu.cpp:125 msgid "Disconnect" msgstr "Déconnection" -#: src/guiPauseMenu.cpp:131 +#: src/guiPauseMenu.cpp:132 msgid "Exit to OS" msgstr "Quitter le jeu" -#: src/guiPauseMenu.cpp:138 +#: src/guiPauseMenu.cpp:139 msgid "" "Keys:\n" "- WASD: Walk\n" diff --git a/po/it/minetest.po b/po/it/minetest.po index 8f66311..c3c924f 100644 --- a/po/it/minetest.po +++ b/po/it/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-24 18:56+0200\n" +"POT-Creation-Date: 2011-07-30 11:20+0200\n" "PO-Revision-Date: 2011-07-24 18:56+0200\n" "Last-Translator: Giuseppe Bilotta \n" "Language-Team: Italian\n" @@ -17,87 +17,463 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: src/guiMainMenu.cpp:180 +#: src/guiKeyChangeMenu.cpp:84 +msgid "KEYBINDINGS" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:94 +msgid "Forward" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:111 +msgid "Backward" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:127 src/guiKeyChangeMenu.h:38 +msgid "Left" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:142 src/guiKeyChangeMenu.h:38 +msgid "Right" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:158 +msgid "Use" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:173 +msgid "Sneak" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:189 +msgid "Jump" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:204 +msgid "Inventory" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:220 +msgid "Chat" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:236 +msgid "Toggle fly" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:251 +msgid "Toggle fast" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:267 +msgid "Range select" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:285 +msgid "Print stacks" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:300 +msgid "Save" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:306 src/guiKeyChangeMenu.h:33 +msgid "Cancel" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:531 src/guiKeyChangeMenu.cpp:536 +#: src/guiKeyChangeMenu.cpp:541 src/guiKeyChangeMenu.cpp:546 +#: src/guiKeyChangeMenu.cpp:551 src/guiKeyChangeMenu.cpp:556 +#: src/guiKeyChangeMenu.cpp:561 src/guiKeyChangeMenu.cpp:566 +#: src/guiKeyChangeMenu.cpp:571 src/guiKeyChangeMenu.cpp:576 +#: src/guiKeyChangeMenu.cpp:581 src/guiKeyChangeMenu.cpp:586 +#: src/guiKeyChangeMenu.cpp:591 +msgid "press Key" +msgstr "" + +#: src/guiKeyChangeMenu.h:33 +msgid "Left Button" +msgstr "" + +#: src/guiKeyChangeMenu.h:33 +msgid "Middle Button" +msgstr "" + +#: src/guiKeyChangeMenu.h:33 +msgid "Right Button" +msgstr "" + +#: src/guiKeyChangeMenu.h:33 +msgid "X Button 1" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Back" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Clear" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Return" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Tab" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "X Button 2" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Capital" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Control" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Kana" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Menu" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Pause" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Shift" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Convert" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Escape" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Final" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Junja" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Kanji" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Nonconvert" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Accept" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "End" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Home" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +#, fuzzy +msgid "Mode Change" +msgstr "Modifica" + +#: src/guiKeyChangeMenu.h:37 +msgid "Next" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Priot" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Space" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Down" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Execute" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Print" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Select" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Up" +msgstr "" + +#: src/guiKeyChangeMenu.h:39 +#, fuzzy +msgid "Delete" +msgstr "Cancella mappa" + +#: src/guiKeyChangeMenu.h:39 +msgid "Help" +msgstr "" + +#: src/guiKeyChangeMenu.h:39 +msgid "Insert" +msgstr "" + +#: src/guiKeyChangeMenu.h:39 +msgid "Snapshot" +msgstr "" + +#: src/guiKeyChangeMenu.h:42 +msgid "Left Windows" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Apps" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Numpad 0" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Numpad 1" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Right Windows" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Sleep" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 2" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 3" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 4" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 5" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 6" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 7" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad *" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad +" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad -" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad /" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad 8" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad 9" +msgstr "" + +#: src/guiKeyChangeMenu.h:49 +msgid "Num Lock" +msgstr "" + +#: src/guiKeyChangeMenu.h:49 +msgid "Scroll Lock" +msgstr "" + +#: src/guiKeyChangeMenu.h:50 +msgid "Left Shift" +msgstr "" + +#: src/guiKeyChangeMenu.h:50 +msgid "Right Shight" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Left Control" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Left Menu" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Right Control" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Right Menu" +msgstr "" + +#: src/guiKeyChangeMenu.h:53 +msgid "Comma" +msgstr "" + +#: src/guiKeyChangeMenu.h:53 +msgid "Minus" +msgstr "" + +#: src/guiKeyChangeMenu.h:53 +msgid "Period" +msgstr "" + +#: src/guiKeyChangeMenu.h:53 +msgid "Plus" +msgstr "" + +#: src/guiKeyChangeMenu.h:57 +msgid "Attn" +msgstr "" + +#: src/guiKeyChangeMenu.h:57 +msgid "CrSel" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "Erase OEF" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "ExSel" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "OEM Clear" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "PA1" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "Play" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "Zoom" +msgstr "" + +#: src/guiMainMenu.cpp:181 msgid "Name/Password" msgstr "Nome/Password" -#: src/guiMainMenu.cpp:203 +#: src/guiMainMenu.cpp:206 msgid "Address/Port" msgstr "Indirizzo/Porta" -#: src/guiMainMenu.cpp:223 +#: src/guiMainMenu.cpp:228 msgid "Leave address blank to start a local server." msgstr "Lascia vuoto l'indirizzo per avviare un server locale" -#: src/guiMainMenu.cpp:230 +#: src/guiMainMenu.cpp:235 msgid "Fancy trees" msgstr "Alberi strani" -#: src/guiMainMenu.cpp:236 +#: src/guiMainMenu.cpp:241 msgid "Smooth Lighting" msgstr "" -#: src/guiMainMenu.cpp:244 +#: src/guiMainMenu.cpp:249 msgid "Start Game / Connect" msgstr "Avvia Gioco / Connetti" -#: src/guiMainMenu.cpp:253 +#: src/guiMainMenu.cpp:258 msgid "Change keys" msgstr "Modifica tasti" -#: src/guiMainMenu.cpp:276 +#: src/guiMainMenu.cpp:281 msgid "Creative Mode" msgstr "Modalità creativa" -#: src/guiMainMenu.cpp:282 +#: src/guiMainMenu.cpp:287 msgid "Enable Damage" msgstr "Attiva Danno" -#: src/guiMainMenu.cpp:290 +#: src/guiMainMenu.cpp:295 msgid "Delete map" msgstr "Cancella mappa" -#: src/guiMessageMenu.cpp:93 src/guiTextInputMenu.cpp:111 +#: src/guiMessageMenu.cpp:94 src/guiTextInputMenu.cpp:112 msgid "Proceed" msgstr "Procedi" -#: src/guiPasswordChange.cpp:102 +#: src/guiPasswordChange.cpp:103 msgid "Old Password" msgstr "Vecchia password" -#: src/guiPasswordChange.cpp:117 +#: src/guiPasswordChange.cpp:120 msgid "New Password" msgstr "Nuova password" -#: src/guiPasswordChange.cpp:131 +#: src/guiPasswordChange.cpp:136 msgid "Confirm Password" msgstr "Conferma password" -#: src/guiPasswordChange.cpp:146 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "Modifica" -#: src/guiPasswordChange.cpp:155 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "Le password non corrispondono!" -#: src/guiPauseMenu.cpp:110 +#: src/guiPauseMenu.cpp:111 msgid "Continue" msgstr "Continua" -#: src/guiPauseMenu.cpp:117 +#: src/guiPauseMenu.cpp:118 msgid "Change Password" msgstr "Cambia password" -#: src/guiPauseMenu.cpp:124 +#: src/guiPauseMenu.cpp:125 msgid "Disconnect" msgstr "Disconnetti" -#: src/guiPauseMenu.cpp:131 +#: src/guiPauseMenu.cpp:132 msgid "Exit to OS" msgstr "Esci al S.O." -#: src/guiPauseMenu.cpp:138 +#: src/guiPauseMenu.cpp:139 msgid "" "Keys:\n" "- WASD: Walk\n" diff --git a/po/minetest.pot b/po/minetest.pot index e359bf4..eebdc18 100644 --- a/po/minetest.pot +++ b/po/minetest.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-24 18:56+0200\n" +"POT-Creation-Date: 2011-07-30 11:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,87 +17,461 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: src/guiMainMenu.cpp:180 +#: src/guiKeyChangeMenu.cpp:84 +msgid "KEYBINDINGS" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:94 +msgid "Forward" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:111 +msgid "Backward" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:127 src/guiKeyChangeMenu.h:38 +msgid "Left" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:142 src/guiKeyChangeMenu.h:38 +msgid "Right" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:158 +msgid "Use" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:173 +msgid "Sneak" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:189 +msgid "Jump" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:204 +msgid "Inventory" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:220 +msgid "Chat" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:236 +msgid "Toggle fly" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:251 +msgid "Toggle fast" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:267 +msgid "Range select" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:285 +msgid "Print stacks" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:300 +msgid "Save" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:306 src/guiKeyChangeMenu.h:33 +msgid "Cancel" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:531 src/guiKeyChangeMenu.cpp:536 +#: src/guiKeyChangeMenu.cpp:541 src/guiKeyChangeMenu.cpp:546 +#: src/guiKeyChangeMenu.cpp:551 src/guiKeyChangeMenu.cpp:556 +#: src/guiKeyChangeMenu.cpp:561 src/guiKeyChangeMenu.cpp:566 +#: src/guiKeyChangeMenu.cpp:571 src/guiKeyChangeMenu.cpp:576 +#: src/guiKeyChangeMenu.cpp:581 src/guiKeyChangeMenu.cpp:586 +#: src/guiKeyChangeMenu.cpp:591 +msgid "press Key" +msgstr "" + +#: src/guiKeyChangeMenu.h:33 +msgid "Left Button" +msgstr "" + +#: src/guiKeyChangeMenu.h:33 +msgid "Middle Button" +msgstr "" + +#: src/guiKeyChangeMenu.h:33 +msgid "Right Button" +msgstr "" + +#: src/guiKeyChangeMenu.h:33 +msgid "X Button 1" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Back" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Clear" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Return" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Tab" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "X Button 2" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Capital" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Control" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Kana" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Menu" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Pause" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Shift" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Convert" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Escape" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Final" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Junja" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Kanji" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Nonconvert" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Accept" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "End" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Home" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Mode Change" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Next" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Priot" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Space" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Down" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Execute" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Print" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Select" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Up" +msgstr "" + +#: src/guiKeyChangeMenu.h:39 +msgid "Delete" +msgstr "" + +#: src/guiKeyChangeMenu.h:39 +msgid "Help" +msgstr "" + +#: src/guiKeyChangeMenu.h:39 +msgid "Insert" +msgstr "" + +#: src/guiKeyChangeMenu.h:39 +msgid "Snapshot" +msgstr "" + +#: src/guiKeyChangeMenu.h:42 +msgid "Left Windows" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Apps" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Numpad 0" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Numpad 1" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Right Windows" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Sleep" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 2" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 3" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 4" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 5" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 6" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 7" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad *" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad +" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad -" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad /" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad 8" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad 9" +msgstr "" + +#: src/guiKeyChangeMenu.h:49 +msgid "Num Lock" +msgstr "" + +#: src/guiKeyChangeMenu.h:49 +msgid "Scroll Lock" +msgstr "" + +#: src/guiKeyChangeMenu.h:50 +msgid "Left Shift" +msgstr "" + +#: src/guiKeyChangeMenu.h:50 +msgid "Right Shight" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Left Control" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Left Menu" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Right Control" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Right Menu" +msgstr "" + +#: src/guiKeyChangeMenu.h:53 +msgid "Comma" +msgstr "" + +#: src/guiKeyChangeMenu.h:53 +msgid "Minus" +msgstr "" + +#: src/guiKeyChangeMenu.h:53 +msgid "Period" +msgstr "" + +#: src/guiKeyChangeMenu.h:53 +msgid "Plus" +msgstr "" + +#: src/guiKeyChangeMenu.h:57 +msgid "Attn" +msgstr "" + +#: src/guiKeyChangeMenu.h:57 +msgid "CrSel" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "Erase OEF" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "ExSel" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "OEM Clear" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "PA1" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "Play" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "Zoom" +msgstr "" + +#: src/guiMainMenu.cpp:181 msgid "Name/Password" msgstr "" -#: src/guiMainMenu.cpp:203 +#: src/guiMainMenu.cpp:206 msgid "Address/Port" msgstr "" -#: src/guiMainMenu.cpp:223 +#: src/guiMainMenu.cpp:228 msgid "Leave address blank to start a local server." msgstr "" -#: src/guiMainMenu.cpp:230 +#: src/guiMainMenu.cpp:235 msgid "Fancy trees" msgstr "" -#: src/guiMainMenu.cpp:236 +#: src/guiMainMenu.cpp:241 msgid "Smooth Lighting" msgstr "" -#: src/guiMainMenu.cpp:244 +#: src/guiMainMenu.cpp:249 msgid "Start Game / Connect" msgstr "" -#: src/guiMainMenu.cpp:253 +#: src/guiMainMenu.cpp:258 msgid "Change keys" msgstr "" -#: src/guiMainMenu.cpp:276 +#: src/guiMainMenu.cpp:281 msgid "Creative Mode" msgstr "" -#: src/guiMainMenu.cpp:282 +#: src/guiMainMenu.cpp:287 msgid "Enable Damage" msgstr "" -#: src/guiMainMenu.cpp:290 +#: src/guiMainMenu.cpp:295 msgid "Delete map" msgstr "" -#: src/guiMessageMenu.cpp:93 src/guiTextInputMenu.cpp:111 +#: src/guiMessageMenu.cpp:94 src/guiTextInputMenu.cpp:112 msgid "Proceed" msgstr "" -#: src/guiPasswordChange.cpp:102 +#: src/guiPasswordChange.cpp:103 msgid "Old Password" msgstr "" -#: src/guiPasswordChange.cpp:117 +#: src/guiPasswordChange.cpp:120 msgid "New Password" msgstr "" -#: src/guiPasswordChange.cpp:131 +#: src/guiPasswordChange.cpp:136 msgid "Confirm Password" msgstr "" -#: src/guiPasswordChange.cpp:146 +#: src/guiPasswordChange.cpp:153 msgid "Change" msgstr "" -#: src/guiPasswordChange.cpp:155 +#: src/guiPasswordChange.cpp:162 msgid "Passwords do not match!" msgstr "" -#: src/guiPauseMenu.cpp:110 +#: src/guiPauseMenu.cpp:111 msgid "Continue" msgstr "" -#: src/guiPauseMenu.cpp:117 +#: src/guiPauseMenu.cpp:118 msgid "Change Password" msgstr "" -#: src/guiPauseMenu.cpp:124 +#: src/guiPauseMenu.cpp:125 msgid "Disconnect" msgstr "" -#: src/guiPauseMenu.cpp:131 +#: src/guiPauseMenu.cpp:132 msgid "Exit to OS" msgstr "" -#: src/guiPauseMenu.cpp:138 +#: src/guiPauseMenu.cpp:139 msgid "" "Keys:\n" "- WASD: Walk\n" diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp index 98d6f80..7855751 100644 --- a/src/guiKeyChangeMenu.cpp +++ b/src/guiKeyChangeMenu.cpp @@ -80,9 +80,9 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 125, 20); rect += topleft + v2s32(25, 3); - const wchar_t *text = L"KEYBINDINGS"; //gui::IGUIStaticText *t = - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("KEYBINDINGS")), + rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } v2s32 offset(25, 40); @@ -91,8 +91,8 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - const wchar_t *text = L"Forward"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Forward")), + rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -108,8 +108,8 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - const wchar_t *text = L"Backward"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Backward")), + rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -124,8 +124,8 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - const wchar_t *text = L"Left"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Left")), + rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -139,8 +139,8 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - const wchar_t *text = L"Right"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Right")), + rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -155,8 +155,8 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - const wchar_t *text = L"Use"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Use")), + rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -170,8 +170,8 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - const wchar_t *text = L"Sneak"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Sneak")), + rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -186,8 +186,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - const wchar_t *text = L"Jump"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Jump")), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -202,8 +201,8 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - const wchar_t *text = L"Inventory"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Inventory")), + rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -218,8 +217,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - const wchar_t *text = L"Chat"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Chat")), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -235,8 +233,8 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - const wchar_t *text = L"Toggle fly"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Toggle fly")), + rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -250,8 +248,8 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - const wchar_t *text = L"Toggle fast"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Toggle fast")), + rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -266,7 +264,8 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); const wchar_t *text = L"Range select"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Range select")), + rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -283,7 +282,8 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); const wchar_t *text = L"Print stacks"; - Environment->addStaticText(text, rect, false, true, this, -1); + Environment->addStaticText(chartowchar_t(gettext("Print stacks")), + rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -296,12 +296,14 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 30); rect += topleft + v2s32(size.X - 100 - 20, size.Y - 40); - Environment->addButton(rect, this, GUI_ID_BACK_BUTTON, L"Save"); + Environment->addButton(rect, this, GUI_ID_BACK_BUTTON, + chartowchar_t(gettext("Save"))); } { core::rect < s32 > rect(0, 0, 100, 30); rect += topleft + v2s32(size.X - 100 - 20 - 100 - 20, size.Y - 40); - Environment->addButton(rect, this, GUI_ID_ABORT_BUTTON, L"Cancel"); + Environment->addButton(rect, this, GUI_ID_ABORT_BUTTON, + chartowchar_t(gettext("Cancel"))); } } @@ -526,67 +528,67 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event) case GUI_ID_KEY_FORWARD_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->forward->setText(L"press Key"); + this->forward->setText(chartowchar_t(gettext("press Key"))); break; case GUI_ID_KEY_BACKWARD_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->backward->setText(L"press Key"); + this->backward->setText(chartowchar_t(gettext("press Key"))); break; case GUI_ID_KEY_LEFT_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->left->setText(L"press Key"); + this->left->setText(chartowchar_t(gettext("press Key"))); break; case GUI_ID_KEY_RIGHT_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->right->setText(L"press Key"); + this->right->setText(chartowchar_t(gettext("press Key"))); break; case GUI_ID_KEY_USE_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->use->setText(L"press Key"); + this->use->setText(chartowchar_t(gettext("press Key"))); break; case GUI_ID_KEY_FLY_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->fly->setText(L"press Key"); + this->fly->setText(chartowchar_t(gettext("press Key"))); break; case GUI_ID_KEY_FAST_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->fast->setText(L"press Key"); + this->fast->setText(chartowchar_t(gettext("press Key"))); break; case GUI_ID_KEY_JUMP_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->jump->setText(L"press Key"); + this->jump->setText(chartowchar_t(gettext("press Key"))); break; case GUI_ID_KEY_CHAT_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->chat->setText(L"press Key"); + this->chat->setText(chartowchar_t(gettext("press Key"))); break; case GUI_ID_KEY_SNEAK_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->sneak->setText(L"press Key"); + this->sneak->setText(chartowchar_t(gettext("press Key"))); break; case GUI_ID_KEY_INVENTORY_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->inventory->setText(L"press Key"); + this->inventory->setText(chartowchar_t(gettext("press Key"))); break; case GUI_ID_KEY_DUMP_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->dump->setText(L"press Key"); + this->dump->setText(chartowchar_t(gettext("press Key"))); break; case GUI_ID_KEY_RANGE_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->range->setText(L"press Key"); + this->range->setText(chartowchar_t(gettext("press Key"))); break; } //Buttons diff --git a/src/guiKeyChangeMenu.h b/src/guiKeyChangeMenu.h index e9e359c..c40d802 100644 --- a/src/guiKeyChangeMenu.h +++ b/src/guiKeyChangeMenu.h @@ -26,35 +26,36 @@ #include "utility.h" #include "modalMenu.h" #include "client.h" +#include "gettext.h" #include static const char *KeyNames[] = - { "-", "Left Button", "Right Button", "Cancel", "Middle Button", "X Button 1", - "X Button 2", "-", "Back", "Tab", "-", "-", "Clear", "Return", "-", - "-", "Shift", "Control", "Menu", "Pause", "Capital", "Kana", "-", - "Junja", "Final", "Kanji", "-", "Escape", "Convert", "Nonconvert", - "Accept", "Mode Change", "Space", "Priot", "Next", "End", "Home", - "Left", "Up", "Right", "Down", "Select", "Print", "Execute", - "Snapshot", "Insert", "Delete", "Help", "0", "1", "2", "3", "4", "5", + { "-", gettext("Left Button"), gettext("Right Button"), gettext("Cancel"), gettext("Middle Button"), gettext("X Button 1"), + gettext("X Button 2"), "-", gettext("Back"), gettext("Tab"), "-", "-", gettext("Clear"), gettext("Return"), "-", + "-", gettext("Shift"), gettext("Control"), gettext("Menu"), gettext("Pause"), gettext("Capital"), gettext("Kana"), "-", + gettext("Junja"), gettext("Final"), gettext("Kanji"), "-", gettext("Escape"), gettext("Convert"), gettext("Nonconvert"), + gettext("Accept"), gettext("Mode Change"), gettext("Space"), gettext("Priot"), gettext("Next"), gettext("End"), gettext("Home"), + gettext("Left"), gettext("Up"), gettext("Right"), gettext("Down"), gettext("Select"), gettext("Print"), gettext("Execute"), + gettext("Snapshot"), gettext("Insert"), gettext("Delete"), gettext("Help"), "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "-", "-", "-", "-", "-", "-", "-", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", - "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "Left Windows", - "Right Windows", "Apps", "-", "Sleep", "Numpad 0", "Numpad 1", - "Numpad 2", "Numpad 3", "Numpad 4", "Numpad 5", "Numpad 6", "Numpad 7", - "Numpad 8", "Numpad 9", "Numpad *", "Numpad +", "Numpad /", "Numpad -", + "R", "S", "T", "U", "V", "W", "X", "Y", "Z", gettext("Left Windows"), + gettext("Right Windows"), gettext("Apps"), "-", gettext("Sleep"), gettext("Numpad 0"), gettext("Numpad 1"), + gettext("Numpad 2"), gettext("Numpad 3"), gettext("Numpad 4"), gettext("Numpad 5"), gettext("Numpad 6"), gettext("Numpad 7"), + gettext("Numpad 8"), gettext("Numpad 9"), gettext("Numpad *"), gettext("Numpad +"), gettext("Numpad /"), gettext("Numpad -"), "Numpad .", "Numpad /", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16", "F17", "F18", "F19", "F20", "F21", "F22", "F23", "F24", "-", "-", "-", "-", "-", "-", - "-", "-", "Num Lock", "Scroll Lock", "-", "-", "-", "-", "-", "-", "-", - "-", "-", "-", "-", "-", "-", "-", "Left Shift", "Right Shight", - "Left Control", "Right Control", "Left Menu", "Right Menu", "-", "-", + "-", "-", gettext("Num Lock"), gettext("Scroll Lock"), "-", "-", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "-", "-", gettext("Left Shift"), gettext("Right Shight"), + gettext("Left Control"), gettext("Right Control"), gettext("Left Menu"), gettext("Right Menu"), "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", - "-", "-", "-", "-", "-", "Plus", "Comma", "Minus", "Period", "-", "-", + "-", "-", "-", "-", "-", gettext("Plus"), gettext("Comma"), gettext("Minus"), gettext("Period"), "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", - "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "Attn", "CrSel", - "ExSel", "Erase OEF", "Play", "Zoom", "PA1", "OEM Clear", "-" }; + "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", gettext("Attn"), gettext("CrSel"), + gettext("ExSel"), gettext("Erase OEF"), gettext("Play"), gettext("Zoom"), gettext("PA1"), gettext("OEM Clear"), "-" }; enum { GUI_ID_BACK_BUTTON = 101, GUI_ID_ABORT_BUTTON, GUI_ID_SCROLL_BAR, From a817419fe497fad32d675fbe16b1419c853ae083 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Sat, 30 Jul 2011 11:44:45 +0200 Subject: [PATCH 127/158] fixed redefinitivon of gettext.h is included more than once --- src/gettext.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gettext.h b/src/gettext.h index 7903751..a42820a 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -1,3 +1,4 @@ +#ifndef GETTEXT_HEADER #include "config.h" // for USE_GETTEXT #if USE_GETTEXT @@ -35,3 +36,5 @@ inline void changeCtype(const char *l) else std::cout<<"locale has been set to:"< Date: Sat, 30 Jul 2011 11:44:50 +0200 Subject: [PATCH 128/158] changed one forgotten en_US.UTF-8 to C --- src/guiMessageMenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guiMessageMenu.cpp b/src/guiMessageMenu.cpp index 27ff3da..71c8fd1 100644 --- a/src/guiMessageMenu.cpp +++ b/src/guiMessageMenu.cpp @@ -94,7 +94,7 @@ void GUIMessageMenu::regenerateGui(v2u32 screensize) chartowchar_t(gettext("Proceed"))); Environment->setFocus(e); } - changeCtype("en_US.UTF-8"); + changeCtype("C"); } void GUIMessageMenu::drawMenu() From c08720bfbaa0c02442f070c23569fcd44b653e9d Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Sat, 30 Jul 2011 18:35:55 +0200 Subject: [PATCH 129/158] this fixes problem with msvc++ and should work on other systems and so on anyway. --- src/gettext.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gettext.h b/src/gettext.h index a42820a..3413f38 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -13,7 +13,6 @@ inline void init_gettext(const char *path) { #if USE_GETTEXT - setlocale(LC_MESSAGES, ""); bindtextdomain(PROJECT_NAME, path); textdomain(PROJECT_NAME); #endif From 3c0090c0df37df2a5176ced8f8dcb20292df599e Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Sat, 30 Jul 2011 22:28:18 +0200 Subject: [PATCH 130/158] german translation update, translated some of the new strings --- po/de/minetest.po | 112 +++++++++++++++++++++++----------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/po/de/minetest.po b/po/de/minetest.po index fb7da44..910271f 100644 --- a/po/de/minetest.po +++ b/po/de/minetest.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: 0.0.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2011-07-30 11:20+0200\n" -"PO-Revision-Date: 2011-07-30 11:38+0100\n" +"PO-Revision-Date: 2011-07-30 22:27+0100\n" "Last-Translator: Constantin Wenger \n" "Language-Team: Deutsch <>\n" "Language: de\n" @@ -19,70 +19,70 @@ msgstr "" #: src/guiKeyChangeMenu.cpp:84 msgid "KEYBINDINGS" -msgstr "" +msgstr "TASTENZUORDNUNG" #: src/guiKeyChangeMenu.cpp:94 msgid "Forward" -msgstr "" +msgstr "Vorwärts" #: src/guiKeyChangeMenu.cpp:111 msgid "Backward" -msgstr "" +msgstr "Rückwärts" #: src/guiKeyChangeMenu.cpp:127 #: src/guiKeyChangeMenu.h:38 msgid "Left" -msgstr "" +msgstr "Links" #: src/guiKeyChangeMenu.cpp:142 #: src/guiKeyChangeMenu.h:38 msgid "Right" -msgstr "" +msgstr "Rechts" #: src/guiKeyChangeMenu.cpp:158 msgid "Use" -msgstr "" +msgstr "Benutzen" #: src/guiKeyChangeMenu.cpp:173 msgid "Sneak" -msgstr "" +msgstr "Kriechen" #: src/guiKeyChangeMenu.cpp:189 msgid "Jump" -msgstr "" +msgstr "Springen" #: src/guiKeyChangeMenu.cpp:204 msgid "Inventory" -msgstr "" +msgstr "Inventar" #: src/guiKeyChangeMenu.cpp:220 msgid "Chat" -msgstr "" +msgstr "Chat" #: src/guiKeyChangeMenu.cpp:236 msgid "Toggle fly" -msgstr "" +msgstr "Fliegen umschalten" #: src/guiKeyChangeMenu.cpp:251 msgid "Toggle fast" -msgstr "" +msgstr "Speed umschalten" #: src/guiKeyChangeMenu.cpp:267 msgid "Range select" -msgstr "" +msgstr "Entfernung wählen" #: src/guiKeyChangeMenu.cpp:285 msgid "Print stacks" -msgstr "" +msgstr "Stack ausgeben" #: src/guiKeyChangeMenu.cpp:300 msgid "Save" -msgstr "" +msgstr "Speichern" #: src/guiKeyChangeMenu.cpp:306 #: src/guiKeyChangeMenu.h:33 msgid "Cancel" -msgstr "" +msgstr "Abbrechen" #: src/guiKeyChangeMenu.cpp:531 #: src/guiKeyChangeMenu.cpp:536 @@ -98,11 +98,11 @@ msgstr "" #: src/guiKeyChangeMenu.cpp:586 #: src/guiKeyChangeMenu.cpp:591 msgid "press Key" -msgstr "" +msgstr "Taste drücken" #: src/guiKeyChangeMenu.h:33 msgid "Left Button" -msgstr "" +msgstr "linke Taste" #: src/guiKeyChangeMenu.h:33 msgid "Middle Button" @@ -118,19 +118,19 @@ msgstr "" #: src/guiKeyChangeMenu.h:34 msgid "Back" -msgstr "" +msgstr "Zurück" #: src/guiKeyChangeMenu.h:34 msgid "Clear" -msgstr "" +msgstr "löschen" #: src/guiKeyChangeMenu.h:34 msgid "Return" -msgstr "" +msgstr "Return" #: src/guiKeyChangeMenu.h:34 msgid "Tab" -msgstr "" +msgstr "Tab" #: src/guiKeyChangeMenu.h:34 msgid "X Button 2" @@ -142,7 +142,7 @@ msgstr "" #: src/guiKeyChangeMenu.h:35 msgid "Control" -msgstr "" +msgstr "Strg" #: src/guiKeyChangeMenu.h:35 msgid "Kana" @@ -150,15 +150,15 @@ msgstr "" #: src/guiKeyChangeMenu.h:35 msgid "Menu" -msgstr "" +msgstr "Menü" #: src/guiKeyChangeMenu.h:35 msgid "Pause" -msgstr "" +msgstr "Pause" #: src/guiKeyChangeMenu.h:35 msgid "Shift" -msgstr "" +msgstr "Umschalten" #: src/guiKeyChangeMenu.h:36 msgid "Convert" @@ -166,7 +166,7 @@ msgstr "" #: src/guiKeyChangeMenu.h:36 msgid "Escape" -msgstr "" +msgstr "Escape" #: src/guiKeyChangeMenu.h:36 msgid "Final" @@ -186,15 +186,15 @@ msgstr "" #: src/guiKeyChangeMenu.h:37 msgid "Accept" -msgstr "" +msgstr "Annehmen" #: src/guiKeyChangeMenu.h:37 msgid "End" -msgstr "" +msgstr "Ende" #: src/guiKeyChangeMenu.h:37 msgid "Home" -msgstr "" +msgstr "Home" #: src/guiKeyChangeMenu.h:37 msgid "Mode Change" @@ -202,7 +202,7 @@ msgstr "" #: src/guiKeyChangeMenu.h:37 msgid "Next" -msgstr "" +msgstr "Nächstes" #: src/guiKeyChangeMenu.h:37 msgid "Priot" @@ -210,47 +210,47 @@ msgstr "" #: src/guiKeyChangeMenu.h:37 msgid "Space" -msgstr "" +msgstr "Leertaste" #: src/guiKeyChangeMenu.h:38 msgid "Down" -msgstr "" +msgstr "Runter" #: src/guiKeyChangeMenu.h:38 msgid "Execute" -msgstr "" +msgstr "Ausführen" #: src/guiKeyChangeMenu.h:38 msgid "Print" -msgstr "" +msgstr "Druck" #: src/guiKeyChangeMenu.h:38 msgid "Select" -msgstr "" +msgstr "Select" #: src/guiKeyChangeMenu.h:38 msgid "Up" -msgstr "" +msgstr "Hoch" #: src/guiKeyChangeMenu.h:39 msgid "Delete" -msgstr "Delete" +msgstr "Entf" #: src/guiKeyChangeMenu.h:39 msgid "Help" -msgstr "" +msgstr "Hilfe" #: src/guiKeyChangeMenu.h:39 msgid "Insert" -msgstr "" +msgstr "Einfg" #: src/guiKeyChangeMenu.h:39 msgid "Snapshot" -msgstr "" +msgstr "Schnapschuss" #: src/guiKeyChangeMenu.h:42 msgid "Left Windows" -msgstr "" +msgstr "Win links" #: src/guiKeyChangeMenu.h:43 msgid "Apps" @@ -258,55 +258,55 @@ msgstr "" #: src/guiKeyChangeMenu.h:43 msgid "Numpad 0" -msgstr "" +msgstr "Ziffernblock 0" #: src/guiKeyChangeMenu.h:43 msgid "Numpad 1" -msgstr "" +msgstr "Ziffernblock 1" #: src/guiKeyChangeMenu.h:43 msgid "Right Windows" -msgstr "" +msgstr "Win rechts" #: src/guiKeyChangeMenu.h:43 msgid "Sleep" -msgstr "" +msgstr "Schlaf" #: src/guiKeyChangeMenu.h:44 msgid "Numpad 2" -msgstr "" +msgstr "Ziffernblock 2" #: src/guiKeyChangeMenu.h:44 msgid "Numpad 3" -msgstr "" +msgstr "Ziffernblock 3" #: src/guiKeyChangeMenu.h:44 msgid "Numpad 4" -msgstr "" +msgstr "Ziffernblock 4" #: src/guiKeyChangeMenu.h:44 msgid "Numpad 5" -msgstr "" +msgstr "Ziffernblock 5" #: src/guiKeyChangeMenu.h:44 msgid "Numpad 6" -msgstr "" +msgstr "Ziffernblock 6" #: src/guiKeyChangeMenu.h:44 msgid "Numpad 7" -msgstr "" +msgstr "Ziffernblock 7" #: src/guiKeyChangeMenu.h:45 msgid "Numpad *" -msgstr "" +msgstr "Ziffernblock *" #: src/guiKeyChangeMenu.h:45 msgid "Numpad +" -msgstr "" +msgstr "Ziffernblock +" #: src/guiKeyChangeMenu.h:45 msgid "Numpad -" -msgstr "" +msgstr "Ziffernblock -" #: src/guiKeyChangeMenu.h:45 msgid "Numpad /" From 50dc2d8112786907aebdb1324f79cb4f88039c50 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Sat, 30 Jul 2011 23:05:40 +0200 Subject: [PATCH 131/158] fixe for msvc broke linux --- src/gettext.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gettext.h b/src/gettext.h index 3413f38..b62421c 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -13,6 +13,10 @@ inline void init_gettext(const char *path) { #if USE_GETTEXT + #if MSVC + #else + setlocale(LC_MESSAGES, ""); + #endif bindtextdomain(PROJECT_NAME, path); textdomain(PROJECT_NAME); #endif From 54de4afd75ba7102925484fd5ed1d6fba3df46f6 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Sun, 31 Jul 2011 14:28:07 +0200 Subject: [PATCH 132/158] last fix was shit but this one works (tested) --- src/gettext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gettext.h b/src/gettext.h index b62421c..ff3a0f8 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -13,8 +13,8 @@ inline void init_gettext(const char *path) { #if USE_GETTEXT - #if MSVC - #else + // don't do this if MSVC compiler is used, it gives an assertion fail + #ifndef _MSC_VER setlocale(LC_MESSAGES, ""); #endif bindtextdomain(PROJECT_NAME, path); From bc2819cab2978c61b2ca1d7b68a5d1f223e8647a Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Wed, 27 Jul 2011 10:18:09 -0700 Subject: [PATCH 133/158] Added ladders--they don't have any use yet, though --- data/item_ladder.png | Bin 0 -> 581 bytes data/ladder.png | Bin 0 -> 691 bytes src/content_craft.cpp | 16 +++++++++++++ src/content_mapblock.cpp | 47 ++++++++++++++++++++++++++++++++++++ src/content_mapnode.cpp | 13 ++++++++++ src/content_mapnode.h | 1 + src/game.cpp | 50 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 127 insertions(+) create mode 100644 data/item_ladder.png create mode 100644 data/ladder.png diff --git a/data/item_ladder.png b/data/item_ladder.png new file mode 100644 index 0000000000000000000000000000000000000000..f35978ff94352873d8d0060614b449fa7f208981 GIT binary patch literal 581 zcmV-L0=oT)P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RW2O0(eD*uG3f&c&k*GWV{R4C7N z(!XmIK@P(FRlh@? z-oF*aX%vs7EC672X|~%7ip=mmv`qeK`zzOpqD)a8G`iUEF&pl?eyg$4VU_~`+gopc z1-+*02*XR_NGELd%B9m6_qsj&+gCHRKtm#khfiLdbTI(v9iLw9Y_4CNGEB=bO++0R z=g%oxRe6-g0w&bWt82+{lq91p&+*UiL#dLi!V>7DK(HSQnF)~uNbn0zK~(Pf)8{>pAWsguQn6!q&(tsoBa=dNZr0&b0PyDX zUNRI~nHk~0WTDChvu&NBj!3CCC~{I;JA3_ccWg`b4~p#>Q&Ch@18vd>P>1;k_>BVa TRIpI^00000NkvXXu0mjfQ8D^V literal 0 HcmV?d00001 diff --git a/data/ladder.png b/data/ladder.png new file mode 100644 index 0000000000000000000000000000000000000000..dbbd680ec27c8aef38165f96ca27bfe3cb144996 GIT binary patch literal 691 zcmV;k0!;mhP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipf4 z1vwxJh(bO900J{fL_t(I%YBp2Y7~HsDc@zrGYj8aoq6e{+(2W#@7y&MVCscK+bglP;TKOItfXV5OfT{=Py4} z5pLdEVHkvX{(#O=?|8uCS%3aNm2miG2aAlrpl+G5Gu?rQzYp$>-tVz1VoupgeBwl~)SPJKSLn77eVp``%^|E<^Wb^w@M Z`Y#$^E%7qwXI}sS002ovPDHLkV1g}?CyW39 literal 0 HcmV?d00001 diff --git a/src/content_craft.cpp b/src/content_craft.cpp index b5a1dc7..481ea1a 100644 --- a/src/content_craft.cpp +++ b/src/content_craft.cpp @@ -413,6 +413,22 @@ InventoryItem *craft_get_result(InventoryItem **items) } } + // Ladder + { + ItemSpec specs[9]; + specs[0] = ItemSpec(ITEM_CRAFT, "Stick"); + specs[2] = ItemSpec(ITEM_CRAFT, "Stick"); + specs[3] = ItemSpec(ITEM_CRAFT, "Stick"); + specs[4] = ItemSpec(ITEM_CRAFT, "Stick"); + specs[5] = ItemSpec(ITEM_CRAFT, "Stick"); + specs[6] = ItemSpec(ITEM_CRAFT, "Stick"); + specs[8] = ItemSpec(ITEM_CRAFT, "Stick"); + if(checkItemCombination(items, specs)) + { + return new MaterialItem(CONTENT_LADDER, 1); + } + } + return NULL; } diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp index 3044c8b..ceb6736 100644 --- a/src/content_mapblock.cpp +++ b/src/content_mapblock.cpp @@ -1134,6 +1134,53 @@ void mapblock_mesh_generate_special(MeshMakeData *data, u16 indices[] = {0,1,2,2,3,0}; collector.append(material_rail, vertices, 4, indices, 6); } + else if (n.d == CONTENT_LADDER) { + u8 l = decode_light(n.getLightBlend(data->m_daynight_ratio)); + video::SColor c(255,l,l,l); + + float d = (float)BS/16; + + // Assume wall is at X+ + video::S3DVertex vertices[4] = + { + video::S3DVertex(BS/2-d,-BS/2,-BS/2, 0,0,0, c, 0,1), + video::S3DVertex(BS/2-d,-BS/2,BS/2, 0,0,0, c, 1,1), + video::S3DVertex(BS/2-d,BS/2,BS/2, 0,0,0, c, 1,0), + video::S3DVertex(BS/2-d,BS/2,-BS/2, 0,0,0, c, 0,0), + }; + + v3s16 dir = unpackDir(n.dir); + + for(s32 i=0; i<4; i++) + { + if(dir == v3s16(1,0,0)) + vertices[i].Pos.rotateXZBy(0); + if(dir == v3s16(-1,0,0)) + vertices[i].Pos.rotateXZBy(180); + if(dir == v3s16(0,0,1)) + vertices[i].Pos.rotateXZBy(90); + if(dir == v3s16(0,0,-1)) + vertices[i].Pos.rotateXZBy(-90); + if(dir == v3s16(0,-1,0)) + vertices[i].Pos.rotateXYBy(-90); + if(dir == v3s16(0,1,0)) + vertices[i].Pos.rotateXYBy(90); + + vertices[i].Pos += intToFloat(p + blockpos_nodes, BS); + } + + video::SMaterial material_ladder; + material_ladder.setFlag(video::EMF_LIGHTING, false); + material_ladder.setFlag(video::EMF_BACK_FACE_CULLING, false); + material_ladder.setFlag(video::EMF_BILINEAR_FILTER, false); + material_ladder.setFlag(video::EMF_FOG_ENABLE, true); + material_ladder.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; + material_ladder.setTexture(0, g_texturesource->getTextureRaw("ladder.png")); + + u16 indices[] = {0,1,2,2,3,0}; + // Add to mesh collector + collector.append(material_ladder, vertices, 4, indices, 6); + } } } #endif diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp index 7589f06..e323577 100644 --- a/src/content_mapnode.cpp +++ b/src/content_mapnode.cpp @@ -303,6 +303,19 @@ void content_mapnode_init() f->walkable = false; setDirtLikeDiggingProperties(f->digging_properties, 0.75); + i = CONTENT_LADDER; + f = &content_features(i); + f->setInventoryTexture("item_ladder.png"); + f->light_propagates = true; + f->param_type = CPT_LIGHT; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem ")+itos(i)+" 1"; + f->wall_mounted = true; + f->solidness = 0; + f->air_equivalent = true; + f->walkable = false; + setWoodLikeDiggingProperties(f->digging_properties, 0.5); + // Deprecated i = CONTENT_COALSTONE; f = &content_features(i); diff --git a/src/content_mapnode.h b/src/content_mapnode.h index 609df0a..8f44126 100644 --- a/src/content_mapnode.h +++ b/src/content_mapnode.h @@ -46,6 +46,7 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version); #define CONTENT_FURNACE 16 #define CONTENT_FENCE 21 #define CONTENT_RAIL 30 +#define CONTENT_LADDER 31 // 0x800...0xfff (2048...4095): higher 4 bytes of param2 are not usable #define CONTENT_GRASS 0x800 //1 diff --git a/src/game.cpp b/src/game.cpp index 6c0474e..d8ea45f 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -538,6 +538,56 @@ void getPointedNode(Client *client, v3f player_position, } } } + + else if(n.getContent() == CONTENT_LADDER) + { + v3s16 dir = unpackDir(n.dir); + v3f dir_f = v3f(dir.X, dir.Y, dir.Z); + dir_f *= BS/2 - BS/6 - BS/20; + v3f cpf = npf + dir_f; + f32 distance = (cpf - camera_position).getLength(); + + v3f vertices[4] = + { + v3f(BS*0.42,-BS/2,-BS/2), + v3f(BS*0.49, BS/2, BS/2), + }; + + for(s32 i=0; i<2; i++) + { + if(dir == v3s16(1,0,0)) + vertices[i].rotateXZBy(0); + if(dir == v3s16(-1,0,0)) + vertices[i].rotateXZBy(180); + if(dir == v3s16(0,0,1)) + vertices[i].rotateXZBy(90); + if(dir == v3s16(0,0,-1)) + vertices[i].rotateXZBy(-90); + if(dir == v3s16(0,-1,0)) + vertices[i].rotateXYBy(-90); + if(dir == v3s16(0,1,0)) + vertices[i].rotateXYBy(90); + + vertices[i] += npf; + } + + core::aabbox3d box; + + box = core::aabbox3d(vertices[0]); + box.addInternalPoint(vertices[1]); + + if(distance < mindistance) + { + if(box.intersectsWithLine(shootline)) + { + nodefound = true; + nodepos = np; + neighbourpos = np; + mindistance = distance; + nodehilightbox = box; + } + } + } else if(n.getContent() == CONTENT_RAIL) { v3s16 dir = unpackDir(n.param0); From 1c59cff8328bd85d6aed7df38b7eaddbeeca0aec Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Wed, 27 Jul 2011 14:38:48 -0700 Subject: [PATCH 134/158] Ladders implemented! --- src/content_mapnode.cpp | 1 + src/mapnode.h | 3 +++ src/player.cpp | 30 +++++++++++++++++++++++++++++- src/player.h | 1 + 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp index e323577..8e97fa6 100644 --- a/src/content_mapnode.cpp +++ b/src/content_mapnode.cpp @@ -314,6 +314,7 @@ void content_mapnode_init() f->solidness = 0; f->air_equivalent = true; f->walkable = false; + f->climbable = true; setWoodLikeDiggingProperties(f->digging_properties, 0.5); // Deprecated diff --git a/src/mapnode.h b/src/mapnode.h index 1fb84e1..484ad4e 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -128,6 +128,8 @@ struct ContentFeatures bool pointable; // Player can dig these bool diggable; + // Player can climb these + bool climbable; // Player can build on these bool buildable_to; // Whether the node has no liquid, source liquid or flowing liquid @@ -171,6 +173,7 @@ struct ContentFeatures walkable = true; pointable = true; diggable = true; + climbable = false; buildable_to = false; liquid_type = LIQUID_NONE; wall_mounted = false; diff --git a/src/player.cpp b/src/player.cpp index c43276e..3846cd8 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -375,6 +375,21 @@ void LocalPlayer::move(f32 dtime, Map &map, f32 pos_max_d, in_water_stable = false; } + /* + Check if player is climbing + */ + + try { + v3s16 pp = floatToInt(position + v3f(0,0.5*BS,0), BS); + v3s16 pp2 = floatToInt(position + v3f(0,-0.2*BS,0), BS); + is_climbing = (content_features(map.getNode(pp).d).climbable || + content_features(map.getNode(pp2).d).climbable); + } + catch(InvalidPositionException &e) + { + is_climbing = false; + } + /* Collision uncertainty radius Make it a bit larger than the maximum distance of movement @@ -461,7 +476,7 @@ void LocalPlayer::move(f32 dtime, Map &map, f32 pos_max_d, Player is allowed to jump when this is true. */ touching_ground = false; - + /*std::cout<<"Checking collisions for (" < (" @@ -814,6 +829,19 @@ void LocalPlayer::applyControl(float dtime) } } + if (is_climbing) { + if (control.up || control.left || control.right || control.down) { + v3f speed = getSpeed(); + speed.Y = 2*BS; + setSpeed(speed); + } + else { + v3f speed = getSpeed(); + speed.Y = -2*BS; + setSpeed(speed); + } + } + // The speed of the player (Y is ignored) if(superspeed) speed = speed.normalize() * walkspeed_max * 5.0; diff --git a/src/player.h b/src/player.h index 29460e1..78ca149 100644 --- a/src/player.h +++ b/src/player.h @@ -118,6 +118,7 @@ public: bool in_water; // This is more stable and defines the maximum speed of the player bool in_water_stable; + bool is_climbing; bool swimming_up; Inventory inventory; From 8e67f4c4e617a8fcbb9176de1bf0b267acfc6e2f Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Sat, 30 Jul 2011 17:26:13 -0700 Subject: [PATCH 135/158] Fixed a few problems in the ladder update, and changed the speed to account for gravity --- src/content_mapblock.cpp | 4 ++-- src/game.cpp | 2 +- src/player.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp index ceb6736..ed2cd76 100644 --- a/src/content_mapblock.cpp +++ b/src/content_mapblock.cpp @@ -1134,7 +1134,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data, u16 indices[] = {0,1,2,2,3,0}; collector.append(material_rail, vertices, 4, indices, 6); } - else if (n.d == CONTENT_LADDER) { + else if (n.getContent() == CONTENT_LADDER) { u8 l = decode_light(n.getLightBlend(data->m_daynight_ratio)); video::SColor c(255,l,l,l); @@ -1149,7 +1149,7 @@ void mapblock_mesh_generate_special(MeshMakeData *data, video::S3DVertex(BS/2-d,BS/2,-BS/2, 0,0,0, c, 0,0), }; - v3s16 dir = unpackDir(n.dir); + v3s16 dir = unpackDir(n.param2); for(s32 i=0; i<4; i++) { diff --git a/src/game.cpp b/src/game.cpp index d8ea45f..fb5d7cb 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -541,7 +541,7 @@ void getPointedNode(Client *client, v3f player_position, else if(n.getContent() == CONTENT_LADDER) { - v3s16 dir = unpackDir(n.dir); + v3s16 dir = unpackDir(n.param2); v3f dir_f = v3f(dir.X, dir.Y, dir.Z); dir_f *= BS/2 - BS/6 - BS/20; v3f cpf = npf + dir_f; diff --git a/src/player.cpp b/src/player.cpp index 3846cd8..270f795 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -382,8 +382,8 @@ void LocalPlayer::move(f32 dtime, Map &map, f32 pos_max_d, try { v3s16 pp = floatToInt(position + v3f(0,0.5*BS,0), BS); v3s16 pp2 = floatToInt(position + v3f(0,-0.2*BS,0), BS); - is_climbing = (content_features(map.getNode(pp).d).climbable || - content_features(map.getNode(pp2).d).climbable); + is_climbing = (content_features(map.getNode(pp).getContent()).climbable || + content_features(map.getNode(pp2).getContent()).climbable); } catch(InvalidPositionException &e) { @@ -832,7 +832,7 @@ void LocalPlayer::applyControl(float dtime) if (is_climbing) { if (control.up || control.left || control.right || control.down) { v3f speed = getSpeed(); - speed.Y = 2*BS; + speed.Y = 2.5*BS; setSpeed(speed); } else { From 267744a56871f6eecbb80c7999c2fcd79989fc1e Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Sat, 30 Jul 2011 21:53:05 -0700 Subject: [PATCH 136/158] Fixing ladders again --- src/environment.cpp | 4 +++- src/player.cpp | 27 +++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/environment.cpp b/src/environment.cpp index e9b94f3..680d209 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -1511,6 +1511,8 @@ void ClientEnvironment::step(float dtime) /* Get the speed the player is going */ + bool is_climbing = lplayer->is_climbing; + f32 player_speed = 0.001; // just some small value player_speed = lplayer->getSpeed().getLength(); @@ -1568,7 +1570,7 @@ void ClientEnvironment::step(float dtime) v3f lplayerpos = lplayer->getPosition(); // Apply physics - if(free_move == false) + if(free_move == false && is_climbing == false) { // Gravity v3f speed = lplayer->getSpeed(); diff --git a/src/player.cpp b/src/player.cpp index 270f795..be478e8 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -382,8 +382,8 @@ void LocalPlayer::move(f32 dtime, Map &map, f32 pos_max_d, try { v3s16 pp = floatToInt(position + v3f(0,0.5*BS,0), BS); v3s16 pp2 = floatToInt(position + v3f(0,-0.2*BS,0), BS); - is_climbing = (content_features(map.getNode(pp).getContent()).climbable || - content_features(map.getNode(pp2).getContent()).climbable); + is_climbing = ((content_features(map.getNode(pp).getContent()).climbable || + content_features(map.getNode(pp2).getContent()).climbable) && !free_move); } catch(InvalidPositionException &e) { @@ -738,7 +738,7 @@ void LocalPlayer::applyControl(float dtime) bool fast_move = g_settings.getBool("fast_move"); bool continuous_forward = g_settings.getBool("continuous_forward"); - if(free_move) + if(free_move || is_climbing) { v3f speed = getSpeed(); speed.Y = 0; @@ -765,6 +765,12 @@ void LocalPlayer::applyControl(float dtime) speed.Y = -walkspeed_max; setSpeed(speed); } + else if(is_climbing) + { + v3f speed = getSpeed(); + speed.Y = -3*BS; + setSpeed(speed); + } else { // If not free movement but fast is allowed, aux1 is @@ -827,17 +833,10 @@ void LocalPlayer::applyControl(float dtime) setSpeed(speed); swimming_up = true; } - } - - if (is_climbing) { - if (control.up || control.left || control.right || control.down) { - v3f speed = getSpeed(); - speed.Y = 2.5*BS; - setSpeed(speed); - } - else { - v3f speed = getSpeed(); - speed.Y = -2*BS; + else if(is_climbing) + { + v3f speed = getSpeed(); + speed.Y = 3*BS; setSpeed(speed); } } From 7bd9e53ae630feabe42ab48369913f93beac26a7 Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Sat, 30 Jul 2011 17:46:43 -0700 Subject: [PATCH 137/158] Changing CONTENT_LADDER to be an extended block --- src/content_mapnode.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/content_mapnode.h b/src/content_mapnode.h index 8f44126..9643db7 100644 --- a/src/content_mapnode.h +++ b/src/content_mapnode.h @@ -76,6 +76,5 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version); #define CONTENT_NC 0x817 #define CONTENT_NC_RB 0x818 - #endif From 363487c97bd90a83497785dbcccebf462d9a64f8 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Mon, 1 Aug 2011 15:47:02 +0200 Subject: [PATCH 138/158] * less clumsy ladder texture, based on rails --- data/item_ladder.png | Bin 581 -> 0 bytes data/ladder.png | Bin 691 -> 395 bytes src/content_mapnode.cpp | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 data/item_ladder.png diff --git a/data/item_ladder.png b/data/item_ladder.png deleted file mode 100644 index f35978ff94352873d8d0060614b449fa7f208981..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 581 zcmV-L0=oT)P)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RW2O0(eD*uG3f&c&k*GWV{R4C7N z(!XmIK@P(FRlh@? z-oF*aX%vs7EC672X|~%7ip=mmv`qeK`zzOpqD)a8G`iUEF&pl?eyg$4VU_~`+gopc z1-+*02*XR_NGELd%B9m6_qsj&+gCHRKtm#khfiLdbTI(v9iLw9Y_4CNGEB=bO++0R z=g%oxRe6-g0w&bWt82+{lq91p&+*UiL#dLi!V>7DK(HSQnF)~uNbn0zK~(Pf)8{>pAWsguQn6!q&(tsoBa=dNZr0&b0PyDX zUNRI~nHk~0WTDChvu&NBj!3CCC~{I;JA3_ccWg`b4~p#>Q&Ch@18vd>P>1;k_>BVa TRIpI^00000NkvXXu0mjfQ8D^V diff --git a/data/ladder.png b/data/ladder.png index dbbd680ec27c8aef38165f96ca27bfe3cb144996..11056359df244d768e3aa827f5de09feed10aabe 100644 GIT binary patch delta 356 zcmV-q0h|7_1&afaFn<9>Nkl#y>r_{RKiHK@ZTNy`1sG^z-Q`}lBt%9h8d}r zi>6*FeR1}0ptiGNJl7^?OA-T)BN>hqN*lU^m>>v#@KXZ+wSUj+V8W7@K}wh?gHAw7 z$a_=xwBX>hDQ2zkeU|()Qw>h`wv18f2mqH7b4HGVIm|29Y$+%-FdqlEjG zg%Ds%h$n`zO0cBB%ZYTs;n~BSZ*aW3X)>k}~HoWvBY$<59yXk_f zn6Hye0zdQF%WcO&qosj10CC*#=zsp5RD{OY4wXfhN~u83bpTLq z;UYQ-NsC?j(ovVZj8_)ilu4J6pIMu(EQc}(D~9l`Pq5wDHnD7##JV@0Mwcu zem}s7BY&(`58G^^M*;UXt^lBALNe+y^a50)-8!WO(0RvYDVO~#!9jDMP@6oTdlHy)w-{XSzmORepp4u=3@uhyQhAD*1HH`f79eLl6A px6x9er2z*2t=I2%0GM3*FB)Gh@iORVUjP6A00>D%PDHLkV1hBvBFF#$ diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp index 8e97fa6..b164033 100644 --- a/src/content_mapnode.cpp +++ b/src/content_mapnode.cpp @@ -305,7 +305,7 @@ void content_mapnode_init() i = CONTENT_LADDER; f = &content_features(i); - f->setInventoryTexture("item_ladder.png"); + f->setInventoryTexture("ladder.png"); f->light_propagates = true; f->param_type = CPT_LIGHT; f->is_ground_content = true; From 7b8227039fbbf36d84d4d37fcb8eaeddd8bbdacc Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Mon, 1 Aug 2011 16:49:35 +0200 Subject: [PATCH 139/158] * papyrus texture now darker and edgier --- data/papyrus.png | Bin 366 -> 206 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/data/papyrus.png b/data/papyrus.png index bf0dec7fe2f2048a4f521c8efce41fd775ef1339..3ebfcc6892d6f3e9f4d2232303203c1ab20d4351 100644 GIT binary patch delta 165 zcmV;W09ya<0?q-DF@K0jL_t(I%VS_*U|^`<=kz~+v(A48C?JK;#6TfnAxD!3XA1)Z zCj$e+=CuE08PIzqnt_3VfniPQeMXl2%{u>KCQf9qBFX@5V?~A!UtdAIFwyr400000NkvXXu0mjfUW!EJ delta 326 zcmX@d_>O6UVLfMoM`SSr1Gg{;GcwGYBf-GHz+U3%>&kwcjY(KW{zhOhQ#j!ZiJh^LC_9t-crj~9|Fem)dr27$@*8qAXq zNolsVmeS$tSn%?2Sc$#yfj==tk$>z@Zd{=L;B3PbJqb>!2HmF*KO0{?3=D!_ W(a*~oPt^cD%HZkh=d#Wzp$Pzxt%PX+ From bbd8e645a2e92157ac33e5bb1a89786d7f0c984c Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Mon, 1 Aug 2011 21:18:57 +0200 Subject: [PATCH 140/158] * README updated --- README | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README b/README index 60601eb..82a764a 100644 --- a/README +++ b/README @@ -5,6 +5,9 @@ New features: * refactored liquids (currently broken, water does not flow) * translation support (including german, french, italian) +New blocks: +* ladders (crafted from 7 sticks in a H form) + Alternate graphics: * Player * Omsk birds (instead of Oerkki ghosts) From 60bd878f0a0e0ad0c1d8f01aa9ba425e58cb2c2e Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 31 Jul 2011 08:57:52 +0200 Subject: [PATCH 141/158] Get rid of unused variables --- src/guiKeyChangeMenu.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp index 7855751..ffc6766 100644 --- a/src/guiKeyChangeMenu.cpp +++ b/src/guiKeyChangeMenu.cpp @@ -263,7 +263,6 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - const wchar_t *text = L"Range select"; Environment->addStaticText(chartowchar_t(gettext("Range select")), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); @@ -281,7 +280,6 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - const wchar_t *text = L"Print stacks"; Environment->addStaticText(chartowchar_t(gettext("Print stacks")), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); From 817180bd55dcadc81c0fc9753ba9bac573199dc9 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 31 Jul 2011 09:03:19 +0200 Subject: [PATCH 142/158] Introduce wgettext All usages of gettext() are converted to wchars, so let's factor this into a single inline. --- src/gettext.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gettext.h b/src/gettext.h index ff3a0f8..f2cb8e4 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -30,6 +30,11 @@ inline wchar_t* chartowchar_t(const char *str) return nstr; } +inline wchar_t* wgettext(const char *str) +{ + return chartowchar_t(gettext(str)); +} + inline void changeCtype(const char *l) { char *ret = NULL; From 1d1aec9631e3ae077db6060f0fe19487b7b23aae Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 31 Jul 2011 09:05:52 +0200 Subject: [PATCH 143/158] Use wgettext --- src/guiKeyChangeMenu.cpp | 58 +++++++++++++++++++-------------------- src/guiMainMenu.cpp | 20 +++++++------- src/guiMessageMenu.cpp | 2 +- src/guiPasswordChange.cpp | 10 +++---- src/guiPauseMenu.cpp | 8 +++--- src/guiTextInputMenu.cpp | 2 +- 6 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp index ffc6766..6e41677 100644 --- a/src/guiKeyChangeMenu.cpp +++ b/src/guiKeyChangeMenu.cpp @@ -81,7 +81,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) core::rect < s32 > rect(0, 0, 125, 20); rect += topleft + v2s32(25, 3); //gui::IGUIStaticText *t = - Environment->addStaticText(chartowchar_t(gettext("KEYBINDINGS")), + Environment->addStaticText(wgettext("KEYBINDINGS"), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -91,7 +91,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - Environment->addStaticText(chartowchar_t(gettext("Forward")), + Environment->addStaticText(wgettext("Forward"), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -108,7 +108,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - Environment->addStaticText(chartowchar_t(gettext("Backward")), + Environment->addStaticText(wgettext("Backward"), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -124,7 +124,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - Environment->addStaticText(chartowchar_t(gettext("Left")), + Environment->addStaticText(wgettext("Left"), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -139,7 +139,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - Environment->addStaticText(chartowchar_t(gettext("Right")), + Environment->addStaticText(wgettext("Right"), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -155,7 +155,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - Environment->addStaticText(chartowchar_t(gettext("Use")), + Environment->addStaticText(wgettext("Use"), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -170,7 +170,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - Environment->addStaticText(chartowchar_t(gettext("Sneak")), + Environment->addStaticText(wgettext("Sneak"), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -186,7 +186,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - Environment->addStaticText(chartowchar_t(gettext("Jump")), rect, false, true, this, -1); + Environment->addStaticText(wgettext("Jump"), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -201,7 +201,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - Environment->addStaticText(chartowchar_t(gettext("Inventory")), + Environment->addStaticText(wgettext("Inventory"), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -217,7 +217,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - Environment->addStaticText(chartowchar_t(gettext("Chat")), rect, false, true, this, -1); + Environment->addStaticText(wgettext("Chat"), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -233,7 +233,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - Environment->addStaticText(chartowchar_t(gettext("Toggle fly")), + Environment->addStaticText(wgettext("Toggle fly"), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -248,7 +248,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - Environment->addStaticText(chartowchar_t(gettext("Toggle fast")), + Environment->addStaticText(wgettext("Toggle fast"), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -263,7 +263,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - Environment->addStaticText(chartowchar_t(gettext("Range select")), + Environment->addStaticText(wgettext("Range select"), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -280,7 +280,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) { core::rect < s32 > rect(0, 0, 100, 20); rect += topleft + v2s32(offset.X, offset.Y); - Environment->addStaticText(chartowchar_t(gettext("Print stacks")), + Environment->addStaticText(wgettext("Print stacks"), rect, false, true, this, -1); //t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -295,13 +295,13 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) core::rect < s32 > rect(0, 0, 100, 30); rect += topleft + v2s32(size.X - 100 - 20, size.Y - 40); Environment->addButton(rect, this, GUI_ID_BACK_BUTTON, - chartowchar_t(gettext("Save"))); + wgettext("Save")); } { core::rect < s32 > rect(0, 0, 100, 30); rect += topleft + v2s32(size.X - 100 - 20 - 100 - 20, size.Y - 40); Environment->addButton(rect, this, GUI_ID_ABORT_BUTTON, - chartowchar_t(gettext("Cancel"))); + wgettext("Cancel")); } } @@ -526,67 +526,67 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event) case GUI_ID_KEY_FORWARD_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->forward->setText(chartowchar_t(gettext("press Key"))); + this->forward->setText(wgettext("press Key")); break; case GUI_ID_KEY_BACKWARD_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->backward->setText(chartowchar_t(gettext("press Key"))); + this->backward->setText(wgettext("press Key")); break; case GUI_ID_KEY_LEFT_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->left->setText(chartowchar_t(gettext("press Key"))); + this->left->setText(wgettext("press Key")); break; case GUI_ID_KEY_RIGHT_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->right->setText(chartowchar_t(gettext("press Key"))); + this->right->setText(wgettext("press Key")); break; case GUI_ID_KEY_USE_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->use->setText(chartowchar_t(gettext("press Key"))); + this->use->setText(wgettext("press Key")); break; case GUI_ID_KEY_FLY_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->fly->setText(chartowchar_t(gettext("press Key"))); + this->fly->setText(wgettext("press Key")); break; case GUI_ID_KEY_FAST_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->fast->setText(chartowchar_t(gettext("press Key"))); + this->fast->setText(wgettext("press Key")); break; case GUI_ID_KEY_JUMP_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->jump->setText(chartowchar_t(gettext("press Key"))); + this->jump->setText(wgettext("press Key")); break; case GUI_ID_KEY_CHAT_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->chat->setText(chartowchar_t(gettext("press Key"))); + this->chat->setText(wgettext("press Key")); break; case GUI_ID_KEY_SNEAK_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->sneak->setText(chartowchar_t(gettext("press Key"))); + this->sneak->setText(wgettext("press Key")); break; case GUI_ID_KEY_INVENTORY_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->inventory->setText(chartowchar_t(gettext("press Key"))); + this->inventory->setText(wgettext("press Key")); break; case GUI_ID_KEY_DUMP_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->dump->setText(chartowchar_t(gettext("press Key"))); + this->dump->setText(wgettext("press Key")); break; case GUI_ID_KEY_RANGE_BUTTON: resetMenu(); activeKey = event.GUIEvent.Caller->getID(); - this->range->setText(chartowchar_t(gettext("press Key"))); + this->range->setText(wgettext("press Key")); break; } //Buttons diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp index 63bc72d..2d5bd15 100644 --- a/src/guiMainMenu.cpp +++ b/src/guiMainMenu.cpp @@ -178,7 +178,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, 50+6); - Environment->addStaticText(chartowchar_t(gettext("Name/Password")), + Environment->addStaticText(wgettext("Name/Password"), rect, false, true, this, -1); } changeCtype("C"); @@ -203,7 +203,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, 100+6); - Environment->addStaticText(chartowchar_t(gettext("Address/Port")), + Environment->addStaticText(wgettext("Address/Port"), rect, false, true, this, -1); } changeCtype("C"); @@ -225,20 +225,20 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 400, 20); rect += topleft_client + v2s32(160, 100+35); - Environment->addStaticText(chartowchar_t(gettext("Leave address blank to start a local server.")), + Environment->addStaticText(wgettext("Leave address blank to start a local server."), rect, false, true, this, -1); } { core::rect rect(0, 0, 250, 30); rect += topleft_client + v2s32(35, 150); Environment->addCheckBox(fancy_trees, rect, this, GUI_ID_FANCYTREE_CB, - chartowchar_t(gettext("Fancy trees"))); + wgettext("Fancy trees")); } { core::rect rect(0, 0, 250, 30); rect += topleft_client + v2s32(35, 150+30); Environment->addCheckBox(smooth_lighting, rect, this, GUI_ID_SMOOTH_LIGHTING_CB, - chartowchar_t(gettext("Smooth Lighting"))); + wgettext("Smooth Lighting")); } // Start game button { @@ -246,7 +246,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) //rect += topleft_client + v2s32(size_client.X/2-180/2, 225-30/2); rect += topleft_client + v2s32(size_client.X-180-40, 150+25); Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON, - chartowchar_t(gettext("Start Game / Connect"))); + wgettext("Start Game / Connect")); } // Key change button @@ -255,7 +255,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) //rect += topleft_client + v2s32(size_client.X/2-180/2, 225-30/2); rect += topleft_client + v2s32(size_client.X-180-40-100-20, 150+25); Environment->addButton(rect, this, GUI_ID_CHANGE_KEYS_BUTTON, - chartowchar_t(gettext("Change keys"))); + wgettext("Change keys")); } /* Server section @@ -278,13 +278,13 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 250, 30); rect += topleft_server + v2s32(35, 30); Environment->addCheckBox(creative_mode, rect, this, GUI_ID_CREATIVE_CB, - chartowchar_t(gettext("Creative Mode"))); + wgettext("Creative Mode")); } { core::rect rect(0, 0, 250, 30); rect += topleft_server + v2s32(35, 60); Environment->addCheckBox(enable_damage, rect, this, GUI_ID_DAMAGE_CB, - chartowchar_t(gettext("Enable Damage"))); + wgettext("Enable Damage")); } // Map delete button { @@ -292,7 +292,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) //rect += topleft_server + v2s32(size_server.X-40-130, 100+25); rect += topleft_server + v2s32(40, 100+25); Environment->addButton(rect, this, GUI_ID_DELETE_MAP_BUTTON, - chartowchar_t(gettext("Delete map"))); + wgettext("Delete map")); } changeCtype("C"); } diff --git a/src/guiMessageMenu.cpp b/src/guiMessageMenu.cpp index 71c8fd1..14b3607 100644 --- a/src/guiMessageMenu.cpp +++ b/src/guiMessageMenu.cpp @@ -91,7 +91,7 @@ void GUIMessageMenu::regenerateGui(v2u32 screensize) rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25); gui::IGUIElement *e = Environment->addButton(rect, this, 257, - chartowchar_t(gettext("Proceed"))); + wgettext("Proceed")); Environment->setFocus(e); } changeCtype("C"); diff --git a/src/guiPasswordChange.cpp b/src/guiPasswordChange.cpp index 2a7fb00..273326f 100644 --- a/src/guiPasswordChange.cpp +++ b/src/guiPasswordChange.cpp @@ -100,7 +100,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - Environment->addStaticText(chartowchar_t(gettext("Old Password")), + Environment->addStaticText(wgettext("Old Password"), rect, false, true, this, -1); } changeCtype("C"); @@ -117,7 +117,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - Environment->addStaticText(chartowchar_t(gettext("New Password")), + Environment->addStaticText(wgettext("New Password"), rect, false, true, this, -1); } changeCtype("C"); @@ -133,7 +133,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - Environment->addStaticText(chartowchar_t(gettext("Confirm Password")), + Environment->addStaticText(wgettext("Confirm Password"), rect, false, true, this, -1); } changeCtype("C"); @@ -150,7 +150,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, ypos); - Environment->addButton(rect, this, ID_change, chartowchar_t(gettext("Change"))); + Environment->addButton(rect, this, ID_change, wgettext("Change")); } ypos += 50; @@ -159,7 +159,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) rect += topleft_client + v2s32(35, ypos); IGUIElement *e = Environment->addStaticText( - chartowchar_t(gettext("Passwords do not match!")), + wgettext("Passwords do not match!"), rect, false, true, this, ID_message); e->setVisible(false); } diff --git a/src/guiPauseMenu.cpp b/src/guiPauseMenu.cpp index 6cf364e..8ccf0c4 100644 --- a/src/guiPauseMenu.cpp +++ b/src/guiPauseMenu.cpp @@ -108,28 +108,28 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); Environment->addButton(rect, this, 256, - chartowchar_t(gettext("Continue"))); + wgettext("Continue")); } btn_y += btn_height + btn_gap; { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); Environment->addButton(rect, this, 261, - chartowchar_t(gettext("Change Password"))); + wgettext("Change Password")); } btn_y += btn_height + btn_gap; { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); Environment->addButton(rect, this, 260, - chartowchar_t(gettext("Disconnect"))); + wgettext("Disconnect")); } btn_y += btn_height + btn_gap; { core::rect rect(0, 0, 140, btn_height); rect = rect + v2s32(size.X/2-140/2, btn_y); Environment->addButton(rect, this, 257, - chartowchar_t(gettext("Exit to OS"))); + wgettext("Exit to OS")); } { diff --git a/src/guiTextInputMenu.cpp b/src/guiTextInputMenu.cpp index a596025..bfe0ea5 100644 --- a/src/guiTextInputMenu.cpp +++ b/src/guiTextInputMenu.cpp @@ -109,7 +109,7 @@ void GUITextInputMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25); Environment->addButton(rect, this, 257, - chartowchar_t(gettext("Proceed"))); + wgettext("Proceed")); } changeCtype("C"); } From 0b37f98e16038256cb568a1d3f004b8cdeb78df5 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Wed, 3 Aug 2011 19:00:25 +0200 Subject: [PATCH 144/158] * fix for broken water --- src/map.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/map.cpp b/src/map.cpp index 092ce97..d51aa46 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1086,7 +1086,7 @@ void Map::addNodeAndUpdate(v3s16 p, MapNode n, v3s16 p2 = p + dirs[i]; MapNode n2 = getNode(p2); - if(content_liquid(n2.getContent())) + if(content_liquid(n2.getContent()) || n2.getContent() == CONTENT_AIR) { m_transforming_liquid.push_back(p2); } @@ -1260,7 +1260,7 @@ void Map::removeNodeAndUpdate(v3s16 p, v3s16 p2 = p + dirs[i]; MapNode n2 = getNode(p2); - if(content_liquid(n2.getContent())) + if(content_liquid(n2.getContent()) || n2.getContent() == CONTENT_AIR) { m_transforming_liquid.push_back(p2); } From 735fa8b652547683fc4cf9726eee4b8bc2c12d5f Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 3 Aug 2011 19:01:55 +0200 Subject: [PATCH 145/158] * README updated --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 82a764a..9fe48f2 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ Minetest Δ (“Minetest Delta”) is a fork of Minetest-c55 Date: Thu, 4 Aug 2011 18:21:44 +0200 Subject: [PATCH 146/158] * Welcome to OMSK. --- data/oerkki1.png | Bin 333 -> 482 bytes data/oerkki1_damaged.png | Bin 291 -> 427 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/data/oerkki1.png b/data/oerkki1.png index 1256a8a574408a2f1c6096d68c0bdd734c4ea0aa..2c0f8e7aa14096d07d554b5c746ea5a93415f2b8 100644 GIT binary patch delta 443 zcmV;s0Yv`I0^$RZF@Ky%L_t(o!|hl*Zo@DPeR6Y!>|Qf#GSIP?Fp!~F;7N3a4gq|L zjs-et&Z^yKh}of15UXawOmt z_9S1H1SEjZ!=VQ_3sBPqw-hewZCzmB+-!lWxc#JvEnr^`e*lh*DVxQmHL&^fKoKJy znz<7ll$PNY2y8wB19q!%RSKw51jn*G4>-{O`V8lr0jFoOPjAd{ux?f-phgOq0ufg; zivF&*5}~^t@}xtCukRtyF*g%YHJ||@feX#ZB=s}VX*A#^yYqlAA2Rp5NqnvYPXcRp lA=`;AUO>8;jUcLse*j)WpC*+zAASG;002ovPDHLkV1fa>$5a3S delta 293 zcmV+=0owlJ1I+@EF@Fb1L_t(o!|hnX4TCTYJSfZX&I(<~lVpjG(G~J$n&Lj7Rf$q+ zuv?NUmiQb-_9b?F0WdNLumgAxcDOl!FZ1(APKs%*Md8+1tUg7U2O!0QG6#zt7-N7E zP9*$xt98~}>OZ_E<9MBQ@iu-4HR`q~t2d2P0((V%DF^3Dyf6ReOpc1GADuGI% r5-3g!&3fn-Egs0G--Q7a%Fnbp@3QmsaT9i#dXyd$v zCBaAjL*%B)wtdl@$A8XyHIF=`wV+A}__rO?fdN0<@r+yfSvxjeVW2A;2G8tp iosLID7;Bl!kY?#bkB>0000ntfK*GJF=(8?RtxmTiG*`o zEodJp{}?Cb^@4WrN#LUi;r|&tb|0P*V3eH#5QW;b07 Date: Tue, 2 Aug 2011 10:36:14 +0200 Subject: [PATCH 147/158] added danish translation made by Frederik Helth --- po/da/minetest.po | 497 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 497 insertions(+) create mode 100644 po/da/minetest.po diff --git a/po/da/minetest.po b/po/da/minetest.po new file mode 100644 index 0000000..846abaa --- /dev/null +++ b/po/da/minetest.po @@ -0,0 +1,497 @@ +# German translations for minetest-c55 package. +# Copyright (C) 2011 celeron +# This file is distributed under the same license as the minetest-c55 package. +# Frederik Helth , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.0.0\n" +"Report-Msgid-Bugs-To: Constantin Wenger \n" +"POT-Creation-Date: 2011-07-30 11:20+0200\n" +"PO-Revision-Date: 2011-08-02 00:31+0100\n" +"Last-Translator: Frederik Helth \n" +"Language-Team: \n" +"Language: da\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/guiKeyChangeMenu.cpp:84 +msgid "KEYBINDINGS" +msgstr "" + +#: src/guiKeyChangeMenu.cpp:94 +msgid "Forward" +msgstr "Frem" + +#: src/guiKeyChangeMenu.cpp:111 +msgid "Backward" +msgstr "Tilbage" + +#: src/guiKeyChangeMenu.cpp:127 +#: src/guiKeyChangeMenu.h:38 +msgid "Left" +msgstr "Venstre" + +#: src/guiKeyChangeMenu.cpp:142 +#: src/guiKeyChangeMenu.h:38 +msgid "Right" +msgstr "Højre" + +#: src/guiKeyChangeMenu.cpp:158 +msgid "Use" +msgstr "Brug" + +#: src/guiKeyChangeMenu.cpp:173 +msgid "Sneak" +msgstr "Snig" + +#: src/guiKeyChangeMenu.cpp:189 +msgid "Jump" +msgstr "Hop" + +#: src/guiKeyChangeMenu.cpp:204 +msgid "Inventory" +msgstr "Ting" + +#: src/guiKeyChangeMenu.cpp:220 +msgid "Chat" +msgstr "Chat" + +#: src/guiKeyChangeMenu.cpp:236 +msgid "Toggle fly" +msgstr "Flyvning" + +#: src/guiKeyChangeMenu.cpp:251 +msgid "Toggle fast" +msgstr "Hurtig flyvning" + +#: src/guiKeyChangeMenu.cpp:267 +msgid "Range select" +msgstr "Afstands load" + +#: src/guiKeyChangeMenu.cpp:285 +msgid "Print stacks" +msgstr "Print stykker" + +#: src/guiKeyChangeMenu.cpp:300 +msgid "Save" +msgstr "Gem" + +#: src/guiKeyChangeMenu.cpp:306 +#: src/guiKeyChangeMenu.h:33 +msgid "Cancel" +msgstr "Afslut" + +#: src/guiKeyChangeMenu.cpp:531 +#: src/guiKeyChangeMenu.cpp:536 +#: src/guiKeyChangeMenu.cpp:541 +#: src/guiKeyChangeMenu.cpp:546 +#: src/guiKeyChangeMenu.cpp:551 +#: src/guiKeyChangeMenu.cpp:556 +#: src/guiKeyChangeMenu.cpp:561 +#: src/guiKeyChangeMenu.cpp:566 +#: src/guiKeyChangeMenu.cpp:571 +#: src/guiKeyChangeMenu.cpp:576 +#: src/guiKeyChangeMenu.cpp:581 +#: src/guiKeyChangeMenu.cpp:586 +#: src/guiKeyChangeMenu.cpp:591 +msgid "press Key" +msgstr "Tryk knap" + +#: src/guiKeyChangeMenu.h:33 +msgid "Left Button" +msgstr "Venstre Knap" + +#: src/guiKeyChangeMenu.h:33 +msgid "Middle Button" +msgstr "Midt Knap" + +#: src/guiKeyChangeMenu.h:33 +msgid "Right Button" +msgstr "Højre Knap" + +#: src/guiKeyChangeMenu.h:33 +msgid "X Button 1" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "Back" +msgstr "Tilbage" + +#: src/guiKeyChangeMenu.h:34 +msgid "Clear" +msgstr "Rens" + +#: src/guiKeyChangeMenu.h:34 +msgid "Return" +msgstr "Tilbage" + +#: src/guiKeyChangeMenu.h:34 +msgid "Tab" +msgstr "" + +#: src/guiKeyChangeMenu.h:34 +msgid "X Button 2" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Capital" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Control" +msgstr "Kontrol" + +#: src/guiKeyChangeMenu.h:35 +msgid "Kana" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Menu" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Pause" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Shift" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Convert" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Escape" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Final" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Junja" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Kanji" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Nonconvert" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Accept" +msgstr "Accepter" + +#: src/guiKeyChangeMenu.h:37 +msgid "End" +msgstr "Slut" + +#: src/guiKeyChangeMenu.h:37 +msgid "Home" +msgstr "Hjem" + +#: src/guiKeyChangeMenu.h:37 +msgid "Mode Change" +msgstr "Mode skift" + +#: src/guiKeyChangeMenu.h:37 +msgid "Next" +msgstr "Næste" + +#: src/guiKeyChangeMenu.h:37 +msgid "Priot" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Space" +msgstr "Mellemrum" + +#: src/guiKeyChangeMenu.h:38 +msgid "Down" +msgstr "Ned" + +#: src/guiKeyChangeMenu.h:38 +msgid "Execute" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Print" +msgstr "" + +#: src/guiKeyChangeMenu.h:38 +msgid "Select" +msgstr "Vælge" + +#: src/guiKeyChangeMenu.h:38 +msgid "Up" +msgstr "Op" + +#: src/guiKeyChangeMenu.h:39 +msgid "Delete" +msgstr "Slet" + +#: src/guiKeyChangeMenu.h:39 +msgid "Help" +msgstr "Hjælp" + +#: src/guiKeyChangeMenu.h:39 +msgid "Insert" +msgstr "Indset" + +#: src/guiKeyChangeMenu.h:39 +msgid "Snapshot" +msgstr "Screenshot" + +#: src/guiKeyChangeMenu.h:42 +msgid "Left Windows" +msgstr "Venstre windows" + +#: src/guiKeyChangeMenu.h:43 +msgid "Apps" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Numpad 0" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Numpad 1" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Right Windows" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Sleep" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 2" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 3" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 4" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 5" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 6" +msgstr "" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 7" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad *" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad +" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad -" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad /" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad 8" +msgstr "" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad 9" +msgstr "" + +#: src/guiKeyChangeMenu.h:49 +msgid "Num Lock" +msgstr "" + +#: src/guiKeyChangeMenu.h:49 +msgid "Scroll Lock" +msgstr "" + +#: src/guiKeyChangeMenu.h:50 +msgid "Left Shift" +msgstr "" + +#: src/guiKeyChangeMenu.h:50 +msgid "Right Shight" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Left Control" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Left Menu" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Right Control" +msgstr "" + +#: src/guiKeyChangeMenu.h:51 +msgid "Right Menu" +msgstr "" + +#: src/guiKeyChangeMenu.h:53 +msgid "Comma" +msgstr "" + +#: src/guiKeyChangeMenu.h:53 +msgid "Minus" +msgstr "" + +#: src/guiKeyChangeMenu.h:53 +msgid "Period" +msgstr "" + +#: src/guiKeyChangeMenu.h:53 +msgid "Plus" +msgstr "" + +#: src/guiKeyChangeMenu.h:57 +msgid "Attn" +msgstr "" + +#: src/guiKeyChangeMenu.h:57 +msgid "CrSel" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "Erase OEF" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "ExSel" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "OEM Clear" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "PA1" +msgstr "" + +#: src/guiKeyChangeMenu.h:58 +msgid "Play" +msgstr "Spil" + +#: src/guiKeyChangeMenu.h:58 +msgid "Zoom" +msgstr "" + +#: src/guiMainMenu.cpp:181 +msgid "Name/Password" +msgstr "Navn/kodeord" + +#: src/guiMainMenu.cpp:206 +msgid "Address/Port" +msgstr "Adresse/port" + +#: src/guiMainMenu.cpp:228 +msgid "Leave address blank to start a local server." +msgstr "Lad black for at spille localt" + +#: src/guiMainMenu.cpp:235 +msgid "Fancy trees" +msgstr "Fancy trær" + +#: src/guiMainMenu.cpp:241 +msgid "Smooth Lighting" +msgstr "" + +#: src/guiMainMenu.cpp:249 +msgid "Start Game / Connect" +msgstr "Start spil" + +#: src/guiMainMenu.cpp:258 +msgid "Change keys" +msgstr "Indstillinger" + +#: src/guiMainMenu.cpp:281 +msgid "Creative Mode" +msgstr "Kreativ mode" + +#: src/guiMainMenu.cpp:287 +msgid "Enable Damage" +msgstr "Tag imod skade" + +#: src/guiMainMenu.cpp:295 +msgid "Delete map" +msgstr "Slet mappen" + +#: src/guiMessageMenu.cpp:94 +#: src/guiTextInputMenu.cpp:112 +msgid "Proceed" +msgstr "Fortsæt" + +#: src/guiPasswordChange.cpp:103 +msgid "Old Password" +msgstr "Gamle kodeord" + +#: src/guiPasswordChange.cpp:120 +msgid "New Password" +msgstr "Nye kodeord" + +#: src/guiPasswordChange.cpp:136 +msgid "Confirm Password" +msgstr "Gentag kodeord" + +#: src/guiPasswordChange.cpp:153 +msgid "Change" +msgstr "Skift" + +#: src/guiPasswordChange.cpp:162 +msgid "Passwords do not match!" +msgstr "Kodeordne matcher ikke hinanden!" + +#: src/guiPauseMenu.cpp:111 +msgid "Continue" +msgstr "Fortsæt" + +#: src/guiPauseMenu.cpp:118 +msgid "Change Password" +msgstr "Skift kodeord" + +#: src/guiPauseMenu.cpp:125 +msgid "Disconnect" +msgstr "Logud" + +#: src/guiPauseMenu.cpp:132 +msgid "Exit to OS" +msgstr "Afslut til OS" + +#: src/guiPauseMenu.cpp:139 +msgid "" +"Keys:\n" +"- WASD: Walk\n" +"- Mouse left: dig blocks\n" +"- Mouse right: place blocks\n" +"- Mouse wheel: select item\n" +"- 0...9: select item\n" +"- Shift: sneak\n" +"- R: Toggle viewing all loaded chunks\n" +"- I: Inventory menu\n" +"- ESC: This menu\n" +"- T: Chat\n" +msgstr "" + From 0cfca69b42e1a252584367c06a7bcfd6d2781411 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Tue, 2 Aug 2011 10:44:25 +0200 Subject: [PATCH 148/158] fixed displaying special chars in the keychange menu --- src/guiKeyChangeMenu.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp index 6e41677..cdf32d1 100644 --- a/src/guiKeyChangeMenu.cpp +++ b/src/guiKeyChangeMenu.cpp @@ -76,7 +76,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) recalculateAbsolutePosition(false); v2s32 topleft(0, 0); - + changeCtype(""); { core::rect < s32 > rect(0, 0, 125, 20); rect += topleft + v2s32(25, 3); @@ -303,6 +303,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) Environment->addButton(rect, this, GUI_ID_ABORT_BUTTON, wgettext("Cancel")); } + changeCtype("C"); } void GUIKeyChangeMenu::drawMenu() @@ -417,6 +418,7 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event) if (event.EventType == EET_KEY_INPUT_EVENT && activeKey >= 0 && event.KeyInput.PressedDown) { + changeCtype(""); if (activeKey == GUI_ID_KEY_FORWARD_BUTTON) { this->forward->setText( @@ -495,7 +497,7 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event) narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); this->key_dump = event.KeyInput.Key; } - + changeCtype("C"); activeKey = -1; return true; } @@ -514,6 +516,12 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event) } if (event.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED) { + if(event.GUIEvent.Caller->getID() != GUI_ID_BACK_BUTTON && + event.GUIEvent.Caller->getID() != GUI_ID_ABORT_BUTTON) + { + changeCtype(""); + } + switch (event.GUIEvent.Caller->getID()) { case GUI_ID_BACK_BUTTON: //back @@ -590,6 +598,7 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event) break; } //Buttons + changeCtype("C"); } } From 4ab4e3345040f8543f2a54c04dceeb899680ad5d Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Tue, 2 Aug 2011 11:38:35 +0200 Subject: [PATCH 149/158] marked strings as translation now translated if set to a button --- src/guiKeyChangeMenu.cpp | 78 ++++++++++++++++++++-------------------- src/guiKeyChangeMenu.h | 34 +++++++++--------- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp index cdf32d1..20a3d36 100644 --- a/src/guiKeyChangeMenu.cpp +++ b/src/guiKeyChangeMenu.cpp @@ -101,7 +101,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) rect += topleft + v2s32(offset.X + 105, offset.Y - 5); this->forward = Environment->addButton(rect, this, GUI_ID_KEY_FORWARD_BUTTON, - narrow_to_wide(KeyNames[key_forward]).c_str()); + wgettext(KeyNames[key_forward])); } offset += v2s32(0, 25); @@ -118,7 +118,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) rect += topleft + v2s32(offset.X + 105, offset.Y - 5); this->backward = Environment->addButton(rect, this, GUI_ID_KEY_BACKWARD_BUTTON, - narrow_to_wide(KeyNames[key_backward]).c_str()); + wgettext(KeyNames[key_backward])); } offset += v2s32(0, 25); { @@ -133,7 +133,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) core::rect < s32 > rect(0, 0, 100, 30); rect += topleft + v2s32(offset.X + 105, offset.Y - 5); this->left = Environment->addButton(rect, this, GUI_ID_KEY_LEFT_BUTTON, - narrow_to_wide(KeyNames[key_left]).c_str()); + wgettext(KeyNames[key_left])); } offset += v2s32(0, 25); { @@ -149,7 +149,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) rect += topleft + v2s32(offset.X + 105, offset.Y - 5); this->right = Environment->addButton(rect, this, GUI_ID_KEY_RIGHT_BUTTON, - narrow_to_wide(KeyNames[key_right]).c_str()); + wgettext(KeyNames[key_right])); } offset += v2s32(0, 25); { @@ -164,7 +164,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) core::rect < s32 > rect(0, 0, 100, 30); rect += topleft + v2s32(offset.X + 105, offset.Y - 5); this->use = Environment->addButton(rect, this, GUI_ID_KEY_USE_BUTTON, - narrow_to_wide(KeyNames[key_use]).c_str()); + wgettext(KeyNames[key_use])); } offset += v2s32(0, 25); { @@ -180,7 +180,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) rect += topleft + v2s32(offset.X + 105, offset.Y - 5); this->sneak = Environment->addButton(rect, this, GUI_ID_KEY_SNEAK_BUTTON, - narrow_to_wide(KeyNames[key_sneak]).c_str()); + wgettext(KeyNames[key_sneak])); } offset += v2s32(0, 25); { @@ -194,7 +194,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) core::rect < s32 > rect(0, 0, 100, 30); rect += topleft + v2s32(offset.X + 105, offset.Y - 5); this->jump = Environment->addButton(rect, this, GUI_ID_KEY_JUMP_BUTTON, - narrow_to_wide(KeyNames[key_jump]).c_str()); + wgettext(KeyNames[key_jump])); } offset += v2s32(0, 25); @@ -211,7 +211,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) rect += topleft + v2s32(offset.X + 105, offset.Y - 5); this->inventory = Environment->addButton(rect, this, GUI_ID_KEY_INVENTORY_BUTTON, - narrow_to_wide(KeyNames[key_inventory]).c_str()); + wgettext(KeyNames[key_inventory])); } offset += v2s32(0, 25); { @@ -225,7 +225,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) core::rect < s32 > rect(0, 0, 100, 30); rect += topleft + v2s32(offset.X + 105, offset.Y - 5); this->chat = Environment->addButton(rect, this, GUI_ID_KEY_CHAT_BUTTON, - narrow_to_wide(KeyNames[key_chat]).c_str()); + wgettext(KeyNames[key_chat])); } //next col @@ -242,7 +242,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) core::rect < s32 > rect(0, 0, 100, 30); rect += topleft + v2s32(offset.X + 105, offset.Y - 5); this->fly = Environment->addButton(rect, this, GUI_ID_KEY_FLY_BUTTON, - narrow_to_wide(KeyNames[key_fly]).c_str()); + wgettext(KeyNames[key_fly])); } offset += v2s32(0, 25); { @@ -257,7 +257,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) core::rect < s32 > rect(0, 0, 100, 30); rect += topleft + v2s32(offset.X + 105, offset.Y - 5); this->fast = Environment->addButton(rect, this, GUI_ID_KEY_FAST_BUTTON, - narrow_to_wide(KeyNames[key_fast]).c_str()); + wgettext(KeyNames[key_fast])); } offset += v2s32(0, 25); { @@ -273,7 +273,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) rect += topleft + v2s32(offset.X + 105, offset.Y - 5); this->range = Environment->addButton(rect, this, GUI_ID_KEY_RANGE_BUTTON, - narrow_to_wide(KeyNames[key_range]).c_str()); + wgettext(KeyNames[key_range])); } offset += v2s32(0, 25); @@ -289,7 +289,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) core::rect < s32 > rect(0, 0, 100, 30); rect += topleft + v2s32(offset.X + 105, offset.Y - 5); this->dump = Environment->addButton(rect, this, GUI_ID_KEY_DUMP_BUTTON, - narrow_to_wide(KeyNames[key_dump]).c_str()); + wgettext(KeyNames[key_dump])); } { core::rect < s32 > rect(0, 0, 100, 30); @@ -367,45 +367,45 @@ bool GUIKeyChangeMenu::resetMenu() { case GUI_ID_KEY_FORWARD_BUTTON: this->forward->setText( - narrow_to_wide(KeyNames[key_forward]).c_str()); + wgettext(KeyNames[key_forward])); break; case GUI_ID_KEY_BACKWARD_BUTTON: this->backward->setText( - narrow_to_wide(KeyNames[key_backward]).c_str()); + wgettext(KeyNames[key_backward])); break; case GUI_ID_KEY_LEFT_BUTTON: - this->left->setText(narrow_to_wide(KeyNames[key_left]).c_str()); + this->left->setText(wgettext(KeyNames[key_left])); break; case GUI_ID_KEY_RIGHT_BUTTON: - this->right->setText(narrow_to_wide(KeyNames[key_right]).c_str()); + this->right->setText(wgettext(KeyNames[key_right])); break; case GUI_ID_KEY_JUMP_BUTTON: - this->jump->setText(narrow_to_wide(KeyNames[key_jump]).c_str()); + this->jump->setText(wgettext(KeyNames[key_jump])); break; case GUI_ID_KEY_SNEAK_BUTTON: - this->sneak->setText(narrow_to_wide(KeyNames[key_sneak]).c_str()); + this->sneak->setText(wgettext(KeyNames[key_sneak])); break; case GUI_ID_KEY_INVENTORY_BUTTON: this->inventory->setText( - narrow_to_wide(KeyNames[key_inventory]).c_str()); + wgettext(KeyNames[key_inventory])); break; case GUI_ID_KEY_CHAT_BUTTON: - this->chat->setText(narrow_to_wide(KeyNames[key_chat]).c_str()); + this->chat->setText(wgettext(KeyNames[key_chat])); break; case GUI_ID_KEY_RANGE_BUTTON: - this->range->setText(narrow_to_wide(KeyNames[key_range]).c_str()); + this->range->setText(wgettext(KeyNames[key_range])); break; case GUI_ID_KEY_FLY_BUTTON: - this->fly->setText(narrow_to_wide(KeyNames[key_fly]).c_str()); + this->fly->setText(wgettext(KeyNames[key_fly])); break; case GUI_ID_KEY_FAST_BUTTON: - this->fast->setText(narrow_to_wide(KeyNames[key_fast]).c_str()); + this->fast->setText(wgettext(KeyNames[key_fast])); break; case GUI_ID_KEY_USE_BUTTON: - this->use->setText(narrow_to_wide(KeyNames[key_use]).c_str()); + this->use->setText(wgettext(KeyNames[key_use])); break; case GUI_ID_KEY_DUMP_BUTTON: - this->dump->setText(narrow_to_wide(KeyNames[key_dump]).c_str()); + this->dump->setText(wgettext(KeyNames[key_dump])); break; } activeKey = -1; @@ -422,79 +422,79 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event) if (activeKey == GUI_ID_KEY_FORWARD_BUTTON) { this->forward->setText( - narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + wgettext(KeyNames[event.KeyInput.Key])); this->key_forward = event.KeyInput.Key; } else if (activeKey == GUI_ID_KEY_BACKWARD_BUTTON) { this->backward->setText( - narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + wgettext(KeyNames[event.KeyInput.Key])); this->key_backward = event.KeyInput.Key; } else if (activeKey == GUI_ID_KEY_LEFT_BUTTON) { this->left->setText( - narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + wgettext(KeyNames[event.KeyInput.Key])); this->key_left = event.KeyInput.Key; } else if (activeKey == GUI_ID_KEY_RIGHT_BUTTON) { this->right->setText( - narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + wgettext(KeyNames[event.KeyInput.Key])); this->key_right = event.KeyInput.Key; } else if (activeKey == GUI_ID_KEY_JUMP_BUTTON) { this->jump->setText( - narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + wgettext(KeyNames[event.KeyInput.Key])); this->key_jump = event.KeyInput.Key; } else if (activeKey == GUI_ID_KEY_SNEAK_BUTTON) { this->sneak->setText( - narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + wgettext(KeyNames[event.KeyInput.Key])); this->key_sneak = event.KeyInput.Key; } else if (activeKey == GUI_ID_KEY_INVENTORY_BUTTON) { this->inventory->setText( - narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + wgettext(KeyNames[event.KeyInput.Key])); this->key_inventory = event.KeyInput.Key; } else if (activeKey == GUI_ID_KEY_CHAT_BUTTON) { this->chat->setText( - narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + wgettext(KeyNames[event.KeyInput.Key])); this->key_chat = event.KeyInput.Key; } else if (activeKey == GUI_ID_KEY_RANGE_BUTTON) { this->range->setText( - narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + wgettext(KeyNames[event.KeyInput.Key])); this->key_range = event.KeyInput.Key; } else if (activeKey == GUI_ID_KEY_FLY_BUTTON) { this->fly->setText( - narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + wgettext(KeyNames[event.KeyInput.Key])); this->key_fly = event.KeyInput.Key; } else if (activeKey == GUI_ID_KEY_FAST_BUTTON) { this->fast->setText( - narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + wgettext(KeyNames[event.KeyInput.Key])); this->key_fast = event.KeyInput.Key; } else if (activeKey == GUI_ID_KEY_USE_BUTTON) { this->use->setText( - narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + wgettext(KeyNames[event.KeyInput.Key])); this->key_use = event.KeyInput.Key; } else if (activeKey == GUI_ID_KEY_DUMP_BUTTON) { this->dump->setText( - narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str()); + wgettext(KeyNames[event.KeyInput.Key])); this->key_dump = event.KeyInput.Key; } changeCtype("C"); diff --git a/src/guiKeyChangeMenu.h b/src/guiKeyChangeMenu.h index c40d802..db86ab2 100644 --- a/src/guiKeyChangeMenu.h +++ b/src/guiKeyChangeMenu.h @@ -30,32 +30,32 @@ #include static const char *KeyNames[] = - { "-", gettext("Left Button"), gettext("Right Button"), gettext("Cancel"), gettext("Middle Button"), gettext("X Button 1"), - gettext("X Button 2"), "-", gettext("Back"), gettext("Tab"), "-", "-", gettext("Clear"), gettext("Return"), "-", - "-", gettext("Shift"), gettext("Control"), gettext("Menu"), gettext("Pause"), gettext("Capital"), gettext("Kana"), "-", - gettext("Junja"), gettext("Final"), gettext("Kanji"), "-", gettext("Escape"), gettext("Convert"), gettext("Nonconvert"), - gettext("Accept"), gettext("Mode Change"), gettext("Space"), gettext("Priot"), gettext("Next"), gettext("End"), gettext("Home"), - gettext("Left"), gettext("Up"), gettext("Right"), gettext("Down"), gettext("Select"), gettext("Print"), gettext("Execute"), - gettext("Snapshot"), gettext("Insert"), gettext("Delete"), gettext("Help"), "0", "1", "2", "3", "4", "5", + { "-", N_("Left Button"), N_("Right Button"), N_("Cancel"), N_("Middle Button"), N_("X Button 1"), + N_("X Button 2"), "-", N_("Back"), N_("Tab"), "-", "-", N_("Clear"), N_("Return"), "-", + "-", N_("Shift"), N_("Control"), N_("Menu"), N_("Pause"), N_("Capital"), N_("Kana"), "-", + N_("Junja"), N_("Final"), N_("Kanji"), "-", N_("Escape"), N_("Convert"), N_("Nonconvert"), + N_("Accept"), N_("Mode Change"), N_("Space"), N_("Priot"), N_("Next"), N_("End"), N_("Home"), + N_("Left"), N_("Up"), N_("Right"), N_("Down"), N_("Select"), N_("Print"), N_("Execute"), + N_("Snapshot"), N_("Insert"), N_("Delete"), N_("Help"), "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "-", "-", "-", "-", "-", "-", "-", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", - "R", "S", "T", "U", "V", "W", "X", "Y", "Z", gettext("Left Windows"), - gettext("Right Windows"), gettext("Apps"), "-", gettext("Sleep"), gettext("Numpad 0"), gettext("Numpad 1"), - gettext("Numpad 2"), gettext("Numpad 3"), gettext("Numpad 4"), gettext("Numpad 5"), gettext("Numpad 6"), gettext("Numpad 7"), - gettext("Numpad 8"), gettext("Numpad 9"), gettext("Numpad *"), gettext("Numpad +"), gettext("Numpad /"), gettext("Numpad -"), + "R", "S", "T", "U", "V", "W", "X", "Y", "Z", N_("Left Windows"), + N_("Right Windows"), N_("Apps"), "-", N_("Sleep"), N_("Numpad 0"), N_("Numpad 1"), + N_("Numpad 2"), N_("Numpad 3"), N_("Numpad 4"), N_("Numpad 5"), N_("Numpad 6"), N_("Numpad 7"), + N_("Numpad 8"), N_("Numpad 9"), N_("Numpad *"), N_("Numpad +"), N_("Numpad /"), N_("Numpad -"), "Numpad .", "Numpad /", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16", "F17", "F18", "F19", "F20", "F21", "F22", "F23", "F24", "-", "-", "-", "-", "-", "-", - "-", "-", gettext("Num Lock"), gettext("Scroll Lock"), "-", "-", "-", "-", "-", "-", "-", - "-", "-", "-", "-", "-", "-", "-", gettext("Left Shift"), gettext("Right Shight"), - gettext("Left Control"), gettext("Right Control"), gettext("Left Menu"), gettext("Right Menu"), "-", "-", + "-", "-", N_("Num Lock"), N_("Scroll Lock"), "-", "-", "-", "-", "-", "-", "-", + "-", "-", "-", "-", "-", "-", "-", N_("Left Shift"), N_("Right Shight"), + N_("Left Control"), N_("Right Control"), N_("Left Menu"), N_("Right Menu"), "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", - "-", "-", "-", "-", "-", gettext("Plus"), gettext("Comma"), gettext("Minus"), gettext("Period"), "-", "-", + "-", "-", "-", "-", "-", N_("Plus"), N_("Comma"), N_("Minus"), N_("Period"), "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", - "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", gettext("Attn"), gettext("CrSel"), - gettext("ExSel"), gettext("Erase OEF"), gettext("Play"), gettext("Zoom"), gettext("PA1"), gettext("OEM Clear"), "-" }; + "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", N_("Attn"), N_("CrSel"), + N_("ExSel"), N_("Erase OEF"), N_("Play"), N_("Zoom"), N_("PA1"), N_("OEM Clear"), "-" }; enum { GUI_ID_BACK_BUTTON = 101, GUI_ID_ABORT_BUTTON, GUI_ID_SCROLL_BAR, From 45057667f1ca079145a8c51f8a636f35ee1f292a Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Tue, 2 Aug 2011 11:56:07 +0200 Subject: [PATCH 150/158] update to german translation --- po/de/minetest.po | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/po/de/minetest.po b/po/de/minetest.po index 910271f..e300540 100644 --- a/po/de/minetest.po +++ b/po/de/minetest.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: 0.0.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2011-07-30 11:20+0200\n" -"PO-Revision-Date: 2011-07-30 22:27+0100\n" +"PO-Revision-Date: 2011-08-02 11:54+0100\n" "Last-Translator: Constantin Wenger \n" "Language-Team: Deutsch <>\n" "Language: de\n" @@ -61,11 +61,11 @@ msgstr "Chat" #: src/guiKeyChangeMenu.cpp:236 msgid "Toggle fly" -msgstr "Fliegen umschalten" +msgstr "Fliegen umsch." #: src/guiKeyChangeMenu.cpp:251 msgid "Toggle fast" -msgstr "Speed umschalten" +msgstr "Speed umsch." #: src/guiKeyChangeMenu.cpp:267 msgid "Range select" @@ -118,7 +118,7 @@ msgstr "" #: src/guiKeyChangeMenu.h:34 msgid "Back" -msgstr "Zurück" +msgstr "Rücktaste" #: src/guiKeyChangeMenu.h:34 msgid "Clear" @@ -138,7 +138,7 @@ msgstr "" #: src/guiKeyChangeMenu.h:35 msgid "Capital" -msgstr "" +msgstr "Feststellen" #: src/guiKeyChangeMenu.h:35 msgid "Control" @@ -158,7 +158,7 @@ msgstr "Pause" #: src/guiKeyChangeMenu.h:35 msgid "Shift" -msgstr "Umschalten" +msgstr "Umsch." #: src/guiKeyChangeMenu.h:36 msgid "Convert" @@ -194,7 +194,7 @@ msgstr "Ende" #: src/guiKeyChangeMenu.h:37 msgid "Home" -msgstr "Home" +msgstr "Pos1" #: src/guiKeyChangeMenu.h:37 msgid "Mode Change" @@ -202,11 +202,11 @@ msgstr "" #: src/guiKeyChangeMenu.h:37 msgid "Next" -msgstr "Nächstes" +msgstr "Bild runter" #: src/guiKeyChangeMenu.h:37 msgid "Priot" -msgstr "" +msgstr "Bild hoch" #: src/guiKeyChangeMenu.h:37 msgid "Space" @@ -330,11 +330,11 @@ msgstr "Rollen" #: src/guiKeyChangeMenu.h:50 msgid "Left Shift" -msgstr "Umschalten links" +msgstr "Umsch. links" #: src/guiKeyChangeMenu.h:50 msgid "Right Shight" -msgstr "" +msgstr "Umsch. rechts" #: src/guiKeyChangeMenu.h:51 msgid "Left Control" @@ -342,7 +342,7 @@ msgstr "Strg links" #: src/guiKeyChangeMenu.h:51 msgid "Left Menu" -msgstr "Menü links" +msgstr "Alt" #: src/guiKeyChangeMenu.h:51 msgid "Right Control" @@ -350,7 +350,7 @@ msgstr "Strg rechts" #: src/guiKeyChangeMenu.h:51 msgid "Right Menu" -msgstr "Menü rechts" +msgstr "Alt Gr" #: src/guiKeyChangeMenu.h:53 msgid "Comma" @@ -362,7 +362,7 @@ msgstr "Minus" #: src/guiKeyChangeMenu.h:53 msgid "Period" -msgstr "Periode" +msgstr "Punkt" #: src/guiKeyChangeMenu.h:53 msgid "Plus" From dade01be2927dbbc2ebbcf986d46c723961f3649 Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Tue, 2 Aug 2011 12:37:53 +0200 Subject: [PATCH 151/158] update op PO files --- po/da/minetest.po | 49 ++++++++++++++++++----------------------------- po/de/minetest.po | 48 ++++++++++++++++++---------------------------- po/fr/minetest.po | 31 +++++++++++++++--------------- po/it/minetest.po | 31 +++++++++++++++--------------- po/minetest.pot | 30 ++++++++++++++--------------- 5 files changed, 85 insertions(+), 104 deletions(-) diff --git a/po/da/minetest.po b/po/da/minetest.po index 846abaa..b64b5d8 100644 --- a/po/da/minetest.po +++ b/po/da/minetest.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: 0.0.0\n" -"Report-Msgid-Bugs-To: Constantin Wenger \n" -"POT-Creation-Date: 2011-07-30 11:20+0200\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-08-02 12:36+0200\n" "PO-Revision-Date: 2011-08-02 00:31+0100\n" "Last-Translator: Frederik Helth \n" "Language-Team: \n" @@ -28,13 +28,11 @@ msgstr "Frem" msgid "Backward" msgstr "Tilbage" -#: src/guiKeyChangeMenu.cpp:127 -#: src/guiKeyChangeMenu.h:38 +#: src/guiKeyChangeMenu.cpp:127 src/guiKeyChangeMenu.h:38 msgid "Left" msgstr "Venstre" -#: src/guiKeyChangeMenu.cpp:142 -#: src/guiKeyChangeMenu.h:38 +#: src/guiKeyChangeMenu.cpp:142 src/guiKeyChangeMenu.h:38 msgid "Right" msgstr "Højre" @@ -66,36 +64,29 @@ msgstr "Flyvning" msgid "Toggle fast" msgstr "Hurtig flyvning" -#: src/guiKeyChangeMenu.cpp:267 +#: src/guiKeyChangeMenu.cpp:266 msgid "Range select" msgstr "Afstands load" -#: src/guiKeyChangeMenu.cpp:285 +#: src/guiKeyChangeMenu.cpp:283 msgid "Print stacks" msgstr "Print stykker" -#: src/guiKeyChangeMenu.cpp:300 +#: src/guiKeyChangeMenu.cpp:298 msgid "Save" msgstr "Gem" -#: src/guiKeyChangeMenu.cpp:306 -#: src/guiKeyChangeMenu.h:33 +#: src/guiKeyChangeMenu.cpp:304 src/guiKeyChangeMenu.h:33 msgid "Cancel" msgstr "Afslut" -#: src/guiKeyChangeMenu.cpp:531 -#: src/guiKeyChangeMenu.cpp:536 -#: src/guiKeyChangeMenu.cpp:541 -#: src/guiKeyChangeMenu.cpp:546 -#: src/guiKeyChangeMenu.cpp:551 -#: src/guiKeyChangeMenu.cpp:556 -#: src/guiKeyChangeMenu.cpp:561 -#: src/guiKeyChangeMenu.cpp:566 -#: src/guiKeyChangeMenu.cpp:571 -#: src/guiKeyChangeMenu.cpp:576 -#: src/guiKeyChangeMenu.cpp:581 -#: src/guiKeyChangeMenu.cpp:586 -#: src/guiKeyChangeMenu.cpp:591 +#: src/guiKeyChangeMenu.cpp:537 src/guiKeyChangeMenu.cpp:542 +#: src/guiKeyChangeMenu.cpp:547 src/guiKeyChangeMenu.cpp:552 +#: src/guiKeyChangeMenu.cpp:557 src/guiKeyChangeMenu.cpp:562 +#: src/guiKeyChangeMenu.cpp:567 src/guiKeyChangeMenu.cpp:572 +#: src/guiKeyChangeMenu.cpp:577 src/guiKeyChangeMenu.cpp:582 +#: src/guiKeyChangeMenu.cpp:587 src/guiKeyChangeMenu.cpp:592 +#: src/guiKeyChangeMenu.cpp:597 msgid "press Key" msgstr "Tryk knap" @@ -439,8 +430,7 @@ msgstr "Tag imod skade" msgid "Delete map" msgstr "Slet mappen" -#: src/guiMessageMenu.cpp:94 -#: src/guiTextInputMenu.cpp:112 +#: src/guiMessageMenu.cpp:94 src/guiTextInputMenu.cpp:112 msgid "Proceed" msgstr "Fortsæt" @@ -482,10 +472,10 @@ msgstr "Afslut til OS" #: src/guiPauseMenu.cpp:139 msgid "" -"Keys:\n" +"Default Controls:\n" "- WASD: Walk\n" -"- Mouse left: dig blocks\n" -"- Mouse right: place blocks\n" +"- Mouse left: dig/hit\n" +"- Mouse right: place/use\n" "- Mouse wheel: select item\n" "- 0...9: select item\n" "- Shift: sneak\n" @@ -494,4 +484,3 @@ msgid "" "- ESC: This menu\n" "- T: Chat\n" msgstr "" - diff --git a/po/de/minetest.po b/po/de/minetest.po index e300540..347adaf 100644 --- a/po/de/minetest.po +++ b/po/de/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-30 11:20+0200\n" +"POT-Creation-Date: 2011-08-02 12:36+0200\n" "PO-Revision-Date: 2011-08-02 11:54+0100\n" "Last-Translator: Constantin Wenger \n" "Language-Team: Deutsch <>\n" @@ -29,13 +29,11 @@ msgstr "Vorwärts" msgid "Backward" msgstr "Rückwärts" -#: src/guiKeyChangeMenu.cpp:127 -#: src/guiKeyChangeMenu.h:38 +#: src/guiKeyChangeMenu.cpp:127 src/guiKeyChangeMenu.h:38 msgid "Left" msgstr "Links" -#: src/guiKeyChangeMenu.cpp:142 -#: src/guiKeyChangeMenu.h:38 +#: src/guiKeyChangeMenu.cpp:142 src/guiKeyChangeMenu.h:38 msgid "Right" msgstr "Rechts" @@ -67,36 +65,29 @@ msgstr "Fliegen umsch." msgid "Toggle fast" msgstr "Speed umsch." -#: src/guiKeyChangeMenu.cpp:267 +#: src/guiKeyChangeMenu.cpp:266 msgid "Range select" msgstr "Entfernung wählen" -#: src/guiKeyChangeMenu.cpp:285 +#: src/guiKeyChangeMenu.cpp:283 msgid "Print stacks" msgstr "Stack ausgeben" -#: src/guiKeyChangeMenu.cpp:300 +#: src/guiKeyChangeMenu.cpp:298 msgid "Save" msgstr "Speichern" -#: src/guiKeyChangeMenu.cpp:306 -#: src/guiKeyChangeMenu.h:33 +#: src/guiKeyChangeMenu.cpp:304 src/guiKeyChangeMenu.h:33 msgid "Cancel" msgstr "Abbrechen" -#: src/guiKeyChangeMenu.cpp:531 -#: src/guiKeyChangeMenu.cpp:536 -#: src/guiKeyChangeMenu.cpp:541 -#: src/guiKeyChangeMenu.cpp:546 -#: src/guiKeyChangeMenu.cpp:551 -#: src/guiKeyChangeMenu.cpp:556 -#: src/guiKeyChangeMenu.cpp:561 -#: src/guiKeyChangeMenu.cpp:566 -#: src/guiKeyChangeMenu.cpp:571 -#: src/guiKeyChangeMenu.cpp:576 -#: src/guiKeyChangeMenu.cpp:581 -#: src/guiKeyChangeMenu.cpp:586 -#: src/guiKeyChangeMenu.cpp:591 +#: src/guiKeyChangeMenu.cpp:537 src/guiKeyChangeMenu.cpp:542 +#: src/guiKeyChangeMenu.cpp:547 src/guiKeyChangeMenu.cpp:552 +#: src/guiKeyChangeMenu.cpp:557 src/guiKeyChangeMenu.cpp:562 +#: src/guiKeyChangeMenu.cpp:567 src/guiKeyChangeMenu.cpp:572 +#: src/guiKeyChangeMenu.cpp:577 src/guiKeyChangeMenu.cpp:582 +#: src/guiKeyChangeMenu.cpp:587 src/guiKeyChangeMenu.cpp:592 +#: src/guiKeyChangeMenu.cpp:597 msgid "press Key" msgstr "Taste drücken" @@ -440,8 +431,7 @@ msgstr "Schaden einschalten" msgid "Delete map" msgstr "Karte löschen" -#: src/guiMessageMenu.cpp:94 -#: src/guiTextInputMenu.cpp:112 +#: src/guiMessageMenu.cpp:94 src/guiTextInputMenu.cpp:112 msgid "Proceed" msgstr "Fortsetzen" @@ -482,11 +472,12 @@ msgid "Exit to OS" msgstr "Programm beenden" #: src/guiPauseMenu.cpp:139 +#, fuzzy msgid "" -"Keys:\n" +"Default Controls:\n" "- WASD: Walk\n" -"- Mouse left: dig blocks\n" -"- Mouse right: place blocks\n" +"- Mouse left: dig/hit\n" +"- Mouse right: place/use\n" "- Mouse wheel: select item\n" "- 0...9: select item\n" "- Shift: sneak\n" @@ -505,4 +496,3 @@ msgstr "" "- R: alle geladenen Blöcke anzeigen (wechseln)\n" "- I: Inventarmenü\n" "- T: Chat\n" - diff --git a/po/fr/minetest.po b/po/fr/minetest.po index c1133fa..52a02c2 100644 --- a/po/fr/minetest.po +++ b/po/fr/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.0.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-30 11:20+0200\n" +"POT-Creation-Date: 2011-08-02 12:36+0200\n" "PO-Revision-Date: 2011-07-21 15:48+0200\n" "Last-Translator: Cyriaque 'Cisoun' Skrapits \n" "Language-Team: Français <>\n" @@ -65,29 +65,29 @@ msgstr "" msgid "Toggle fast" msgstr "" -#: src/guiKeyChangeMenu.cpp:267 +#: src/guiKeyChangeMenu.cpp:266 msgid "Range select" msgstr "" -#: src/guiKeyChangeMenu.cpp:285 +#: src/guiKeyChangeMenu.cpp:283 msgid "Print stacks" msgstr "" -#: src/guiKeyChangeMenu.cpp:300 +#: src/guiKeyChangeMenu.cpp:298 msgid "Save" msgstr "" -#: src/guiKeyChangeMenu.cpp:306 src/guiKeyChangeMenu.h:33 +#: src/guiKeyChangeMenu.cpp:304 src/guiKeyChangeMenu.h:33 msgid "Cancel" msgstr "" -#: src/guiKeyChangeMenu.cpp:531 src/guiKeyChangeMenu.cpp:536 -#: src/guiKeyChangeMenu.cpp:541 src/guiKeyChangeMenu.cpp:546 -#: src/guiKeyChangeMenu.cpp:551 src/guiKeyChangeMenu.cpp:556 -#: src/guiKeyChangeMenu.cpp:561 src/guiKeyChangeMenu.cpp:566 -#: src/guiKeyChangeMenu.cpp:571 src/guiKeyChangeMenu.cpp:576 -#: src/guiKeyChangeMenu.cpp:581 src/guiKeyChangeMenu.cpp:586 -#: src/guiKeyChangeMenu.cpp:591 +#: src/guiKeyChangeMenu.cpp:537 src/guiKeyChangeMenu.cpp:542 +#: src/guiKeyChangeMenu.cpp:547 src/guiKeyChangeMenu.cpp:552 +#: src/guiKeyChangeMenu.cpp:557 src/guiKeyChangeMenu.cpp:562 +#: src/guiKeyChangeMenu.cpp:567 src/guiKeyChangeMenu.cpp:572 +#: src/guiKeyChangeMenu.cpp:577 src/guiKeyChangeMenu.cpp:582 +#: src/guiKeyChangeMenu.cpp:587 src/guiKeyChangeMenu.cpp:592 +#: src/guiKeyChangeMenu.cpp:597 msgid "press Key" msgstr "" @@ -474,11 +474,12 @@ msgid "Exit to OS" msgstr "Quitter le jeu" #: src/guiPauseMenu.cpp:139 +#, fuzzy msgid "" -"Keys:\n" +"Default Controls:\n" "- WASD: Walk\n" -"- Mouse left: dig blocks\n" -"- Mouse right: place blocks\n" +"- Mouse left: dig/hit\n" +"- Mouse right: place/use\n" "- Mouse wheel: select item\n" "- 0...9: select item\n" "- Shift: sneak\n" diff --git a/po/it/minetest.po b/po/it/minetest.po index c3c924f..3269420 100644 --- a/po/it/minetest.po +++ b/po/it/minetest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-30 11:20+0200\n" +"POT-Creation-Date: 2011-08-02 12:36+0200\n" "PO-Revision-Date: 2011-07-24 18:56+0200\n" "Last-Translator: Giuseppe Bilotta \n" "Language-Team: Italian\n" @@ -65,29 +65,29 @@ msgstr "" msgid "Toggle fast" msgstr "" -#: src/guiKeyChangeMenu.cpp:267 +#: src/guiKeyChangeMenu.cpp:266 msgid "Range select" msgstr "" -#: src/guiKeyChangeMenu.cpp:285 +#: src/guiKeyChangeMenu.cpp:283 msgid "Print stacks" msgstr "" -#: src/guiKeyChangeMenu.cpp:300 +#: src/guiKeyChangeMenu.cpp:298 msgid "Save" msgstr "" -#: src/guiKeyChangeMenu.cpp:306 src/guiKeyChangeMenu.h:33 +#: src/guiKeyChangeMenu.cpp:304 src/guiKeyChangeMenu.h:33 msgid "Cancel" msgstr "" -#: src/guiKeyChangeMenu.cpp:531 src/guiKeyChangeMenu.cpp:536 -#: src/guiKeyChangeMenu.cpp:541 src/guiKeyChangeMenu.cpp:546 -#: src/guiKeyChangeMenu.cpp:551 src/guiKeyChangeMenu.cpp:556 -#: src/guiKeyChangeMenu.cpp:561 src/guiKeyChangeMenu.cpp:566 -#: src/guiKeyChangeMenu.cpp:571 src/guiKeyChangeMenu.cpp:576 -#: src/guiKeyChangeMenu.cpp:581 src/guiKeyChangeMenu.cpp:586 -#: src/guiKeyChangeMenu.cpp:591 +#: src/guiKeyChangeMenu.cpp:537 src/guiKeyChangeMenu.cpp:542 +#: src/guiKeyChangeMenu.cpp:547 src/guiKeyChangeMenu.cpp:552 +#: src/guiKeyChangeMenu.cpp:557 src/guiKeyChangeMenu.cpp:562 +#: src/guiKeyChangeMenu.cpp:567 src/guiKeyChangeMenu.cpp:572 +#: src/guiKeyChangeMenu.cpp:577 src/guiKeyChangeMenu.cpp:582 +#: src/guiKeyChangeMenu.cpp:587 src/guiKeyChangeMenu.cpp:592 +#: src/guiKeyChangeMenu.cpp:597 msgid "press Key" msgstr "" @@ -474,11 +474,12 @@ msgid "Exit to OS" msgstr "Esci al S.O." #: src/guiPauseMenu.cpp:139 +#, fuzzy msgid "" -"Keys:\n" +"Default Controls:\n" "- WASD: Walk\n" -"- Mouse left: dig blocks\n" -"- Mouse right: place blocks\n" +"- Mouse left: dig/hit\n" +"- Mouse right: place/use\n" "- Mouse wheel: select item\n" "- 0...9: select item\n" "- Shift: sneak\n" diff --git a/po/minetest.pot b/po/minetest.pot index eebdc18..b4ae8ee 100644 --- a/po/minetest.pot +++ b/po/minetest.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: minetest\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-30 11:20+0200\n" +"POT-Creation-Date: 2011-08-02 12:36+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -65,29 +65,29 @@ msgstr "" msgid "Toggle fast" msgstr "" -#: src/guiKeyChangeMenu.cpp:267 +#: src/guiKeyChangeMenu.cpp:266 msgid "Range select" msgstr "" -#: src/guiKeyChangeMenu.cpp:285 +#: src/guiKeyChangeMenu.cpp:283 msgid "Print stacks" msgstr "" -#: src/guiKeyChangeMenu.cpp:300 +#: src/guiKeyChangeMenu.cpp:298 msgid "Save" msgstr "" -#: src/guiKeyChangeMenu.cpp:306 src/guiKeyChangeMenu.h:33 +#: src/guiKeyChangeMenu.cpp:304 src/guiKeyChangeMenu.h:33 msgid "Cancel" msgstr "" -#: src/guiKeyChangeMenu.cpp:531 src/guiKeyChangeMenu.cpp:536 -#: src/guiKeyChangeMenu.cpp:541 src/guiKeyChangeMenu.cpp:546 -#: src/guiKeyChangeMenu.cpp:551 src/guiKeyChangeMenu.cpp:556 -#: src/guiKeyChangeMenu.cpp:561 src/guiKeyChangeMenu.cpp:566 -#: src/guiKeyChangeMenu.cpp:571 src/guiKeyChangeMenu.cpp:576 -#: src/guiKeyChangeMenu.cpp:581 src/guiKeyChangeMenu.cpp:586 -#: src/guiKeyChangeMenu.cpp:591 +#: src/guiKeyChangeMenu.cpp:537 src/guiKeyChangeMenu.cpp:542 +#: src/guiKeyChangeMenu.cpp:547 src/guiKeyChangeMenu.cpp:552 +#: src/guiKeyChangeMenu.cpp:557 src/guiKeyChangeMenu.cpp:562 +#: src/guiKeyChangeMenu.cpp:567 src/guiKeyChangeMenu.cpp:572 +#: src/guiKeyChangeMenu.cpp:577 src/guiKeyChangeMenu.cpp:582 +#: src/guiKeyChangeMenu.cpp:587 src/guiKeyChangeMenu.cpp:592 +#: src/guiKeyChangeMenu.cpp:597 msgid "press Key" msgstr "" @@ -473,10 +473,10 @@ msgstr "" #: src/guiPauseMenu.cpp:139 msgid "" -"Keys:\n" +"Default Controls:\n" "- WASD: Walk\n" -"- Mouse left: dig blocks\n" -"- Mouse right: place blocks\n" +"- Mouse left: dig/hit\n" +"- Mouse right: place/use\n" "- Mouse wheel: select item\n" "- 0...9: select item\n" "- Shift: sneak\n" From 0fb208e63c18c74d32e53651820e02f41aaad76c Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Tue, 2 Aug 2011 12:38:47 +0200 Subject: [PATCH 152/158] updated po update script to detect wgettext and N_ --- util/updatepo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/updatepo.sh b/util/updatepo.sh index bcfa4c4..fbf1aad 100755 --- a/util/updatepo.sh +++ b/util/updatepo.sh @@ -48,7 +48,7 @@ cd .. # directory at the top level. You a recent enough xgettext that supports # --package-name potfile=po/minetest.pot -xgettext --package-name=minetest -F -n -o $potfile src/*.cpp src/*.h +xgettext --package-name=minetest -kN_ -kwgettext -F -n -o $potfile src/*.cpp src/*.h # Now iterate on all languages and create the po file if missing, or update it # if it exists already From 1d009a37df9ce90eb5d24c180119b8bbffaf3d5f Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Tue, 2 Aug 2011 12:47:32 +0200 Subject: [PATCH 153/158] changed on string in german translation to fit to gui --- po/de/minetest.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/de/minetest.po b/po/de/minetest.po index 347adaf..4b22855 100644 --- a/po/de/minetest.po +++ b/po/de/minetest.po @@ -19,7 +19,7 @@ msgstr "" #: src/guiKeyChangeMenu.cpp:84 msgid "KEYBINDINGS" -msgstr "TASTENZUORDNUNG" +msgstr "TASTEN EINST." #: src/guiKeyChangeMenu.cpp:94 msgid "Forward" From 7361f295274e248052f489a0b532b3d2a1926d9f Mon Sep 17 00:00:00 2001 From: Constantin Wenger Date: Tue, 2 Aug 2011 13:39:58 +0200 Subject: [PATCH 154/158] fixed some error :/ --- src/gettext.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gettext.h b/src/gettext.h index f2cb8e4..0e6ee0f 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -1,5 +1,6 @@ #ifndef GETTEXT_HEADER #include "config.h" // for USE_GETTEXT +#include #if USE_GETTEXT #include From f5e0ba266e9cd6dde8f809ef8021eba8c4d1e81e Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 2 Aug 2011 13:02:06 +0200 Subject: [PATCH 155/158] Some more Italian translations --- po/it/minetest.po | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/po/it/minetest.po b/po/it/minetest.po index 3269420..6410d2c 100644 --- a/po/it/minetest.po +++ b/po/it/minetest.po @@ -23,23 +23,23 @@ msgstr "" #: src/guiKeyChangeMenu.cpp:94 msgid "Forward" -msgstr "" +msgstr "Avanti" #: src/guiKeyChangeMenu.cpp:111 msgid "Backward" -msgstr "" +msgstr "Indietro" #: src/guiKeyChangeMenu.cpp:127 src/guiKeyChangeMenu.h:38 msgid "Left" -msgstr "" +msgstr "Sinistra" #: src/guiKeyChangeMenu.cpp:142 src/guiKeyChangeMenu.h:38 msgid "Right" -msgstr "" +msgstr "Destra" #: src/guiKeyChangeMenu.cpp:158 msgid "Use" -msgstr "" +msgstr "Usa" #: src/guiKeyChangeMenu.cpp:173 msgid "Sneak" @@ -47,15 +47,15 @@ msgstr "" #: src/guiKeyChangeMenu.cpp:189 msgid "Jump" -msgstr "" +msgstr "Salta" #: src/guiKeyChangeMenu.cpp:204 msgid "Inventory" -msgstr "" +msgstr "Invetario" #: src/guiKeyChangeMenu.cpp:220 msgid "Chat" -msgstr "" +msgstr "Parla" #: src/guiKeyChangeMenu.cpp:236 msgid "Toggle fly" @@ -75,11 +75,11 @@ msgstr "" #: src/guiKeyChangeMenu.cpp:298 msgid "Save" -msgstr "" +msgstr "Salva" #: src/guiKeyChangeMenu.cpp:304 src/guiKeyChangeMenu.h:33 msgid "Cancel" -msgstr "" +msgstr "Annulla" #: src/guiKeyChangeMenu.cpp:537 src/guiKeyChangeMenu.cpp:542 #: src/guiKeyChangeMenu.cpp:547 src/guiKeyChangeMenu.cpp:552 @@ -89,19 +89,19 @@ msgstr "" #: src/guiKeyChangeMenu.cpp:587 src/guiKeyChangeMenu.cpp:592 #: src/guiKeyChangeMenu.cpp:597 msgid "press Key" -msgstr "" +msgstr "premi tasto" #: src/guiKeyChangeMenu.h:33 msgid "Left Button" -msgstr "" +msgstr "Tasto sinistro" #: src/guiKeyChangeMenu.h:33 msgid "Middle Button" -msgstr "" +msgstr "Tasto centrale" #: src/guiKeyChangeMenu.h:33 msgid "Right Button" -msgstr "" +msgstr "Tasto destro" #: src/guiKeyChangeMenu.h:33 msgid "X Button 1" @@ -109,7 +109,7 @@ msgstr "" #: src/guiKeyChangeMenu.h:34 msgid "Back" -msgstr "" +msgstr "Indietro" #: src/guiKeyChangeMenu.h:34 msgid "Clear" @@ -117,7 +117,7 @@ msgstr "" #: src/guiKeyChangeMenu.h:34 msgid "Return" -msgstr "" +msgstr "Invio" #: src/guiKeyChangeMenu.h:34 msgid "Tab" @@ -188,9 +188,8 @@ msgid "Home" msgstr "" #: src/guiKeyChangeMenu.h:37 -#, fuzzy msgid "Mode Change" -msgstr "Modifica" +msgstr "" #: src/guiKeyChangeMenu.h:37 msgid "Next" @@ -202,11 +201,11 @@ msgstr "" #: src/guiKeyChangeMenu.h:37 msgid "Space" -msgstr "" +msgstr "Spazio" #: src/guiKeyChangeMenu.h:38 msgid "Down" -msgstr "" +msgstr "Giù" #: src/guiKeyChangeMenu.h:38 msgid "Execute" @@ -214,7 +213,7 @@ msgstr "" #: src/guiKeyChangeMenu.h:38 msgid "Print" -msgstr "" +msgstr "Stampa" #: src/guiKeyChangeMenu.h:38 msgid "Select" @@ -225,9 +224,8 @@ msgid "Up" msgstr "" #: src/guiKeyChangeMenu.h:39 -#, fuzzy msgid "Delete" -msgstr "Cancella mappa" +msgstr "Cancella" #: src/guiKeyChangeMenu.h:39 msgid "Help" From f79069f5b3995a8b8f13771afc3f853a0ec97dcb Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 2 Aug 2011 19:18:30 +0200 Subject: [PATCH 156/158] MapNode is a struct, not a class --- src/mapnode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapnode.h b/src/mapnode.h index 484ad4e..389fa1c 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -96,7 +96,7 @@ enum LiquidType LIQUID_SOURCE }; -class MapNode; +struct MapNode; class NodeMetadata; struct ContentFeatures From 59c58f230e68b528dd1f425f5211b681481c7cea Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 2 Aug 2011 20:51:14 +0200 Subject: [PATCH 157/158] Some obvious errors in the new fluid flow management --- src/map.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/map.cpp b/src/map.cpp index d51aa46..dc44592 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1666,7 +1666,7 @@ void Map::transformLiquids(core::map & modified_blocks) /* decide on the type (and possibly level) of the current node */ - u8 new_node_content; + content_t new_node_content; s8 new_node_level = -1; if (num_sources >= 2 || liquid_type == LIQUID_SOURCE) { // liquid_kind will be set to either the flowing alternative of the node (if it's a liquid) @@ -1736,9 +1736,10 @@ void Map::transformLiquids(core::map & modified_blocks) n0.setContent(new_node_content); if (content_features(n0.getContent()).liquid_type == LIQUID_FLOWING) { // set level to last 3 bits, flowing down bit to 4th bit - n0.param2 = (flowing_down ? LIQUID_FLOW_DOWN_MASK : 0x00) | (new_node_level & LIQUID_LEVEL_MASK); + n0.param2 |= (flowing_down ? LIQUID_FLOW_DOWN_MASK : 0x00) | (new_node_level & LIQUID_LEVEL_MASK); } else { - n0.param2 = 0; + // set the liquid level and flow bit to 0 + n0.param2 &= ~(LIQUID_LEVEL_MASK | LIQUID_FLOW_DOWN_MASK); } setNode(p0, n0); v3s16 blockpos = getNodeBlockPos(p0); From dd9909a574514f59eb527db682a4e8d85350ead9 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Wed, 3 Aug 2011 08:37:56 +0200 Subject: [PATCH 158/158] minetestmapper can be run from any directory If it doesn't find colors.txt locally, it looks for the one in the directory of the script itself. --- util/minetestmapper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util/minetestmapper.py b/util/minetestmapper.py index cf2a577..e13a1bd 100755 --- a/util/minetestmapper.py +++ b/util/minetestmapper.py @@ -152,7 +152,10 @@ if path[-1:] != "/" and path[-1:] != "\\": # Load color information for the blocks. colors = {} -f = file("colors.txt") +try: + f = file("colors.txt") +except IOError: + f = file(os.path.join(os.path.dirname(__file__), "colors.txt")) for line in f: values = string.split(line) colors[int(values[0], 16)] = (