Skip to content
Snippets Groups Projects
Commit 2587bb36 authored by Perttu Ahola's avatar Perttu Ahola
Browse files

merged the content type extension and delta

parents 90d793f8 976ec31c
No related branches found
No related tags found
No related merge requests found
Showing with 1920 additions and 32 deletions
data/rail_crossing.png

555 B

data/rail_curved.png

545 B

data/rail_t_junction.png

542 B

data/rat.png

920 B | W: | H:

data/rat.png

276 B | W: | H:

data/rat.png
data/rat.png
data/rat.png
data/rat.png
  • 2-up
  • Swipe
  • Onion skin
data/sandstone.png

772 B

Minetest-c55
---------------
An InfiniMiner/Minecraft inspired game.
Copyright (c) 2010-2011 Perttu Ahola <celeron55@gmail.com>
Further documentation:
----------------------
- Website: http://celeron.55.lt/~celeron55/minetest/
- Wiki: http://celeron.55.lt/~celeron55/minetest/wiki/
- Forum: http://celeron.55.lt/~celeron55/minetest/forum/
This is a development version:
------------------------------
- Don't expect it to work as well as a finished game will.
- Please report any bugs to me. That way I can fix them to the next release.
- debug.txt is useful when the game crashes.
Controls:
---------
- See the in-game pause menu
- Settable in the configuration file, see the section below.
Map directory:
--------------
- Map is stored in a directory, which can be removed to generate a new map.
- There is a command-line option for it: --map-dir
- For a RUN_IN_PLACE build, it is located in:
../map
- Otherwise something like this:
Windows: C:\Documents and Settings\user\Application Data\minetest\map
Linux: ~/.minetest/map
OS X: ~/Library/Application Support/minetest/map
Configuration file:
-------------------
- An optional configuration file can be used. See minetest.conf.example.
- Path to file can be passed as a parameter to the executable:
--config <path-to-file>
- Defaults:
- If built with -DRUN_IN_PLACE=1:
../minetest.conf
../../minetest.conf
- Otherwise something like this:
Windows: C:\Documents and Settings\user\Application Data\minetest\minetest.conf
Linux: ~/.minetest/minetest.conf
OS X: ~/Library/Application Support/minetest.conf
Command-line options:
---------------------
- Use --help
Compiling on GNU/Linux:
-----------------------
Install dependencies. Here's an example for Debian/Ubuntu:
$ apt-get install build-essential libirrlicht-dev cmake libbz2-dev libpng12-dev libjpeg8-dev libxxf86vm-dev libgl1-mesa-dev
Download source, extract (this is the URL to the latest of source repository, which might not work at all times):
$ wget https://bitbucket.org/celeron55/minetest/get/tip.tar.gz
$ tar xf tip.tar.gz
$ cd minetest
Build a version that runs directly from the source directory:
$ cmake . -DRUN_IN_PLACE=1
$ make -j2
Run it:
$ cd bin
$ ./minetest
- Use cmake . -LH to see all CMake options and their current state
- If you want to install it system-wide (or are making a distribution package), you will want to use -DRUN_IN_PLACE=0
- You can build a bare server or a bare client by specifying -DBUILD_CLIENT=0 or -DBUILD_SERVER=0
- You can select between Release and Debug build by -DCMAKE_BUILD_TYPE=<Debug or Release>
- Note that the Debug build is considerably slower
Compiling on Windows:
---------------------
- You need:
* CMake:
http://www.cmake.org/cmake/resources/software.html
* MinGW or Visual Studio
http://www.mingw.org/
http://msdn.microsoft.com/en-us/vstudio/default
* Irrlicht SDK 1.7:
http://irrlicht.sourceforge.net/downloads.html
* Zlib headers (zlib125.zip)
http://www.winimage.com/zLibDll/index.html
* Zlib library (zlibwapi.lib and zlibwapi.dll from zlib125dll.zip):
http://www.winimage.com/zLibDll/index.html
* And, of course, Minetest-c55:
http://celeron.55.lt/~celeron55/minetest/download
- Steps:
- Select a directory called DIR hereafter in which you will operate.
- Make sure you have CMake and a compiler installed.
- Download all the other stuff to DIR and extract them into there. All those
packages contain a nice base directory in them, which should end up being
the direct subdirectories of DIR.
- You will end up with a directory structure like this (+=dir, -=file):
-----------------
+ DIR
- zlib-1.2.5.tar.gz
- zlib125dll.zip
- irrlicht-1.7.1.zip
- 110214175330.zip (or whatever, this is the minetest source)
+ zlib-1.2.5
- zlib.h
+ win32
...
+ zlib125dll
- readme.txt
+ dll32
...
+ irrlicht-1.7.1
+ lib
+ include
...
+ minetest
+ src
+ doc
- CMakeLists.txt
...
-----------------
- Start up the CMake GUI
- Select "Browse Source..." and select DIR/minetest
- Now, if using MSVC:
- Select "Browse Build..." and select DIR/minetest-build
- Else if using MinGW:
- Select "Browse Build..." and select DIR/minetest
- Select "Configure"
- Select your compiler
- It will warn about missing stuff, ignore that at this point. (later don't)
- Make sure the configuration is as follows
(note that the versions may differ for you):
-----------------
BUILD_CLIENT [X]
BUILD_SERVER [ ]
CMAKE_BUILD_TYPE Release
CMAKE_INSTALL_PREFIX DIR/minetest-install
IRRLICHT_SOURCE_DIR DIR/irrlicht-1.7.1
RUN_IN_PLACE [X]
WARN_ALL [ ]
ZLIB_DLL DIR/zlib125dll/dll32/zlibwapi.dll
ZLIB_INCLUDE_DIR DIR/zlib-1.2.5
ZLIB_LIBRARIES DIR/zlib125dll/dll32/zlibwapi.lib
-----------------
- Hit "Configure"
- Hit "Generate"
If using MSVC:
- Open the generated minetest.sln
- The project defaults to the "Debug" configuration. Make very sure to
select "Release", unless you want to debug some stuff (it's slower)
- Build the ALL_BUILD project
- Build the INSTALL project
- You should now have a working game with the executable in
DIR/minetest-install/bin/minetest.exe
- Additionally you may create a zip package by building the PACKAGE
project.
If using MinGW:
- Using the command line, browse to the build directory and run 'make'
(or mingw32-make or whatever it happens to be)
- You should now have a working game with the executable in
DIR/minetest/bin/minetest.exe
License of Minetest-c55
-----------------------
Minetest-c55
Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Irrlicht
---------------
This program uses the Irrlicht Engine. http://irrlicht.sourceforge.net/
The Irrlicht Engine License
Copyright © 2002-2005 Nikolaus Gebhardt
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute
it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you use
this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
JThread
---------------
This program uses the JThread library. License for JThread follows:
Copyright (c) 2000-2006 Jori Liesenborgs (jori.liesenborgs@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
genmap.py 0 → 100755
#!/usr/bin/python2
# This is an example script that generates some valid map data.
import struct
import random
import os
import sys
import zlib
import array
from pnoise import pnoise
# Old directory format:
# world/sectors/XXXXZZZZ/YYYY
# XXXX,YYYY,ZZZZ = coordinates in hexadecimal
# fffe = -2
# ffff = -1
# 0000 = 0
# 0001 = 1
#
# New directory format:
# world/sectors2/XXX/ZZZ/YYYY
# XXX,YYYY,ZZZ = coordinates in hexadecimal
# fffe = -2
# ffff = -1
# 0000 = 0
# 0001 = 1
# ffe = -2
# fff = -1
# 000 = 0
# 001 = 1
#
# For more proper file format documentation, refer to mapformat.txt
# For node type documentation, refer to mapnode.h
# NodeMetadata documentation is not complete, refer to nodemeta.cpp
#
# Seed for generating terrain
SEED = 0
# 0=old, 1=new
SECTOR_DIR_FORMAT = 1
mapdir = "world"
def to4h(i):
s = "";
s += '{0:1x}'.format((i>>12) & 0x000f)
s += '{0:1x}'.format((i>>8) & 0x000f)
s += '{0:1x}'.format((i>>4) & 0x000f)
s += '{0:1x}'.format((i>>0) & 0x000f)
return s
def to3h(i):
s = "";
s += '{0:1x}'.format((i>>8) & 0x000f)
s += '{0:1x}'.format((i>>4) & 0x000f)
s += '{0:1x}'.format((i>>0) & 0x000f)
return s
def get_sector_dir(px, pz):
global SECTOR_DIR_FORMAT
if SECTOR_DIR_FORMAT == 0:
return "/sectors/"+to4h(px)+to4h(pz)
elif SECTOR_DIR_FORMAT == 1:
return "/sectors2/"+to3h(px)+"/"+to3h(pz)
else:
assert(0)
def getrand_air_stone():
i = random.randrange(0,2)
if i==0:
return 0
return 254
# 3-dimensional vector (position)
class v3:
def __init__(self, x=0, y=0, z=0):
self.X = x
self.Y = y
self.Z = z
class NodeMeta:
def __init__(self, type_id, data):
self.type_id = type_id
self.data = data
class StaticObject:
def __init__(self):
self.type_id = 0
self.data = ""
def ser_u16(i):
return chr((i>>8)&0xff) + chr((i>>0)&0xff)
def ser_u32(i):
return (chr((i>>24)&0xff) + chr((i>>16)&0xff)
+ chr((i>>8)&0xff) + chr((i>>0)&0xff))
# A 16x16x16 chunk of map
class MapBlock:
def __init__(self):
self.content = array.array('B')
self.param1 = array.array('B')
self.param2 = array.array('B')
for i in range(16*16*16):
# Initialize to air
self.content.append(254)
# Full light on sunlight, none when no sunlight
self.param1.append(15)
# No additional parameters
self.param2.append(0)
# key = v3 pos
# value = NodeMeta
self.nodemeta = {}
# key = v3 pos
# value = StaticObject
self.static_objects = {}
def set_content(self, v3, b):
self.content[v3.Z*16*16+v3.Y*16+v3.X] = b
def set_param1(self, v3, b):
self.param1[v3.Z*16*16+v3.Y*16+v3.X] = b
def set_param2(self, v3, b):
self.param2[v3.Z*16*16+v3.Y*16+v3.X] = b
# Get data for serialization. Returns a string.
def serialize_data(self):
s = ""
for i in range(16*16*16):
s += chr(self.content[i])
for i in range(16*16*16):
s += chr(self.param1[i])
for i in range(16*16*16):
s += chr(self.param2[i])
return s
def serialize_nodemeta(self):
s = ""
s += ser_u16(1)
s += ser_u16(len(self.nodemeta))
for pos, meta in self.nodemeta.items():
pos_i = pos.Z*16*16 + pos.Y*16 + pos.X
s += ser_u16(pos_i)
s += ser_u16(meta.type_id)
s += ser_u16(len(meta.data))
s += meta.data
return s
def serialize_staticobj(self):
s = ""
s += chr(0)
s += ser_u16(len(self.static_objects))
for pos, obj in self.static_objects.items():
pos_i = pos.Z*16*16 + pos.Y*16 + pos.X
s += ser_s32(pos.X*1000)
s += ser_s32(pos.Y*1000)
s += ser_s32(pos.Z*1000)
s += ser_u16(obj.type_id)
s += ser_u16(len(obj.data))
s += obj.data
return s
def writeblock(mapdir, px,py,pz, block):
sectordir = mapdir + get_sector_dir(px, pz);
try:
os.makedirs(sectordir)
except OSError:
pass
path = sectordir+"/"+to4h(py)
print("writing block file "+path)
f = open(sectordir+"/"+to4h(py), "wb")
if f == None:
return
# version
version = 17
f.write(struct.pack('B', version))
# flags
# 0x01=is_undg, 0x02=dn_diff, 0x04=lighting_expired
flags = 0 + 0x02 + 0x04
f.write(struct.pack('B', flags))
# data
c_obj = zlib.compressobj()
c_obj.compress(block.serialize_data())
f.write(struct.pack('BB', 0x78, 0x9c)) # zlib magic number
f.write(c_obj.flush())
# node metadata
c_obj = zlib.compressobj()
c_obj.compress(block.serialize_nodemeta())
f.write(struct.pack('BB', 0x78, 0x9c)) # zlib magic number
f.write(c_obj.flush())
# mapblockobject count
f.write(ser_u16(0))
# static objects
f.write(block.serialize_staticobj())
# timestamp
f.write(ser_u32(0xffffffff))
f.close()
for z0 in range(-1,3):
for x0 in range(-1,3):
for y0 in range(-1,3):
print("generating block "+str(x0)+","+str(y0)+","+str(z0))
#v3 blockp = v3(x0,y0,z0)
# Create a MapBlock
block = MapBlock()
# Generate stuff in it
for z in range(0,16):
for x in range(0,16):
h = 20.0*pnoise((x0*16+x)/100.,(z0*16+z)/100.,SEED+0)
h += 5.0*pnoise((x0*16+x)/25.,(z0*16+z)/25.,SEED+0)
if pnoise((x0*16+x)/25.,(z0*16+z)/25.,SEED+92412) > 0.05:
h += 10
#print("r="+str(r))
# This enables comparison by ==
h = int(h)
for y in range(0,16):
p = v3(x,y,z)
b = 254
y1 = y0*16+y
if y1 <= h-3:
b = 0 #stone
elif y1 <= h and y1 <= 0:
b = 8 #mud
elif y1 == h:
b = 1 #grass
elif y1 < h:
b = 8 #mud
elif y1 <= 1:
b = 9 #water
# Material content
block.set_content(p, b)
# Place a sign at the center at surface level.
# Placing a sign means placing the sign node and
# adding node metadata to the mapblock.
if x == 8 and z == 8 and y0*16 <= h-1 and (y0+1)*16-1 > h:
p = v3(8,h+1-y0*16,8)
# 14 = Sign
content_type = 14
block.set_content(p, content_type)
# This places the sign to the bottom of the cube.
# Working values: 0x01, 0x02, 0x04, 0x08, 0x10, 0x20
block.set_param2(p, 0x08)
# Then add metadata to hold the text of the sign
s = "Hello at sector ("+str(x0)+","+str(z0)+")"
meta = NodeMeta(content_type, ser_u16(len(s))+s)
block.nodemeta[p] = meta
# Write it on disk
writeblock(mapdir, x0,y0,z0, block)
#END
#!/bin/sh
PROJECT_NAME=minetest-delta
PACKAGEDIR=../$PROJECT_NAME-packages
PACKAGENAME=$PROJECT_NAME-binary-`date +%y%m%d%H%M%S`
PACKAGEPATH=$PACKAGEDIR/$PACKAGENAME
mkdir -p $PACKAGEPATH
mkdir -p $PACKAGEPATH/bin
mkdir -p $PACKAGEPATH/data
mkdir -p $PACKAGEPATH/doc
mkdir -p $PACKAGEPATH/locale/de/LC_MESSAGES/
cp minetest.conf.example $PACKAGEPATH/
cp bin/$PROJECT_NAME.exe $PACKAGEPATH/bin/
cp bin/Irrlicht.dll $PACKAGEPATH/bin/
cp bin/zlibwapi.dll $PACKAGEPATH/bin/
#cp bin/test $PACKAGEPATH/bin/
#cp bin/fasttest $PACKAGEPATH/bin/
#cp bin/server $PACKAGEPATH/bin/
#cp ../irrlicht/irrlicht-1.7.1/lib/Linux/libIrrlicht.a $PACKAGEPATH/bin/
#cp ../jthread/jthread-1.2.1/src/.libs/libjthread-1.2.1.so $PACKAGEPATH/bin/
cp -r data/fontlucida.png $PACKAGEPATH/data/
cp -r data/player.png $PACKAGEPATH/data/
cp -r data/player_back.png $PACKAGEPATH/data/
cp -r data/stone.png $PACKAGEPATH/data/
cp -r data/grass.png $PACKAGEPATH/data/
cp -r data/grass_footsteps.png $PACKAGEPATH/data/
cp -r data/water.png $PACKAGEPATH/data/
cp -r data/tree.png $PACKAGEPATH/data/
cp -r data/leaves.png $PACKAGEPATH/data/
cp -r data/mese.png $PACKAGEPATH/data/
cp -r data/cloud.png $PACKAGEPATH/data/
cp -r data/sign.png $PACKAGEPATH/data/
cp -r data/sign_back.png $PACKAGEPATH/data/
cp -r data/rat.png $PACKAGEPATH/data/
cp -r data/mud.png $PACKAGEPATH/data/
cp -r data/torch.png $PACKAGEPATH/data/
cp -r data/torch_on_floor.png $PACKAGEPATH/data/
cp -r data/torch_on_ceiling.png $PACKAGEPATH/data/
cp -r data/tree_top.png $PACKAGEPATH/data/
cp -r data/coalstone.png $PACKAGEPATH/data/
cp -r data/crack.png $PACKAGEPATH/data/
cp -r data/wood.png $PACKAGEPATH/data/
cp -r data/stick.png $PACKAGEPATH/data/
cp -r data/tool_wpick.png $PACKAGEPATH/data/
cp -r data/tool_stpick.png $PACKAGEPATH/data/
cp -r data/tool_mesepick.png $PACKAGEPATH/data/
cp -r data/grass_side.png $PACKAGEPATH/data/
cp -r data/lump_of_coal.png $PACKAGEPATH/data/
cp -r data/lump_of_iron.png $PACKAGEPATH/data/
cp -r data/mineral_coal.png $PACKAGEPATH/data/
cp -r data/mineral_iron.png $PACKAGEPATH/data/
cp -r data/sand.png $PACKAGEPATH/data/
#cp -r data/pauseMenu.gui $PACKAGEPATH/data/
cp -r doc/README.txt $PACKAGEPATH/doc/README.txt
cp -r locale/de/LC_MESSAGES/$PROJECT_NAME.mo $PACKAGEPATH/locale/de/LC_MESSAGES/
cd $PACKAGEDIR
rm $PACKAGENAME.zip
zip -r $PACKAGENAME.zip $PACKAGENAME
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="48px"
height="48px"
id="svg2856"
version="1.1"
inkscape:version="0.47 r22583"
sodipodi:docname="minetest-icon.svg"
inkscape:export-filename="/home/erlehmann/pics/icons/minetest/minetest-icon-24x24.png"
inkscape:export-xdpi="45"
inkscape:export-ydpi="45">
<defs
id="defs2858">
<filter
inkscape:collect="always"
id="filter3864">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.20490381"
id="feGaussianBlur3866" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="12.083333"
inkscape:cx="24"
inkscape:cy="24"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1233"
inkscape:window-height="755"
inkscape:window-x="0"
inkscape:window-y="25"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid2866"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
spacingx="0.5px"
spacingy="10px"
color="#ff0000"
opacity="0.1254902"
empcolor="#ff0000"
empopacity="0.25098039"
dotted="false" />
<inkscape:grid
type="axonomgrid"
id="grid2870"
units="px"
empspacing="1"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
spacingy="1px"
originx="0px" />
</sodipodi:namedview>
<metadata
id="metadata2861">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
style="fill:#e9b96e;fill-opacity:1;stroke:#573a0d;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
d="M 6.1513775e-7,16 3.2110204e-7,28 21.035899,40.145082 l 21,-12.414519 0,-11.461126 L 20.78461,4 6.1513775e-7,16 z"
id="path3047"
transform="translate(3.4641013,6)"
sodipodi:nodetypes="ccccccc" />
<path
style="fill:#2e3436;fill-opacity:1;stroke:#2e3436;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
d="m 8.5,30.907477 -2,-1.1547 0,6 L 17.320508,42 l 0,-2 -1.732051,-1 0,-2 L 13.5,35.794229 l 0,-4 -5,-2.886752 0,2 z"
id="path3831"
sodipodi:nodetypes="ccccccccccc" />
<path
style="opacity:1;fill:#555753;fill-opacity:1;stroke:#2e3436;stroke-linejoin:miter"
d="m 6.9282032,36 3.4641018,-2 3.464101,2 1.643594,0.948929 0,2 2,1.154701 0,2 L 6.9282032,36 z"
id="path3870"
sodipodi:nodetypes="cccccccc" />
<path
style="fill:#fce94f;fill-opacity:1;stroke:#625802;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
d="M 25.980762,19 31.5,22.186533 l 0,2 L 38.09375,28 41.5625,26 45.5,23.730563 l 0,2.538874 0,-4 L 32.908965,15 25.980762,19 z"
id="path3851"
sodipodi:nodetypes="cccccccccc" />
<path
style="fill:#e9b96e;fill-opacity:1;stroke:#573a0d;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0.50000000000000000"
d="m 24.839746,18.341234 8.660254,-5 0,2 -8.660254,5 0,-2 z"
id="path5684"
sodipodi:nodetypes="ccccc" />
<path
style="fill:#73d216;fill-opacity:1;stroke:#325b09;stroke-width:1;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
d="M 25.980762,5 3.4641016,18 17.5,26.10363 31.5,18.186533 24.839746,14.341234 33.5,9.341234 25.980762,5 z"
id="path3821"
sodipodi:nodetypes="ccccccc"
transform="translate(0,4)" />
<path
style="fill:#729fcf;fill-opacity:1;stroke:#19314b;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
d="m 17.5,28.10363 0,2 1.552559,0.89637 0,2 5.447441,3.145082 12,-7.071797 0,-2.14657 2,-1.1547 0,-1.54403 -7,-4.041452 -14,7.917097 z"
id="path3825"
sodipodi:nodetypes="ccccccccccc"
transform="translate(0,4)" />
<g
id="g5691"
style="stroke-linejoin:miter">
<path
sodipodi:nodetypes="ccccc"
id="path3862"
d="m 13.856406,20 6.928204,4 -6.928204,4 -6.9282028,-4 6.9282028,-4 z"
style="fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;filter:url(#filter3864);opacity:0.25000000000000000" />
<g
id="g3858"
style="stroke-linejoin:miter">
<path
style="fill:#c17d11;fill-opacity:1;stroke:#8f5902;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
d="m 15.588457,21 1.732051,1 1.732051,-1 0,-6 -1.732051,-1 -1.732051,1 0,6 z"
id="path3833"
sodipodi:nodetypes="ccccccc"
transform="translate(-3.4641015,2)" />
<path
style="fill:#4e9a06;fill-opacity:1;stroke:#316004;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
d="M 9.9641015,13.752777 17.320508,18 l 6.643593,-3.835681 0,-8.3286385 L 17.320508,2 9.9641015,6.2472233 l 0,7.5055537 z"
id="path3837"
transform="translate(-3.4641015,2)"
sodipodi:nodetypes="ccccccc" />
</g>
</g>
<g
id="g5686"
transform="translate(-4.2591582e-7,2)"
style="stroke-linejoin:miter">
<path
transform="translate(24.248712,-2)"
style="opacity:0.25000000000000000;fill:#2e3436;fill-opacity:1;stroke:none;filter:url(#filter3864);stroke-linejoin:miter"
d="m 13.856406,20 5.196153,3 -5.196153,3 -5.196152,-3 5.196152,-3 z"
id="path3868"
sodipodi:nodetypes="ccccc" />
<path
style="fill:#4e9a06;fill-opacity:1;stroke:#316004;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
d="M 15.71539,21.073285 17.320508,22 l 1.394882,-0.805336 0,-8.389328 L 17.320508,12 l -1.605118,1.073285 0,8 z"
id="path3853"
sodipodi:nodetypes="ccccccc"
transform="translate(20.78461,0)" />
</g>
<path
style="fill:none;fill-opacity:1;stroke:#ef2929;stroke-width:0.50000000000000000;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:0.50000000000000000, 0.50000000000000000;stroke-dashoffset:0.25000000000000000"
d="M 12.124356,33 11.25833,32.5"
id="path3872"
sodipodi:nodetypes="cc" />
<path
style="fill:#888a85;stroke:#2e3436;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0.50000000000000000"
d="m 45.5,26.730563 -4,2.309401 0,1 -2,1.1547 0,2 -2,1.154701 0,4 8,-4.618802 0,-7 z"
id="path3874"
sodipodi:nodetypes="ccccccccc" />
</g>
</svg>
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
#!/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)
pnoise.py 0 → 100644
#
# 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)))
# German translations for minetest-c55 package.
# Copyright (C) 2011 celeron
# This file is distributed under the same license as the minetest-c55 package.
# Constantin Wenger <constantin.wenger@googlemail.com>, 2011.
#
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"
"Last-Translator: Constantin Wenger <constantin.wenger@googlemail.com>\n"
"Language-Team: Deutsch <>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
#: src/guiMainMenu.cpp:180
msgid "Name/Password"
msgstr "Name/Passwort"
#: src/guiMainMenu.cpp:203
msgid "Address/Port"
msgstr "Adresse / Port"
#: src/guiMainMenu.cpp:223
msgid "Leave address blank to start a local server."
msgstr "Lasse die Adresse frei um einen eigenen Server zu starten"
#: src/guiMainMenu.cpp:230
msgid "Fancy trees"
msgstr "Schöne Bäume"
#: src/guiMainMenu.cpp:236
msgid "Smooth Lighting"
msgstr "Besseres Licht"
#: src/guiMainMenu.cpp:244
msgid "Start Game / Connect"
msgstr "Spiel starten / Verbinden"
#: src/guiMainMenu.cpp:253
msgid "Change keys"
msgstr "Tastenbelegung ändern"
#: src/guiMainMenu.cpp:276
msgid "Creative Mode"
msgstr "Kreativitätsmodus"
#: src/guiMainMenu.cpp:282
msgid "Enable Damage"
msgstr "Schaden einschalten"
#: src/guiMainMenu.cpp:290
msgid "Delete map"
msgstr "Karte löschen"
#: src/guiMessageMenu.cpp:93 src/guiTextInputMenu.cpp:111
msgid "Proceed"
msgstr "Fortsetzen"
#: src/guiPasswordChange.cpp:102
msgid "Old Password"
msgstr "Altes Passwort"
#: src/guiPasswordChange.cpp:117
msgid "New Password"
msgstr "Neues Passwort"
#: src/guiPasswordChange.cpp:131
msgid "Confirm Password"
msgstr "Passwort wiederholen"
#: src/guiPasswordChange.cpp:146
msgid "Change"
msgstr "Ändern"
#: src/guiPasswordChange.cpp:155
msgid "Passwords do not match!"
msgstr "Passwörter passen nicht zusammen"
#: src/guiPauseMenu.cpp:110
msgid "Continue"
msgstr "Weiter"
#: src/guiPauseMenu.cpp:117
msgid "Change Password"
msgstr "Passwort ändern"
#: src/guiPauseMenu.cpp:124
msgid "Disconnect"
msgstr "Verbindung trennen"
#: src/guiPauseMenu.cpp:131
msgid "Exit to OS"
msgstr "Programm beenden"
#: 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 ""
"Tastenkürzel:\n"
"- WASD: Gehen\n"
"- linke Maustaste: dig blocks\n"
"- rechte Maustaste: place blocks\n"
"- Mausrad: Item auswählen\n"
"- 0...9: Item auswählen\n"
"- Shift: ducken\n"
"- R: Alle geladenen Kartenteile anzeigen, umschalten\n"
"- I: Inventarmenü\n"
"- T: Chat\n"
# 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-22 11:02+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/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 ""
# French translations for minetest-c55 package.
# Copyright (C) 2011 celeron
# This file is distributed under the same license as the minetest-c55 package.
# Cyriaque 'Cisoun' Skrapits <cysoun@gmail.com>, 2011
#
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-21 15:48+0200\n"
"Last-Translator: Cyriaque 'Cisoun' Skrapits <cysoun@gmail.com>\n"
"Language-Team: Français <>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
#: src/guiMainMenu.cpp:180
msgid "Name/Password"
msgstr "Nom / MdP"
#: src/guiMainMenu.cpp:203
msgid "Address/Port"
msgstr "Adresse / Port"
#: src/guiMainMenu.cpp:223
msgid "Leave address blank to start a local server."
msgstr "Laisser l'adresse vide pour lancer un serveur local."
#: src/guiMainMenu.cpp:230
msgid "Fancy trees"
msgstr "Arbres spéciaux"
#: src/guiMainMenu.cpp:236
msgid "Smooth Lighting"
msgstr "Lumière douce"
#: src/guiMainMenu.cpp:244
msgid "Start Game / Connect"
msgstr "Démarrer / Connecter"
#: src/guiMainMenu.cpp:253
msgid "Change keys"
msgstr "Changer touches"
#: src/guiMainMenu.cpp:276
msgid "Creative Mode"
msgstr "Mode créatif"
#: src/guiMainMenu.cpp:282
msgid "Enable Damage"
msgstr "Activer blessures"
#: src/guiMainMenu.cpp:290
msgid "Delete map"
msgstr "Supprimer carte"
#: src/guiMessageMenu.cpp:93 src/guiTextInputMenu.cpp:111
msgid "Proceed"
msgstr "OK"
#: src/guiPasswordChange.cpp:102
msgid "Old Password"
msgstr "Ancien mot de passe"
#: src/guiPasswordChange.cpp:117
msgid "New Password"
msgstr "Nouveau mot de passe"
#: src/guiPasswordChange.cpp:131
msgid "Confirm Password"
msgstr "Confirmer mot de passe"
#: src/guiPasswordChange.cpp:146
msgid "Change"
msgstr "Changer"
#: src/guiPasswordChange.cpp:155
msgid "Passwords do not match!"
msgstr "Mauvaise correspondance!"
#: src/guiPauseMenu.cpp:110
msgid "Continue"
msgstr "Continuer"
#: src/guiPauseMenu.cpp:117
msgid "Change Password"
msgstr "Changer mot de passe"
#: src/guiPauseMenu.cpp:124
msgid "Disconnect"
msgstr "Déconnection"
#: src/guiPauseMenu.cpp:131
msgid "Exit to OS"
msgstr "Quitter le jeu"
#: 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 ""
"Touches:\n"
"- WASD: Marcher\n"
"- Clic gauche: Creuser bloc\n"
"- Clic droite: Insérer bloc\n"
"- Roulette: Sélection élément\n"
"- 0...9: Sélection élément\n"
"- Shift: S'accroupir\n"
"- R: Active la vue de tous les blocs\n"
"- I: Inventaire\n"
"- T: Chat\n"
project(minetest)
project(minetest-delta)
cmake_minimum_required( VERSION 2.6 )
if(RUN_IN_PLACE)
add_definitions ( -DRUN_IN_PLACE )
endif(RUN_IN_PLACE)
OPTION(USE_GETTEXT "Use GetText for internationalization" OFF)
if(USE_GETTEXT)
find_package(GettextLib REQUIRED)
message(STATUS "gettext include path: ${GETTEXT_INCLUDE_DIR}")
message(STATUS "gettext msgfmt path: ${GETTEXT_MSGFMT}")
if(WIN32)
message(STATUS "gettext library: ${GETTEXT_LIBRARY}")
message(STATUS "gettext dll: ${GETTEXT_DLL}")
message(STATUS "gettext iconv dll: ${GETTEXT_ICONV_DLL}")
endif()
if (GETTEXT_FOUND)
add_definitions( -DUSE_GETTEXT )
message(STATUS "GetText enabled; locales found: ${GETTEXT_AVAILABLE_LOCALES}")
else()
message(STATUS "ERROR: GetText enabled but not found, disabling")
set(USE_GETTEXT FALSE)
endif(GETTEXT_FOUND)
else(USE_GETTEXT)
message(STATUS "GetText disabled")
endif(USE_GETTEXT)
if(NOT MSVC)
set(USE_GPROF 0 CACHE BOOL "Use -pg flag for g++")
endif()
......@@ -27,6 +49,8 @@ if(WIN32)
CACHE FILEPATH "Path to zlibwapi.lib")
set(ZLIB_DLL "${PROJECT_SOURCE_DIR}/../../zlib125dll/dll32/zlibwapi.dll"
CACHE FILEPATH "Path to zlibwapi.dll (for installation)")
set(IRRLICHT_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../irrlicht-1.7.2"
CACHE PATH "irrlicht dir")
else()
# Unix probably
if(BUILD_CLIENT)
......@@ -55,6 +79,9 @@ else()
set(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${XXF86VM_LIBRARY})
endif()
find_package(Jthread REQUIRED)
find_package(Sqlite3 REQUIRED)
configure_file(
"${PROJECT_SOURCE_DIR}/cmake_config.h.in"
"${PROJECT_BINARY_DIR}/cmake_config.h"
......@@ -110,6 +137,7 @@ set(minetest_SRCS
clouds.cpp
clientobject.cpp
guiMainMenu.cpp
guiKeyChangeMenu.cpp
guiMessageMenu.cpp
guiTextInputMenu.cpp
guiInventoryMenu.cpp
......@@ -133,16 +161,17 @@ include_directories(
${ZLIB_INCLUDE_DIR}
${CMAKE_BUILD_TYPE}
${PNG_INCLUDE_DIR}
"${PROJECT_SOURCE_DIR}/jthread"
"${PROJECT_SOURCE_DIR}/sqlite"
${GETTEXT_INCLUDE_DIR}
${JTHREAD_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
)
set(EXECUTABLE_OUTPUT_PATH ../bin)
if(BUILD_CLIENT)
add_executable(minetest ${minetest_SRCS})
add_executable(${PROJECT_NAME} ${minetest_SRCS})
target_link_libraries(
minetest
${PROJECT_NAME}
${ZLIB_LIBRARIES}
${IRRLICHT_LIBRARY}
${OPENGL_LIBRARIES}
......@@ -150,21 +179,22 @@ if(BUILD_CLIENT)
${BZIP2_LIBRARIES}
${PNG_LIBRARIES}
${X11_LIBRARIES}
${GETTEXT_LIBRARY}
${PLATFORM_LIBS}
${CLIENT_PLATFORM_LIBS}
jthread
sqlite3
${JTHREAD_LIBRARY}
${SQLITE3_LIBRARY}
)
endif(BUILD_CLIENT)
if(BUILD_SERVER)
add_executable(minetestserver ${minetestserver_SRCS})
add_executable(${PROJECT_NAME}server ${minetestserver_SRCS})
target_link_libraries(
minetestserver
${PROJECT_NAME}server
${ZLIB_LIBRARIES}
${PLATFORM_LIBS}
jthread
sqlite3
${JTHREAD_LIBRARY}
${SQLITE3_LIBRARY}
)
endif(BUILD_SERVER)
......@@ -185,7 +215,7 @@ if(MSVC)
set(CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Ob0 /Od /RTC1")
if(BUILD_SERVER)
set_target_properties(minetestserver PROPERTIES
set_target_properties(${PROJECT_NAME}server PROPERTIES
COMPILE_DEFINITIONS "SERVER")
endif(BUILD_SERVER)
......@@ -215,7 +245,7 @@ else()
endif()
if(BUILD_SERVER)
set_target_properties(minetestserver PROPERTIES
set_target_properties(${PROJECT_NAME}server PROPERTIES
COMPILE_DEFINITIONS "SERVER")
endif(BUILD_SERVER)
......@@ -232,12 +262,20 @@ endif()
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../minetest.conf.example" DESTINATION ${EXAMPLE_CONF_DIR})
if(BUILD_CLIENT)
install(TARGETS minetest DESTINATION ${BINDIR})
install(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
file(GLOB images "${CMAKE_CURRENT_SOURCE_DIR}/../data/*.png")
install(FILES ${images} DESTINATION ${DATADIR})
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")
install(FILES ${MO_BUILD_PATH} DESTINATION ${MO_DEST_PATH})
endforeach(LOCALE ${GETTEXT_AVAILABLE_LOCALES})
endif()
if(WIN32)
if(DEFINED IRRLICHT_DLL)
install(FILES ${IRRLICHT_DLL} DESTINATION ${BINDIR})
......@@ -245,16 +283,82 @@ if(BUILD_CLIENT)
if(DEFINED ZLIB_DLL)
install(FILES ${ZLIB_DLL} DESTINATION ${BINDIR})
endif()
if(USE_GETTEXT)
if(DEFINED GETTEXT_DLL)
install(FILES ${GETTEXT_DLL} DESTINATION ${BINDIR})
endif()
if(DEFINED GETTEXT_ICONV_DLL)
install(FILES ${GETTEXT_ICONV_DLL} DESTINATION ${BINDIR})
endif()
endif(USE_GETTEXT)
endif()
endif(BUILD_CLIENT)
if(BUILD_SERVER)
install(TARGETS minetestserver DESTINATION ${BINDIR})
install(TARGETS ${PROJECT_NAME}server DESTINATION ${BINDIR})
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_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")
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
add_subdirectory(jthread)
if (JTHREAD_FOUND)
else (JTHREAD_FOUND)
add_subdirectory(jthread)
endif (JTHREAD_FOUND)
if (SQLITE3_FOUND)
else (SQLITE3_FOUND)
add_subdirectory(sqlite)
endif (SQLITE3_FOUND)
#end
......@@ -5,7 +5,7 @@ Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
MeshUpdateQueue::(at your option) any later version.
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
......@@ -328,7 +328,8 @@ void Client::step(float dtime)
core::list<v3s16> deleted_blocks;
g_settings.getFloat("client_unload_unused_data_timeout");
float delete_unused_sectors_timeout =
g_settings.getFloat("client_delete_unused_sectors_timeout");
// Delete sector blocks
/*u32 num = m_env.getMap().unloadUnusedData
......
......@@ -84,7 +84,7 @@ void Clouds::render()
*/
const s16 cloud_radius_i = 12;
const float cloud_size = BS*50;
const float cloud_size = BS*48;
const v2f cloud_speed(-BS*2, 0);
// Position of cloud noise origin in world coordinates
......@@ -123,24 +123,88 @@ void Clouds::render()
(float)p_in_noise_i.X*cloud_size/BS/200,
(float)p_in_noise_i.Y*cloud_size/BS/200,
m_seed, 3, 0.4);
if(noise < 0.8)
if(noise < 0.95)
continue;
v2f p1 = p0 + v2f(1,1)*cloud_size;
//video::SColor c(128,255,255,255);
float b = m_brightness;
video::SColor c(128,b*230,b*230,b*255);
video::S3DVertex vertices[4] =
video::SColor c_top(128,b*240,b*240,b*255);
video::SColor c_side_1(128,b*230,b*230,b*255);
video::SColor c_side_2(128,b*220,b*220,b*245);
video::SColor c_bottom(128,b*205,b*205,b*230);
video::S3DVertex v[4] =
{
video::S3DVertex(p0.X,m_cloud_y,p0.Y, 0,0,0, c, 0,1),
video::S3DVertex(p0.X,m_cloud_y,p1.Y, 0,0,0, c, 1,1),
video::S3DVertex(p1.X,m_cloud_y,p1.Y, 0,0,0, c, 1,0),
video::S3DVertex(p1.X,m_cloud_y,p0.Y, 0,0,0, c, 0,0),
video::S3DVertex(0,0,0, 0,0,0, c_top, 0, 1),
video::S3DVertex(0,0,0, 0,0,0, c_top, 1, 1),
video::S3DVertex(0,0,0, 0,0,0, c_top, 1, 0),
video::S3DVertex(0,0,0, 0,0,0, c_top, 0, 0)
};
u16 indices[] = {0,1,2,2,3,0};
driver->drawVertexPrimitiveList(vertices, 4, indices, 2,
video::EVT_STANDARD, scene::EPT_TRIANGLES, video::EIT_16BIT);
f32 rx = cloud_size;
f32 ry = 8*BS;
f32 rz = cloud_size;
for(int i=0;i<6;i++)
{
switch(i)
{
case 0: // top
v[0].Pos.X=-rx; v[0].Pos.Y= ry; v[0].Pos.Z=-rz;
v[1].Pos.X=-rx; v[1].Pos.Y= ry; v[1].Pos.Z= rz;
v[2].Pos.X= rx; v[2].Pos.Y= ry; v[2].Pos.Z= rz;
v[3].Pos.X= rx; v[3].Pos.Y= ry, v[3].Pos.Z=-rz;
break;
case 1: // back
for(int j=0;j<4;j++)
v[j].Color=c_side_1;
v[0].Pos.X=-rx; v[0].Pos.Y= ry; v[0].Pos.Z=-rz;
v[1].Pos.X= rx; v[1].Pos.Y= ry; v[1].Pos.Z=-rz;
v[2].Pos.X= rx; v[2].Pos.Y=-ry; v[2].Pos.Z=-rz;
v[3].Pos.X=-rx; v[3].Pos.Y=-ry, v[3].Pos.Z=-rz;
break;
case 2: //right
for(int j=0;j<4;j++)
v[j].Color=c_side_2;
v[0].Pos.X= rx; v[0].Pos.Y= ry; v[0].Pos.Z=-rz;
v[1].Pos.X= rx; v[1].Pos.Y= ry; v[1].Pos.Z= rz;
v[2].Pos.X= rx; v[2].Pos.Y=-ry; v[2].Pos.Z= rz;
v[3].Pos.X= rx; v[3].Pos.Y=-ry, v[3].Pos.Z=-rz;
break;
case 3: // front
for(int j=0;j<4;j++)
v[j].Color=c_side_1;
v[0].Pos.X= rx; v[0].Pos.Y= ry; v[0].Pos.Z= rz;
v[1].Pos.X=-rx; v[1].Pos.Y= ry; v[1].Pos.Z= rz;
v[2].Pos.X=-rx; v[2].Pos.Y=-ry; v[2].Pos.Z= rz;
v[3].Pos.X= rx; v[3].Pos.Y=-ry, v[3].Pos.Z= rz;
break;
case 4: // left
for(int j=0;j<4;j++)
v[j].Color=c_side_2;
v[0].Pos.X=-rx; v[0].Pos.Y= ry; v[0].Pos.Z= rz;
v[1].Pos.X=-rx; v[1].Pos.Y= ry; v[1].Pos.Z=-rz;
v[2].Pos.X=-rx; v[2].Pos.Y=-ry; v[2].Pos.Z=-rz;
v[3].Pos.X=-rx; v[3].Pos.Y=-ry, v[3].Pos.Z= rz;
break;
case 5: // bottom
for(int j=0;j<4;j++)
v[j].Color=c_bottom;
v[0].Pos.X= rx; v[0].Pos.Y=-ry; v[0].Pos.Z= rz;
v[1].Pos.X=-rx; v[1].Pos.Y=-ry; v[1].Pos.Z= rz;
v[2].Pos.X=-rx; v[2].Pos.Y=-ry; v[2].Pos.Z=-rz;
v[3].Pos.X= rx; v[3].Pos.Y=-ry, v[3].Pos.Z=-rz;
break;
}
v3f pos = v3f(p0.X,m_cloud_y,p0.Y);
for(u16 i=0; i<4; i++)
v[i].Pos += pos;
u16 indices[] = {0,1,2,2,3,0};
driver->drawVertexPrimitiveList(v, 4, indices, 2,
video::EVT_STANDARD, scene::EPT_TRIANGLES, video::EIT_16BIT);
}
}
}
......
......@@ -752,4 +752,161 @@ void Oerkki1CAO::initialize(const std::string &data)
updateNodePos();
}
/*
FireflyCAO
*/
// Prototype
FireflyCAO proto_FireflyCAO;
FireflyCAO::FireflyCAO():
ClientActiveObject(0),
m_selection_box(-BS/3.,0.0,-BS/3., BS/3.,BS/2.,BS/3.),
m_node(NULL),
m_position(v3f(0,10*BS,0)),
m_yaw(0)
{
ClientActiveObject::registerType(getType(), create);
}
FireflyCAO::~FireflyCAO()
{
}
ClientActiveObject* FireflyCAO::create()
{
return new FireflyCAO();
}
void FireflyCAO::addToScene(scene::ISceneManager *smgr)
{
if(m_node != NULL)
return;
video::IVideoDriver* driver = smgr->getVideoDriver();
scene::SMesh *mesh = new scene::SMesh();
scene::IMeshBuffer *buf = new scene::SMeshBuffer();
video::SColor c(255,255,255,255);
video::S3DVertex vertices[4] =
{
video::S3DVertex(0,0,0, 0,0,0, c, 0,1),
video::S3DVertex(BS/2,0,0, 0,0,0, c, 1,1),
video::S3DVertex(BS/2,BS/2,0, 0,0,0, c, 1,0),
video::S3DVertex(0,BS/2,0, 0,0,0, c, 0,0),
};
u16 indices[] = {0,1,2,2,3,0};
buf->append(vertices, 4, indices, 6);
// Set material
buf->getMaterial().setFlag(video::EMF_LIGHTING, false);
buf->getMaterial().setFlag(video::EMF_BACK_FACE_CULLING, false);
//buf->getMaterial().setTexture(0, NULL);
buf->getMaterial().setTexture
(0, driver->getTexture(getTexturePath("firefly.png").c_str()));
buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, false);
buf->getMaterial().setFlag(video::EMF_FOG_ENABLE, true);
buf->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
// Add to mesh
mesh->addMeshBuffer(buf);
buf->drop();
m_node = smgr->addMeshSceneNode(mesh, NULL);
mesh->drop();
// Set it to use the materials of the meshbuffers directly.
// This is needed for changing the texture in the future
m_node->setReadOnlyMaterials(true);
updateNodePos();
}
void FireflyCAO::removeFromScene()
{
if(m_node == NULL)
return;
m_node->remove();
m_node = NULL;
}
void FireflyCAO::updateLight(u8 light_at_pos)
{
if(m_node == NULL)
return;
u8 li = 255;
video::SColor color(255,li,li,li);
scene::IMesh *mesh = m_node->getMesh();
if(mesh == NULL)
return;
u16 mc = mesh->getMeshBufferCount();
for(u16 j=0; j<mc; j++)
{
scene::IMeshBuffer *buf = mesh->getMeshBuffer(j);
video::S3DVertex *vertices = (video::S3DVertex*)buf->getVertices();
u16 vc = buf->getVertexCount();
for(u16 i=0; i<vc; i++)
{
vertices[i].Color = color;
}
}
}
v3s16 FireflyCAO::getLightPosition()
{
return floatToInt(m_position+v3f(0,BS*0.5,0), BS);
}
void FireflyCAO::updateNodePos()
{
if(m_node == NULL)
return;
//m_node->setPosition(m_position);
m_node->setPosition(pos_translator.vect_show);
v3f rot = m_node->getRotation();
rot.Y = 180.0 - m_yaw;
m_node->setRotation(rot);
}
void FireflyCAO::step(float dtime, ClientEnvironment *env)
{
pos_translator.translate(dtime);
updateNodePos();
}
void FireflyCAO::processMessage(const std::string &data)
{
//dstream<<"FireflyCAO: Got message"<<std::endl;
std::istringstream is(data, std::ios::binary);
// command
u8 cmd = readU8(is);
if(cmd == 0)
{
// pos
m_position = readV3F1000(is);
pos_translator.update(m_position);
// yaw
m_yaw = readF1000(is);
updateNodePos();
}
}
void FireflyCAO::initialize(const std::string &data)
{
//dstream<<"FireflyCAO: Got init data"<<std::endl;
{
std::istringstream is(data, std::ios::binary);
// version
u8 version = readU8(is);
// check version
if(version != 0)
return;
// pos
m_position = readV3F1000(is);
pos_translator.init(m_position);
}
updateNodePos();
}
......@@ -243,6 +243,48 @@ class Oerkki1CAO : public ClientActiveObject
bool m_damage_texture_enabled;
};
/*
FireflyCAO
*/
class FireflyCAO : public ClientActiveObject
{
public:
FireflyCAO();
virtual ~FireflyCAO();
u8 getType() const
{
return ACTIVEOBJECT_TYPE_FIREFLY;
}
static ClientActiveObject* create();
void addToScene(scene::ISceneManager *smgr);
void removeFromScene();
void updateLight(u8 light_at_pos);
v3s16 getLightPosition();
void updateNodePos();
void step(float dtime, ClientEnvironment *env);
void processMessage(const std::string &data);
void initialize(const std::string &data);
core::aabbox3d<f32>* getSelectionBox()
{return &m_selection_box;}
v3f getPosition()
{return m_position;}
private:
core::aabbox3d<f32> m_selection_box;
scene::IMeshSceneNode *m_node;
v3f m_position;
float m_yaw;
SmoothTranslator pos_translator;
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment