diff options
41 files changed, 2778 insertions, 1184 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index bf430a0df..40ecbf675 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ 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) @@ -0,0 +1,23 @@ +Minetest Δ (“Minetest Delta”) is a fork of Minetest-c55 <http://celeron.55.lt/~celeron55/minetest/>, 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: +* refactored liquids (currently broken, water does not flow) +* translation support (including german, french, italian) + +Alternate graphics: +* Player +* Omsk birds (instead of Oerkki ghosts) +* Rat +* Glass +* Heart + +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 + 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). diff --git a/cmake/Modules/FindGettextLib.cmake b/cmake/Modules/FindGettextLib.cmake index b99fd33b8..18935eaad 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 @@ -71,10 +56,14 @@ ENDIF() IF(GETTEXT_FOUND) SET(GETTEXT_PO_PATH ${CMAKE_SOURCE_DIR}/po) SET(GETTEXT_MO_BUILD_PATH ${CMAKE_BINARY_DIR}/locale/<locale>/LC_MESSAGES) - SET(GETTEXT_MO_DEST_PATH locale/<locale>/LC_MESSAGES) + SET(GETTEXT_MO_DEST_PATH ${DATADIR}/../locale/<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>" ${_locale} ${_buildvar} ${GETTEXT_MO_BUILD_PATH}) STRING(REPLACE "<locale>" ${_locale} ${_destvar} ${GETTEXT_MO_DEST_PATH}) ENDMACRO(SET_MO_PATHS) +ELSE() + SET(GETTEXT_INCLUDE_DIR "") + SET(GETTEXT_LIBRARY "") ENDIF() diff --git a/data/glass.png b/data/glass.png Binary files differindex 8598ce670..35ea596d5 100644 --- a/data/glass.png +++ b/data/glass.png diff --git a/data/heart.png b/data/heart.png Binary files differindex 6bc183e04..bea1aefd6 100644 --- a/data/heart.png +++ b/data/heart.png diff --git a/data/menulogo.png b/data/menulogo.png Binary files differindex 76595c48d..cb6983e5c 100644 --- a/data/menulogo.png +++ b/data/menulogo.png diff --git a/data/oerkki1.png b/data/oerkki1.png Binary files differindex 33cbac9e7..1256a8a57 100644 --- a/data/oerkki1.png +++ b/data/oerkki1.png diff --git a/data/oerkki1_damaged.png b/data/oerkki1_damaged.png Binary files differindex 9b777387c..99e4bd362 100644 --- a/data/oerkki1_damaged.png +++ b/data/oerkki1_damaged.png diff --git a/data/player.png b/data/player.png Binary files differindex 90adf9747..60ac4854b 100644 --- a/data/player.png +++ b/data/player.png diff --git a/data/player_back.png b/data/player_back.png Binary files differindex 530aa7519..447c1fd8f 100644 --- a/data/player_back.png +++ b/data/player_back.png diff --git a/data/rat.png b/data/rat.png Binary files differindex d1a0e2ae2..96d44c3fa 100644 --- a/data/rat.png +++ b/data/rat.png diff --git a/data/unknown_block.png b/data/unknown_block.png Binary files differindex a27cb8ca9..8a8e0109c 100644 --- a/data/unknown_block.png +++ b/data/unknown_block.png diff --git a/minetest-icon-24x24.png b/minetest-icon-24x24.png Binary files differnew file mode 100644 index 000000000..4d587c410 --- /dev/null +++ b/minetest-icon-24x24.png diff --git a/minetestmapper/colors.txt b/minetestmapper/colors.txt deleted file mode 100644 index e70f56e1e..000000000 --- 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 8dc3de2f4..000000000 --- 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<l):
- i=l
- return i
-
-# Fix these!
-path="../map/"
-output="map.png"
-
-sector_xmin = -1000/16
-sector_xmax = 1000/16
-sector_zmin = -1000/16
-sector_zmax = 1000/16
-
-# Load color information for the blocks.
-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]))
-f.close()
-
-xlist = []
-zlist = []
-
-# 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)
-
-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)
diff --git a/pnoise.py b/pnoise.py new file mode 100644 index 000000000..fcab5ac15 --- /dev/null +++ b/pnoise.py @@ -0,0 +1,102 @@ +# +# A python perlin noise implementation, from +# http://www.fundza.com/c4serious/noise/perlin/perlin.html +# +# This is used for testing how to create maps with a python script. +# + +import math +p = ( +151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103, +30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197, +62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20, +125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231, +83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102, +143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200, +196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226, +250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16, +58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70, +221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113, +224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144, +12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181, +199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236, +205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180, +151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103, +30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197, +62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20, +125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231, +83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102, +143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200, +196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226, +250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16, +58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70, +221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113, +224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144, +12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181, +199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236, +205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180) + +def lerp(t, a, b): + return a + t * (b - a) + +def fade(t): + return t * t * t * (t * (t * 6 - 15) + 10) + +def grad(hash, x, y, z): + h = hash & 15 + if h < 8: + u = x + else: + u = y + if h < 4: + v = y + elif h == 12 or h == 14: + v = x + else: + v = z + if h & 1 != 0: + u = -u + if h & 2 != 0: + v = -v + return u + v + +def pnoise(x, y, z): + global p + X = int(math.floor(x)) & 255 + Y = int(math.floor(y)) & 255 + Z = int(math.floor(z)) & 255 + x -= math.floor(x) + y -= math.floor(y) + z -= math.floor(z) + + u = fade(x) + v = fade(y) + w = fade(z) + + A = p[X] + Y + AA = p[A] + Z + AB = p[A + 1] + Z + B = p[X + 1] + Y + BA = p[B] + Z + BB = p[B + 1] + Z + + pAA = p[AA] + pAB = p[AB] + pBA = p[BA] + pBB = p[BB] + pAA1 = p[AA + 1] + pBA1 = p[BA + 1] + pAB1 = p[AB + 1] + pBB1 = p[BB + 1] + + gradAA = grad(pAA, x, y, z) + gradBA = grad(pBA, x-1, y, z) + gradAB = grad(pAB, x, y-1, z) + gradBB = grad(pBB, x-1, y-1, z) + gradAA1 = grad(pAA1,x, y, z-1) + gradBA1 = grad(pBA1,x-1, y, z-1) + gradAB1 = grad(pAB1,x, y-1, z-1) + gradBB1 = grad(pBB1,x-1, y-1, z-1) + return lerp(w, + lerp(v, lerp(u, gradAA, gradBA), lerp(u, gradAB, gradBB)), + lerp(v, lerp(u, gradAA1,gradBA1),lerp(u, gradAB1,gradBB1))) diff --git a/po/de/minetest.po b/po/de/minetest.po index 69b57fd95..910271f0f 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-20 16:58+0100\n" +"POT-Creation-Date: 2011-07-30 11:20+0200\n" +"PO-Revision-Date: 2011-07-30 22:27+0100\n" "Last-Translator: Constantin Wenger <constantin.wenger@googlemail.com>\n" "Language-Team: Deutsch <>\n" "Language: de\n" @@ -17,87 +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 "TASTENZUORDNUNG" + +#: src/guiKeyChangeMenu.cpp:94 +msgid "Forward" +msgstr "Vorwärts" + +#: src/guiKeyChangeMenu.cpp:111 +msgid "Backward" +msgstr "Rückwärts" + +#: src/guiKeyChangeMenu.cpp:127 +#: src/guiKeyChangeMenu.h:38 +msgid "Left" +msgstr "Links" + +#: src/guiKeyChangeMenu.cpp:142 +#: src/guiKeyChangeMenu.h:38 +msgid "Right" +msgstr "Rechts" + +#: src/guiKeyChangeMenu.cpp:158 +msgid "Use" +msgstr "Benutzen" + +#: src/guiKeyChangeMenu.cpp:173 +msgid "Sneak" +msgstr "Kriechen" + +#: src/guiKeyChangeMenu.cpp:189 +msgid "Jump" +msgstr "Springen" + +#: src/guiKeyChangeMenu.cpp:204 +msgid "Inventory" +msgstr "Inventar" + +#: src/guiKeyChangeMenu.cpp:220 +msgid "Chat" +msgstr "Chat" + +#: src/guiKeyChangeMenu.cpp:236 +msgid "Toggle fly" +msgstr "Fliegen umschalten" + +#: src/guiKeyChangeMenu.cpp:251 +msgid "Toggle fast" +msgstr "Speed umschalten" + +#: src/guiKeyChangeMenu.cpp:267 +msgid "Range select" +msgstr "Entfernung wählen" + +#: src/guiKeyChangeMenu.cpp:285 +msgid "Print stacks" +msgstr "Stack ausgeben" + +#: src/guiKeyChangeMenu.cpp:300 +msgid "Save" +msgstr "Speichern" + +#: src/guiKeyChangeMenu.cpp:306 +#: 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 +msgid "press Key" +msgstr "Taste drücken" + +#: src/guiKeyChangeMenu.h:33 +msgid "Left Button" +msgstr "linke Taste" + +#: 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 "Zurück" + +#: src/guiKeyChangeMenu.h:34 +msgid "Clear" +msgstr "löschen" + +#: src/guiKeyChangeMenu.h:34 +msgid "Return" +msgstr "Return" + +#: src/guiKeyChangeMenu.h:34 +msgid "Tab" +msgstr "Tab" + +#: src/guiKeyChangeMenu.h:34 +msgid "X Button 2" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Capital" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Control" +msgstr "Strg" + +#: src/guiKeyChangeMenu.h:35 +msgid "Kana" +msgstr "" + +#: src/guiKeyChangeMenu.h:35 +msgid "Menu" +msgstr "Menü" + +#: src/guiKeyChangeMenu.h:35 +msgid "Pause" +msgstr "Pause" + +#: src/guiKeyChangeMenu.h:35 +msgid "Shift" +msgstr "Umschalten" + +#: src/guiKeyChangeMenu.h:36 +msgid "Convert" +msgstr "" + +#: src/guiKeyChangeMenu.h:36 +msgid "Escape" +msgstr "Escape" + +#: 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 "Annehmen" + +#: src/guiKeyChangeMenu.h:37 +msgid "End" +msgstr "Ende" + +#: src/guiKeyChangeMenu.h:37 +msgid "Home" +msgstr "Home" + +#: src/guiKeyChangeMenu.h:37 +msgid "Mode Change" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Next" +msgstr "Nächstes" + +#: src/guiKeyChangeMenu.h:37 +msgid "Priot" +msgstr "" + +#: src/guiKeyChangeMenu.h:37 +msgid "Space" +msgstr "Leertaste" + +#: src/guiKeyChangeMenu.h:38 +msgid "Down" +msgstr "Runter" + +#: src/guiKeyChangeMenu.h:38 +msgid "Execute" +msgstr "Ausführen" + +#: src/guiKeyChangeMenu.h:38 +msgid "Print" +msgstr "Druck" + +#: src/guiKeyChangeMenu.h:38 +msgid "Select" +msgstr "Select" + +#: src/guiKeyChangeMenu.h:38 +msgid "Up" +msgstr "Hoch" + +#: src/guiKeyChangeMenu.h:39 +msgid "Delete" +msgstr "Entf" + +#: src/guiKeyChangeMenu.h:39 +msgid "Help" +msgstr "Hilfe" + +#: src/guiKeyChangeMenu.h:39 +msgid "Insert" +msgstr "Einfg" + +#: src/guiKeyChangeMenu.h:39 +msgid "Snapshot" +msgstr "Schnapschuss" + +#: src/guiKeyChangeMenu.h:42 +msgid "Left Windows" +msgstr "Win links" + +#: src/guiKeyChangeMenu.h:43 +msgid "Apps" +msgstr "" + +#: src/guiKeyChangeMenu.h:43 +msgid "Numpad 0" +msgstr "Ziffernblock 0" + +#: src/guiKeyChangeMenu.h:43 +msgid "Numpad 1" +msgstr "Ziffernblock 1" + +#: src/guiKeyChangeMenu.h:43 +msgid "Right Windows" +msgstr "Win rechts" + +#: src/guiKeyChangeMenu.h:43 +msgid "Sleep" +msgstr "Schlaf" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 2" +msgstr "Ziffernblock 2" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 3" +msgstr "Ziffernblock 3" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 4" +msgstr "Ziffernblock 4" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 5" +msgstr "Ziffernblock 5" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 6" +msgstr "Ziffernblock 6" + +#: src/guiKeyChangeMenu.h:44 +msgid "Numpad 7" +msgstr "Ziffernblock 7" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad *" +msgstr "Ziffernblock *" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad +" +msgstr "Ziffernblock +" + +#: src/guiKeyChangeMenu.h:45 +msgid "Numpad -" +msgstr "Ziffernblock -" + +#: 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 "Tastenbelegung ändern" +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" @@ -113,11 +497,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" + diff --git a/po/en/minetest.pot b/po/en/minetest.pot deleted file mode 100644 index 8fbac78d0..000000000 --- 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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n" -"Language-Team: LANGUAGE <LL@li.org>\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 b060c424c..c1133fab6 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 <cysoun@gmail.com>\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 new file mode 100644 index 000000000..c3c924f4c --- /dev/null +++ b/po/it/minetest.po @@ -0,0 +1,500 @@ +# 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 <giuseppe.bilotta@gmail.com>, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: minetest\n" +"Report-Msgid-Bugs-To: \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 <giuseppe.bilotta@gmail.com>\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/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:206 +msgid "Address/Port" +msgstr "Indirizzo/Porta" + +#: 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:235 +msgid "Fancy trees" +msgstr "Alberi strani" + +#: src/guiMainMenu.cpp:241 +msgid "Smooth Lighting" +msgstr "" + +#: src/guiMainMenu.cpp:249 +msgid "Start Game / Connect" +msgstr "Avvia Gioco / Connetti" + +#: src/guiMainMenu.cpp:258 +msgid "Change keys" +msgstr "Modifica tasti" + +#: src/guiMainMenu.cpp:281 +msgid "Creative Mode" +msgstr "Modalità creativa" + +#: src/guiMainMenu.cpp:287 +msgid "Enable Damage" +msgstr "Attiva Danno" + +#: src/guiMainMenu.cpp:295 +msgid "Delete map" +msgstr "Cancella mappa" + +#: src/guiMessageMenu.cpp:94 src/guiTextInputMenu.cpp:112 +msgid "Proceed" +msgstr "Procedi" + +#: src/guiPasswordChange.cpp:103 +msgid "Old Password" +msgstr "Vecchia password" + +#: src/guiPasswordChange.cpp:120 +msgid "New Password" +msgstr "Nuova password" + +#: src/guiPasswordChange.cpp:136 +msgid "Confirm Password" +msgstr "Conferma password" + +#: src/guiPasswordChange.cpp:153 +msgid "Change" +msgstr "Modifica" + +#: src/guiPasswordChange.cpp:162 +msgid "Passwords do not match!" +msgstr "Le password non corrispondono!" + +#: src/guiPauseMenu.cpp:111 +msgid "Continue" +msgstr "Continua" + +#: src/guiPauseMenu.cpp:118 +msgid "Change Password" +msgstr "Cambia password" + +#: src/guiPauseMenu.cpp:125 +msgid "Disconnect" +msgstr "Disconnetti" + +#: src/guiPauseMenu.cpp:132 +msgid "Exit to OS" +msgstr "Esci al S.O." + +#: 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 "" +"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 new file mode 100644 index 000000000..eebdc18d5 --- /dev/null +++ b/po/minetest.pot @@ -0,0 +1,487 @@ +# 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 <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: minetest\n" +"Report-Msgid-Bugs-To: \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 <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: 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:206 +msgid "Address/Port" +msgstr "" + +#: src/guiMainMenu.cpp:228 +msgid "Leave address blank to start a local server." +msgstr "" + +#: src/guiMainMenu.cpp:235 +msgid "Fancy trees" +msgstr "" + +#: src/guiMainMenu.cpp:241 +msgid "Smooth Lighting" +msgstr "" + +#: src/guiMainMenu.cpp:249 +msgid "Start Game / Connect" +msgstr "" + +#: src/guiMainMenu.cpp:258 +msgid "Change keys" +msgstr "" + +#: src/guiMainMenu.cpp:281 +msgid "Creative Mode" +msgstr "" + +#: src/guiMainMenu.cpp:287 +msgid "Enable Damage" +msgstr "" + +#: src/guiMainMenu.cpp:295 +msgid "Delete map" +msgstr "" + +#: src/guiMessageMenu.cpp:94 src/guiTextInputMenu.cpp:112 +msgid "Proceed" +msgstr "" + +#: src/guiPasswordChange.cpp:103 +msgid "Old Password" +msgstr "" + +#: src/guiPasswordChange.cpp:120 +msgid "New Password" +msgstr "" + +#: src/guiPasswordChange.cpp:136 +msgid "Confirm Password" +msgstr "" + +#: src/guiPasswordChange.cpp:153 +msgid "Change" +msgstr "" + +#: src/guiPasswordChange.cpp:162 +msgid "Passwords do not match!" +msgstr "" + +#: src/guiPauseMenu.cpp:111 +msgid "Continue" +msgstr "" + +#: src/guiPauseMenu.cpp:118 +msgid "Change Password" +msgstr "" + +#: src/guiPauseMenu.cpp:125 +msgid "Disconnect" +msgstr "" + +#: src/guiPauseMenu.cpp:132 +msgid "Exit to OS" +msgstr "" + +#: 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 "" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4d51f7104..32177f8a9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,15 +1,19 @@ +project(minetest-delta) cmake_minimum_required( VERSION 2.6 ) -project(minetest) - if(RUN_IN_PLACE) add_definitions ( -DRUN_IN_PLACE ) endif(RUN_IN_PLACE) -OPTION(USE_GETTEXT "Use GetText for internationalization" OFF) +# 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) -if(USE_GETTEXT) - find_package(GettextLib REQUIRED) +find_package(GettextLib) + +if(GETTEXT_FOUND AND ENABLE_GETTEXT) message(STATUS "gettext include path: ${GETTEXT_INCLUDE_DIR}") message(STATUS "gettext msgfmt path: ${GETTEXT_MSGFMT}") if(WIN32) @@ -17,16 +21,13 @@ 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) + set(USE_GETTEXT 1) + message(STATUS "GetText enabled; locales found: ${GETTEXT_AVAILABLE_LOCALES}") +elseif(GETTEXT_FOUND AND NOT ENABLE_GETTEXT) + MESSAGE(STATUS "GetText found but disabled;") +else(GETTEXT_FOUND AND ENABLE_GETTEXT) message(STATUS "GetText disabled") -endif(USE_GETTEXT) +endif(GETTEXT_FOUND AND ENABLE_GETTEXT) if(NOT MSVC) set(USE_GPROF 0 CACHE BOOL "Use -pg flag for g++") @@ -274,7 +275,7 @@ if(BUILD_CLIENT) install(FILES ${images} DESTINATION ${DATADIR}) - if (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") @@ -305,54 +306,29 @@ 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}) - # 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.") + + 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_FILE_PATH "${MO_BUILD_PATH}/minetest.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(USE_GETTEXT) # Subdirectories diff --git a/src/client.cpp b/src/client.cpp index 55f0af6dc..02f78e233 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -936,7 +936,6 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id) */ //m_env.getClientMap().updateMeshes(block->getPos(), getDayNightRatio()); - /* Add it to mesh update queue and set it to be acknowledged after update. */ diff --git a/src/cmake_config.h.in b/src/cmake_config.h.in index 5e375191f..7cbb11f6b 100644 --- a/src/cmake_config.h.in +++ b/src/cmake_config.h.in @@ -3,14 +3,16 @@ #ifndef CMAKE_CONFIG_H #define CMAKE_CONFIG_H +#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 #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 b24cf6a69..54b89a060 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,8 +23,13 @@ #else #define RUN_IN_PLACE_BOOLSTRING "0" #endif - #define BUILD_INFO "NON-CMAKE RUN_IN_PLACE="RUN_IN_PLACE_BOOLSTRING" BUILD_TYPE="BUILD_TYPE -#endif + #if USE_GETTEXT + #define USE_GETTEXT_BOOLSTRING "1" + #else + #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 73b9f8986..ff3a0f8cb 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -1,4 +1,7 @@ -#ifdef USE_GETTEXT +#ifndef GETTEXT_HEADER +#include "config.h" // for USE_GETTEXT + +#if USE_GETTEXT #include <libintl.h> #else #define gettext(String) String @@ -8,6 +11,17 @@ #define gettext_noop(String) String #define N_(String) gettext_noop (String) +inline void init_gettext(const char *path) { +#if USE_GETTEXT + // 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); + textdomain(PROJECT_NAME); +#endif +} + inline wchar_t* chartowchar_t(const char *str) { size_t l = strlen(str)+1; @@ -15,3 +29,15 @@ 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"<<std::endl; + else + std::cout<<"locale has been set to:"<<ret<<std::endl; +} +#define GETTEXT_HEADER +#endif diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp index 98d6f8086..7855751ff 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 e9e359c3c..c40d802ac 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 <string> 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, diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp index 1d7f224f6..63bc72d24 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); + changeCtype(""); { core::rect<s32> 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); } + changeCtype("C"); { core::rect<s32> rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, 50); @@ -196,6 +198,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) e->setPasswordBox(true); } + changeCtype(""); // Address + port { core::rect<s32> 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); } + changeCtype("C"); { core::rect<s32> 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); } + changeCtype(""); { core::rect<s32> 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"))); } + changeCtype("C"); } void GUIMainMenu::drawMenu() diff --git a/src/guiMessageMenu.cpp b/src/guiMessageMenu.cpp index 155be6029..71c8fd1e8 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); } + changeCtype(""); { core::rect<s32> 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); } + changeCtype("C"); } void GUIMessageMenu::drawMenu() diff --git a/src/guiPasswordChange.cpp b/src/guiPasswordChange.cpp index fabe75110..2a7fb009a 100644 --- a/src/guiPasswordChange.cpp +++ b/src/guiPasswordChange.cpp @@ -96,12 +96,14 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) Add stuff */ s32 ypos = 50; + changeCtype(""); { core::rect<s32> rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); Environment->addStaticText(chartowchar_t(gettext("Old Password")), rect, false, true, this, -1); } + changeCtype("C"); { core::rect<s32> 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; + changeCtype(""); { core::rect<s32> rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); Environment->addStaticText(chartowchar_t(gettext("New Password")), rect, false, true, this, -1); } + changeCtype("C"); { core::rect<s32> 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; + changeCtype(""); { core::rect<s32> rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); Environment->addStaticText(chartowchar_t(gettext("Confirm Password")), rect, false, true, this, -1); } + changeCtype("C"); { core::rect<s32> rect(0, 0, 230, 30); rect += topleft_client + v2s32(160, ypos); @@ -140,6 +146,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) } ypos += 50; + changeCtype(""); { core::rect<s32> 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); } + changeCtype("C"); } diff --git a/src/guiPauseMenu.cpp b/src/guiPauseMenu.cpp index 7745b8dd2..6cf364e5f 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;
+ changeCtype("");
{
core::rect<s32> rect(0, 0, 140, btn_height);
rect = rect + v2s32(size.X/2-140/2, btn_y);
@@ -172,7 +173,7 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) );*/
std::ostringstream os;
- os<<"Minetest-c55\n";
+ os<<"Minetest-delta\n";
os<<"by Perttu Ahola and contributors\n";
os<<"celeron55@gmail.com\n";
os<<BUILD_INFO<<"\n";
@@ -180,6 +181,7 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) Environment->addStaticText(narrow_to_wide(os.str()).c_str(), rect, false, true, this, 259);
}
+ changeCtype("C");
}
void GUIPauseMenu::drawMenu()
diff --git a/src/guiTextInputMenu.cpp b/src/guiTextInputMenu.cpp index 252e452f5..a59602554 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); } + changeCtype(""); { core::rect<s32> 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"))); } + changeCtype("C"); } void GUITextInputMenu::drawMenu() diff --git a/src/keycode.cpp b/src/keycode.cpp index d6472d2ea..f014914d0 100644 --- a/src/keycode.cpp +++ b/src/keycode.cpp @@ -233,4 +233,3 @@ void clearKeyCache() { g_key_setting_cache.clear(); } - diff --git a/src/main.cpp b/src/main.cpp index 77340cab3..6eca96eac 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1161,11 +1161,7 @@ int main(int argc, char *argv[]) // Create user data directory fs::CreateDir(porting::path_userdata); -#ifdef USE_GETTEXT - setlocale(LC_MESSAGES, ""); - bindtextdomain("minetest", (porting::path_userdata+"/locale").c_str()); - textdomain("minetest"); -#endif + init_gettext((porting::path_data+"/../locale").c_str()); // Initialize debug streams #ifdef RUN_IN_PLACE @@ -1186,7 +1182,7 @@ int main(int argc, char *argv[]) BEGIN_DEBUG_EXCEPTION_HANDLER // Print startup message - dstream<<DTIME<<"minetest-c55" + dstream<<DTIME<<PROJECT_NAME " with SER_FMT_VER_HIGHEST="<<(int)SER_FMT_VER_HIGHEST <<", "<<BUILD_INFO <<std::endl; diff --git a/src/map.cpp b/src/map.cpp index 830627066..092ce97fd 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1540,6 +1540,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<v3s16, MapBlock*> & modified_blocks) { DSTACK(__FUNCTION_NAME); @@ -1559,240 +1570,220 @@ void Map::transformLiquids(core::map<v3s16, MapBlock*> & modified_blocks) v3s16 p0 = m_transforming_liquid.pop_front(); MapNode n0 = getNodeNoEx(p0); - - // Don't deal with non-liquids - if(content_liquid(n0.getContent()) == false) - continue; - - bool is_source = !content_flowing_liquid(n0.getContent()); - - 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.getContent()); - + /* - 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.getContent())) - { - u8 n2_nonsource_c = make_liquid_flowing(n2.getContent()); - // Check that the liquids are the same type - if(n2_nonsource_c != nonsource_c) - { - dstream<<"WARNING: Not handling: different liquids" - " collide"<<std::endl; - continue; + Collect information about current node + */ + s8 liquid_level = -1; + u8 liquid_kind = CONTENT_IGNORE; + LiquidType liquid_type = content_features(n0.getContent()).liquid_type; + switch (liquid_type) { + case LIQUID_SOURCE: + liquid_level = 8; + liquid_kind = content_features(n0.getContent()).liquid_alternative_flowing; + break; + case LIQUID_FLOWING: + liquid_level = (n0.param2 & LIQUID_LEVEL_MASK); + liquid_kind = n0.getContent(); + break; + case LIQUID_NONE: + // if this is an air node, it *could* be transformed into a liquid. otherwise, + // continue with the next node. + if (n0.getContent() != CONTENT_AIR) + continue; + liquid_kind = CONTENT_AIR; + break; + } + + /* + Collect information about the environment + */ + v3s16 dirs[6] = { + v3s16( 0, 1, 0), // top + v3s16( 0,-1, 0), // bottom + v3s16( 1, 0, 0), // right + v3s16(-1, 0, 0), // left + v3s16( 0, 0, 1), // back + v3s16( 0, 0,-1), // front + }; + NodeNeighbor sources[6]; // surrounding sources + int num_sources = 0; + NodeNeighbor flows[6]; // surrounding flowing liquid nodes + int num_flows = 0; + NodeNeighbor airs[6]; // surrounding air + int num_airs = 0; + 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++) { + NeighborType nt = NEIGHBOR_SAME_LEVEL; + switch (i) { + case 0: + nt = NEIGHBOR_UPPER; + break; + case 1: + nt = NEIGHBOR_LOWER; + break; + } + v3s16 npos = p0 + dirs[i]; + NodeNeighbor nb = {getNodeNoEx(npos), nt, npos}; + switch (content_features(nb.n.getContent()).liquid_type) { + case LIQUID_NONE: + if (nb.n.getContent() == CONTENT_AIR) { + airs[num_airs++] = nb; + // 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 { + neutrals[num_neutrals++] = nb; } - bool n2_is_source = !content_flowing_liquid(n2.getContent()); - s8 n2_liquid_level = 8; - if(n2_is_source == false) - n2_liquid_level = n2.param2 & 0x07; - - s8 new_liquid_level = -1; - if(from_top) - { - //new_liquid_level = 7; - if(n2_liquid_level >= 7 - WATER_DROP_BOOST) - new_liquid_level = 7; - else - new_liquid_level = n2_liquid_level + WATER_DROP_BOOST; + break; + case LIQUID_SOURCE: + // if this node is not (yet) of a liquid type, choose the first liquid type we encounter + if (liquid_kind == CONTENT_AIR) + liquid_kind = content_features(nb.n.getContent()).liquid_alternative_flowing; + if (content_features(nb.n.getContent()).liquid_alternative_flowing !=liquid_kind) { + neutrals[num_neutrals++] = nb; + } else { + sources[num_sources++] = nb; } - else if(n2_liquid_level > 0) - { - new_liquid_level = n2_liquid_level - 1; + break; + case LIQUID_FLOWING: + // if this node is not (yet) of a liquid type, choose the first liquid type we encounter + if (liquid_kind == CONTENT_AIR) + liquid_kind = content_features(nb.n.getContent()).liquid_alternative_flowing; + if (content_features(nb.n.getContent()).liquid_alternative_flowing != liquid_kind) { + neutrals[num_neutrals++] = nb; + } else { + flows[num_flows++] = nb; + if (nb.t == NEIGHBOR_LOWER) + flowing_down = true; } - - 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) - { - if(new_liquid_level_max == -1) - { - // Remove water alltoghether - n0.setContent(CONTENT_AIR); - n0.param2 = 0; - setNode(p0, n0); - } - else - { - n0.param2 = 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); + 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; } - - /* - 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.getContent())) - { - m_transforming_liquid.push_back(p2); + } + // 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 + new_node_content = CONTENT_AIR; } - - // Get a new one from queue if the node has turned into non-water - if(content_liquid(n0.getContent()) == false) + + /* + check if anything has changed. if not, just continue with the next node. + */ + if (new_node_content == n0.getContent() && (content_features(n0.getContent()).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; - + + /* - 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<<std::endl; - - if(content_liquid(n2.getContent())) - { - u8 n2_nonsource_c = make_liquid_flowing(n2.getContent()); - // Check that the liquids are the same type - if(n2_nonsource_c != nonsource_c) - { - dstream<<"WARNING: Not handling: different liquids" - " collide"<<std::endl; - continue; - } - bool n2_is_source = !content_flowing_liquid(n2.getContent()); - u8 n2_liquid_level = 8; - if(n2_is_source == false) - n2_liquid_level = n2.param2 & 0x07; - - if(to_bottom) - { - flowed = true; - } - - if(n2_is_source) - { - // Just flow into the source, nothing changes. - // n2_changed is not set because destination didn't change - flowed = true; + update the current node + */ + bool flow_down_enabled = (flowing_down && ((n0.param2 & LIQUID_FLOW_DOWN_MASK) != LIQUID_FLOW_DOWN_MASK)); + 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); + } else { + n0.param2 = 0; + } + setNode(p0, n0); + v3s16 blockpos = getNodeBlockPos(p0); + MapBlock *block = getBlockNoCreateNoEx(blockpos); + if(block != NULL) + modified_blocks.insert(blockpos, block); + + /* + enqueue neighbors for update if neccessary + */ + switch (content_features(n0.getContent()).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); } - else - { - if(liquid_next_level > liquid_level) - { - n2.param2 = liquid_next_level; - setNode(p2, n2); - - n2_changed = true; - flowed = true; - } + 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); } - } - else if(n2.getContent() == CONTENT_AIR) - { - n2.setContent(nonsource_c); - n2.param2 = liquid_next_level; - setNode(p2, n2); - - n2_changed = true; - flowed = true; - } - - //dstream<<"[2] n2.param="<<(int)n2.param<<std::endl; - - if(n2_changed) - { - m_transforming_liquid.push_back(p2); - - v3s16 blockpos = getNodeBlockPos(p2); - MapBlock *block = getBlockNoCreateNoEx(blockpos); - if(block != NULL) - modified_blocks.insert(blockpos, block); - } - - // If n2_changed to bottom, don't flow anywhere else - if(to_bottom && flowed && !is_source) break; } - + loopcount++; //if(loopcount >= 100000) - if(loopcount >= initial_size * 1) + if(loopcount >= initial_size * 10) { break; + } } //dstream<<"Map::transformLiquids(): loopcount="<<loopcount<<std::endl; } diff --git a/src/mapnode.h b/src/mapnode.h index aeb72c97a..1fb84e1c9 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -404,9 +404,16 @@ enum LightBank }; /* + Masks for MapNode.param2 of flowing liquids + */ +#define LIQUID_LEVEL_MASK 0x07 +#define LIQUID_FLOW_DOWN_MASK 0x08 + +/* This is the stuff what the whole world consists of. */ + struct MapNode { /* diff --git a/src/servermain.cpp b/src/servermain.cpp index 91fd1d3a5..dc41720fb 100644 --- a/src/servermain.cpp +++ b/src/servermain.cpp @@ -162,7 +162,7 @@ int main(int argc, char *argv[]) BEGIN_DEBUG_EXCEPTION_HANDLER // Print startup message - dstream<<DTIME<<"minetest-c55" + dstream<<DTIME<<PROJECT_NAME << " with SER_FMT_VER_HIGHEST="<<(int)SER_FMT_VER_HIGHEST <<", "<<BUILD_INFO <<std::endl; diff --git a/util/colors.txt b/util/colors.txt index c16fd3e23..2dceb9134 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 162ceb204..cf2a5776d 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 @@ -9,68 +9,104 @@ # 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 + 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 = "uloste.png" +output = "map.png" border = 0 scalecolor = "black" bgcolor = "white" @@ -86,71 +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])] = (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. -try: - 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) -except OSError: - pass -try: - 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) -except OSError: - pass +# 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) + +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) minx = min(xlist) minz = min(zlist) @@ -160,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) @@ -170,278 +207,290 @@ 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)): - #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 - - 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") - - version = 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 - - 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])) - - # 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 = 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])) - - # 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 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 + + 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 - - (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 != 2 and c1 != 9 and c2 != 2 and c2 != 9 and c != 2 and c != 9: - 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 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) 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) diff --git a/util/updatepo.sh b/util/updatepo.sh new file mode 100755 index 000000000..bcfa4c4de --- /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 |