Reorganizing stuff (import from temporary git repo)
authorPerttu Ahola <celeron55@gmail.com>
Sat, 25 Jun 2011 01:23:21 +0000 (04:23 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 25 Jun 2011 01:23:21 +0000 (04:23 +0300)
16 files changed:
.gitignore [new file with mode: 0644]
CMakeLists.txt
Makefile.bak [deleted file]
README.txt [new file with mode: 0644]
addlicensecomments.sh [deleted file]
doc/README.txt [deleted file]
genmap.py [deleted file]
makepackage_binary.sh [deleted file]
minetest.sln [deleted file]
minetest.vcproj [deleted file]
old/Makefile.bak [new file with mode: 0644]
old/minetest.sln [new file with mode: 0644]
old/minetest.vcproj [new file with mode: 0644]
pnoise.py [deleted file]
util/genmap.py [new file with mode: 0755]
util/pnoise.py [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..bfa7d59
--- /dev/null
@@ -0,0 +1,21 @@
+map/*
+CMakeFiles/*
+src/CMakeFiles/*
+src/Makefile
+src/cmake_config.h
+src/cmake_install.cmake
+src/jthread/CMakeFiles/*
+src/jthread/Makefile
+src/jthread/cmake_config.h
+src/jthread/cmake_install.cmake
+minetest.conf
+bin/
+CMakeCache.txt
+CPackConfig.cmake
+CPackSourceConfig.cmake
+Makefile
+cmake_install.cmake
+src/jthread/libjthread.a
+debug.txt
+bin/debug.txt
+
index 70d20dea4041f513f34fe53bf3bff783fcec1d6e..516778995621b2dbde7cc9a4c5dce994f5d6e85b 100644 (file)
@@ -59,7 +59,7 @@ elseif(UNIX) # Linux, BSD etc
        set(EXAMPLE_CONF_DIR "share/doc/minetest")
 endif()
 
-install(FILES "doc/README.txt" DESTINATION "${DOCDIR}")
+install(FILES "README.txt" DESTINATION "${DOCDIR}")
 install(FILES "minetest.conf.example" DESTINATION "${DOCDIR}")
 
 #
diff --git a/Makefile.bak b/Makefile.bak
deleted file mode 100644 (file)
index 8ba03f9..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-# Makefile for Irrlicht Examples\r
-# It's usually sufficient to change just the target name and source file list\r
-# and be sure that CXX is set to a valid compiler\r
-SOURCE_FILES = porting.cpp guiMessageMenu.cpp materials.cpp guiTextInputMenu.cpp guiInventoryMenu.cpp irrlichtwrapper.cpp guiPauseMenu.cpp defaultsettings.cpp mapnode.cpp tile.cpp voxel.cpp mapblockobject.cpp inventory.cpp debug.cpp serialization.cpp light.cpp filesys.cpp connection.cpp environment.cpp client.cpp server.cpp socket.cpp mapblock.cpp mapsector.cpp heightmap.cpp map.cpp player.cpp utility.cpp main.cpp test.cpp\r
-\r
-DEBUG_TARGET = debugtest\r
-DEBUG_SOURCES = $(addprefix src/, $(SOURCE_FILES))\r
-DEBUG_BUILD_DIR = debugbuild\r
-DEBUG_OBJECTS = $(addprefix $(DEBUG_BUILD_DIR)/, $(SOURCE_FILES:.cpp=.o))\r
-\r
-FAST_TARGET = fasttest\r
-FAST_SOURCES = $(addprefix src/, $(SOURCE_FILES))\r
-FAST_BUILD_DIR = fastbuild\r
-FAST_OBJECTS = $(addprefix $(FAST_BUILD_DIR)/, $(SOURCE_FILES:.cpp=.o))\r
-\r
-SERVER_TARGET = server\r
-SERVER_SOURCE_FILES = porting.cpp materials.cpp defaultsettings.cpp mapnode.cpp voxel.cpp mapblockobject.cpp inventory.cpp debug.cpp serialization.cpp light.cpp filesys.cpp connection.cpp environment.cpp server.cpp socket.cpp mapblock.cpp mapsector.cpp heightmap.cpp map.cpp player.cpp utility.cpp servermain.cpp test.cpp\r
-SERVER_SOURCES = $(addprefix src/, $(SERVER_SOURCE_FILES))\r
-SERVER_BUILD_DIR = serverbuild\r
-SERVER_OBJECTS = $(addprefix $(SERVER_BUILD_DIR)/, $(SERVER_SOURCE_FILES:.cpp=.o))\r
-\r
-IRRLICHTPATH = ../irrlicht/irrlicht-1.7.1\r
-JTHREADPATH = ../jthread/jthread-1.2.1\r
-\r
-\r
-all: fast\r
-\r
-ifeq ($(HOSTTYPE), x86_64)\r
-LIBSELECT=64\r
-endif\r
-\r
-debug: CXXFLAGS = -Wall -g -O1\r
-debug: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DDEBUG -DRUN_IN_PLACE\r
-debug: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L$(IRRLICHTPATH)/lib/Linux -L$(JTHREADPATH)/src/.libs -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -ljthread -lz\r
-\r
-fast: CXXFLAGS = -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops -mtune=i686\r
-fast: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DUNITTEST_DISABLE -DRUN_IN_PLACE\r
-fast: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L$(IRRLICHTPATH)/lib/Linux -L$(JTHREADPATH)/src/.libs -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -ljthread -lz\r
-\r
-server: CXXFLAGS = -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops -mtune=i686\r
-server: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DSERVER -DUNITTEST_DISABLE -DRUN_IN_PLACE\r
-server: LDFLAGS = -L$(JTHREADPATH)/src/.libs -ljthread -lz -lpthread\r
-\r
-DEBUG_DESTPATH = bin/$(DEBUG_TARGET)\r
-FAST_DESTPATH = bin/$(FAST_TARGET)\r
-SERVER_DESTPATH = bin/$(SERVER_TARGET)\r
-\r
-# Build commands\r
-\r
-debug: $(DEBUG_BUILD_DIR) $(DEBUG_DESTPATH)\r
-fast: $(FAST_BUILD_DIR) $(FAST_DESTPATH)\r
-server: $(SERVER_BUILD_DIR) $(SERVER_DESTPATH)\r
-\r
-$(DEBUG_BUILD_DIR):\r
-       mkdir -p $(DEBUG_BUILD_DIR)\r
-$(FAST_BUILD_DIR):\r
-       mkdir -p $(FAST_BUILD_DIR)\r
-$(SERVER_BUILD_DIR):\r
-       mkdir -p $(SERVER_BUILD_DIR)\r
-\r
-$(DEBUG_DESTPATH): $(DEBUG_OBJECTS)\r
-       $(CXX) -o $@ $(DEBUG_OBJECTS) $(LDFLAGS)\r
-\r
-$(FAST_DESTPATH): $(FAST_OBJECTS)\r
-       $(CXX) -o $@ $(FAST_OBJECTS) $(LDFLAGS)\r
-\r
-$(SERVER_DESTPATH): $(SERVER_OBJECTS)\r
-       $(CXX) -o $@ $(SERVER_OBJECTS) $(LDFLAGS)\r
-\r
-$(DEBUG_BUILD_DIR)/%.o: src/%.cpp\r
-       $(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS)\r
-\r
-$(FAST_BUILD_DIR)/%.o: src/%.cpp\r
-       $(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS)\r
-\r
-$(SERVER_BUILD_DIR)/%.o: src/%.cpp\r
-       $(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS)\r
-\r
-clean: clean_debug clean_fast clean_server\r
-\r
-clean_debug:\r
-       @$(RM) $(DEBUG_OBJECTS) $(DEBUG_DESTPATH)\r
-\r
-clean_fast:\r
-       @$(RM) $(FAST_OBJECTS) $(FAST_DESTPATH)\r
-\r
-clean_server:\r
-       @$(RM) $(SERVER_OBJECTS) $(SERVER_DESTPATH)\r
-\r
-.PHONY: all all_win32 clean clean_debug clean_win32 clean_fast clean_server\r
diff --git a/README.txt b/README.txt
new file mode 100644 (file)
index 0000000..4104899
--- /dev/null
@@ -0,0 +1,239 @@
+Minetest-c55
+---------------
+An InfiniMiner/Minecraft inspired game.
+Copyright (c) 2010-2011 Perttu Ahola <celeron55@gmail.com>
+(see source files for other contributors)
+
+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/
+- doc/ directory of source distribution
+
+This game is not finished:
+--------------------------
+- Don't expect it to work as well as a finished game will.
+- Please report any bugs to me. debug.txt is useful.
+
+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.
+
+
diff --git a/addlicensecomments.sh b/addlicensecomments.sh
deleted file mode 100644 (file)
index e5642e8..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-for i in `grep -L 'This program is free software' src/*.{h,cpp}`
-do
-       cat licensecomment.txt > tempfile
-       cat $i >> tempfile
-       cp tempfile $i
-done
-rm tempfile
-
diff --git a/doc/README.txt b/doc/README.txt
deleted file mode 100644 (file)
index 645e2a5..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-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.
-
-
diff --git a/genmap.py b/genmap.py
deleted file mode 100755 (executable)
index a605094..0000000
--- a/genmap.py
+++ /dev/null
@@ -1,271 +0,0 @@
-#!/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
diff --git a/makepackage_binary.sh b/makepackage_binary.sh
deleted file mode 100755 (executable)
index f00ec60..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/sh
-
-PACKAGEDIR=../minetest-packages
-PACKAGENAME=minetest-c55-binary-`date +%y%m%d%H%M%S`
-PACKAGEPATH=$PACKAGEDIR/$PACKAGENAME
-
-mkdir -p $PACKAGEPATH
-mkdir -p $PACKAGEPATH/bin
-mkdir -p $PACKAGEPATH/data
-mkdir -p $PACKAGEPATH/doc
-
-cp minetest.conf.example $PACKAGEPATH/
-
-cp bin/minetest.exe $PACKAGEPATH/bin/
-cp bin/Irrlicht.dll $PACKAGEPATH/bin/
-cp bin/zlibwapi.dll $PACKAGEPATH/bin/
-#cp bin/test $PACKAGEPATH/bin/
-#cp bin/fasttest $PACKAGEPATH/bin/
-#cp bin/server $PACKAGEPATH/bin/
-#cp ../irrlicht/irrlicht-1.7.1/lib/Linux/libIrrlicht.a $PACKAGEPATH/bin/
-#cp ../jthread/jthread-1.2.1/src/.libs/libjthread-1.2.1.so $PACKAGEPATH/bin/
-
-cp -r data/fontlucida.png $PACKAGEPATH/data/
-cp -r data/player.png $PACKAGEPATH/data/
-cp -r data/player_back.png $PACKAGEPATH/data/
-cp -r data/stone.png $PACKAGEPATH/data/
-cp -r data/grass.png $PACKAGEPATH/data/
-cp -r data/grass_footsteps.png $PACKAGEPATH/data/
-cp -r data/water.png $PACKAGEPATH/data/
-cp -r data/tree.png $PACKAGEPATH/data/
-cp -r data/leaves.png $PACKAGEPATH/data/
-cp -r data/mese.png $PACKAGEPATH/data/
-cp -r data/cloud.png $PACKAGEPATH/data/
-cp -r data/sign.png $PACKAGEPATH/data/
-cp -r data/sign_back.png $PACKAGEPATH/data/
-cp -r data/rat.png $PACKAGEPATH/data/
-cp -r data/mud.png $PACKAGEPATH/data/
-cp -r data/torch.png $PACKAGEPATH/data/
-cp -r data/torch_on_floor.png $PACKAGEPATH/data/
-cp -r data/torch_on_ceiling.png $PACKAGEPATH/data/
-cp -r data/tree_top.png $PACKAGEPATH/data/
-cp -r data/coalstone.png $PACKAGEPATH/data/
-cp -r data/crack.png $PACKAGEPATH/data/
-cp -r data/wood.png $PACKAGEPATH/data/
-cp -r data/stick.png $PACKAGEPATH/data/
-cp -r data/tool_wpick.png $PACKAGEPATH/data/
-cp -r data/tool_stpick.png $PACKAGEPATH/data/
-cp -r data/tool_mesepick.png $PACKAGEPATH/data/
-cp -r data/grass_side.png $PACKAGEPATH/data/
-cp -r data/lump_of_coal.png $PACKAGEPATH/data/
-cp -r data/lump_of_iron.png $PACKAGEPATH/data/
-cp -r data/mineral_coal.png $PACKAGEPATH/data/
-cp -r data/mineral_iron.png $PACKAGEPATH/data/
-cp -r data/sand.png $PACKAGEPATH/data/
-
-#cp -r data/pauseMenu.gui $PACKAGEPATH/data/
-
-cp -r doc/README.txt $PACKAGEPATH/doc/README.txt
-
-cd $PACKAGEDIR
-rm $PACKAGENAME.zip
-zip -r $PACKAGENAME.zip $PACKAGENAME
-
diff --git a/minetest.sln b/minetest.sln
deleted file mode 100644 (file)
index d1f144c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-\r
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual C++ Express 2005\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minetest", "minetest.vcproj", "{AE3BF173-1D74-4294-AAB8-5A0ACDE9990D}"\r
-EndProject\r
-Global\r
-       GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
-               Debug|Win32 = Debug|Win32\r
-               Release|Win32 = Release|Win32\r
-       EndGlobalSection\r
-       GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
-               {AE3BF173-1D74-4294-AAB8-5A0ACDE9990D}.Debug|Win32.ActiveCfg = Debug|Win32\r
-               {AE3BF173-1D74-4294-AAB8-5A0ACDE9990D}.Debug|Win32.Build.0 = Debug|Win32\r
-               {AE3BF173-1D74-4294-AAB8-5A0ACDE9990D}.Release|Win32.ActiveCfg = Release|Win32\r
-               {AE3BF173-1D74-4294-AAB8-5A0ACDE9990D}.Release|Win32.Build.0 = Release|Win32\r
-       EndGlobalSection\r
-       GlobalSection(SolutionProperties) = preSolution\r
-               HideSolutionNode = FALSE\r
-       EndGlobalSection\r
-EndGlobal\r
diff --git a/minetest.vcproj b/minetest.vcproj
deleted file mode 100644 (file)
index 8973c9a..0000000
+++ /dev/null
@@ -1,424 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>\r
-<VisualStudioProject\r
-       ProjectType="Visual C++"\r
-       Version="8,00"\r
-       Name="minetest"\r
-       ProjectGUID="{AE3BF173-1D74-4294-AAB8-5A0ACDE9990D}"\r
-       RootNamespace="minetest"\r
-       >\r
-       <Platforms>\r
-               <Platform\r
-                       Name="Win32"\r
-               />\r
-       </Platforms>\r
-       <ToolFiles>\r
-       </ToolFiles>\r
-       <Configurations>\r
-               <Configuration\r
-                       Name="Debug|Win32"\r
-                       OutputDirectory="$(SolutionDir)\bin"\r
-                       IntermediateDirectory="$(ConfigurationName)"\r
-                       ConfigurationType="1"\r
-                       UseOfATL="1"\r
-                       ATLMinimizesCRunTimeLibraryUsage="true"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               AdditionalIncludeDirectories="&quot;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include&quot;;&quot;..\jthread\jthread-1.2.1\src&quot;;&quot;..\irrlicht\irrlicht-1.7.1\include&quot;;&quot;..\zlib\zlib-1.2.5&quot;"\r
-                               PreprocessorDefinitions="WIN32;RUN_IN_PLACE"\r
-                               BufferSecurityCheck="true"\r
-                               EnableEnhancedInstructionSet="1"\r
-                               FloatingPointModel="2"\r
-                               DebugInformationFormat="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="wsock32.lib"\r
-                               AdditionalLibraryDirectories="&quot;..\irrlicht\irrlicht-1.7.1\lib\Win32-visualstudio&quot;;..\zlib125dll\dll32"\r
-                               IgnoreAllDefaultLibraries="false"\r
-                               GenerateDebugInformation="true"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|Win32"\r
-                       OutputDirectory="$(SolutionDir)\bin"\r
-                       IntermediateDirectory="$(ConfigurationName)"\r
-                       ConfigurationType="1"\r
-                       UseOfMFC="0"\r
-                       WholeProgramOptimization="3"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               Optimization="2"\r
-                               InlineFunctionExpansion="2"\r
-                               EnableIntrinsicFunctions="true"\r
-                               FavorSizeOrSpeed="1"\r
-                               OmitFramePointers="true"\r
-                               WholeProgramOptimization="true"\r
-                               AdditionalIncludeDirectories="&quot;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include&quot;;&quot;..\jthread\jthread-1.2.1\src&quot;;&quot;..\irrlicht\irrlicht-1.7.1\include&quot;;&quot;..\zlib\zlib-1.2.5&quot;"\r
-                               PreprocessorDefinitions="WIN32;_HAS_ITERATOR_DEBUGGING=0;NDEBUG;_CRT_SECURE_NO_DEPRECATE;RUN_IN_PLACE"\r
-                               ExceptionHandling="2"\r
-                               BufferSecurityCheck="false"\r
-                               EnableEnhancedInstructionSet="1"\r
-                               FloatingPointModel="2"\r
-                               DebugInformationFormat="0"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               AdditionalDependencies="wsock32.lib"\r
-                               AdditionalLibraryDirectories="&quot;..\irrlicht\irrlicht-1.7.1\lib\Win32-visualstudio&quot;;..\zlib125dll\dll32"\r
-                               IgnoreDefaultLibraryNames="libcmtd.dll"\r
-                               GenerateDebugInformation="false"\r
-                               LinkTimeCodeGeneration="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-       </Configurations>\r
-       <References>\r
-       </References>\r
-       <Files>\r
-               <Filter\r
-                       Name="Source Files"\r
-                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
-                       >\r
-                       <File\r
-                               RelativePath=".\src\client.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\connection.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\debug.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\defaultsettings.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\environment.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\filesys.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\guiInventoryMenu.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\guiMainMenu.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\guiMessageMenu.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\guiPauseMenu.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\guiTextInputMenu.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\inventory.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\irrlichtwrapper.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\jthread\win32\jmutex.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\jthread\win32\jthread.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\light.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\main.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\map.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\mapblock.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\mapblockobject.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\mapnode.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\mapsector.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\materials.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\mineral.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\noise.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\player.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\porting.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\serialization.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\server.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\socket.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\test.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\tile.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\utility.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\voxel.cpp"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Header Files"\r
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
-                       >\r
-                       <File\r
-                               RelativePath=".\src\client.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\clientserver.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\common_irrlicht.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\connection.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\constants.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\debug.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\environment.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\exceptions.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\heightmap.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\inventory.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\light.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\loadstatus.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\main.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\map.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\mapblock.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\mapnode.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\mapsector.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\player.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\serialization.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\server.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\socket.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\test.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\src\utility.h"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Resource Files"\r
-                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
-                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
-                       >\r
-               </Filter>\r
-       </Files>\r
-       <Globals>\r
-       </Globals>\r
-</VisualStudioProject>\r
diff --git a/old/Makefile.bak b/old/Makefile.bak
new file mode 100644 (file)
index 0000000..8ba03f9
--- /dev/null
@@ -0,0 +1,90 @@
+# Makefile for Irrlicht Examples\r
+# It's usually sufficient to change just the target name and source file list\r
+# and be sure that CXX is set to a valid compiler\r
+SOURCE_FILES = porting.cpp guiMessageMenu.cpp materials.cpp guiTextInputMenu.cpp guiInventoryMenu.cpp irrlichtwrapper.cpp guiPauseMenu.cpp defaultsettings.cpp mapnode.cpp tile.cpp voxel.cpp mapblockobject.cpp inventory.cpp debug.cpp serialization.cpp light.cpp filesys.cpp connection.cpp environment.cpp client.cpp server.cpp socket.cpp mapblock.cpp mapsector.cpp heightmap.cpp map.cpp player.cpp utility.cpp main.cpp test.cpp\r
+\r
+DEBUG_TARGET = debugtest\r
+DEBUG_SOURCES = $(addprefix src/, $(SOURCE_FILES))\r
+DEBUG_BUILD_DIR = debugbuild\r
+DEBUG_OBJECTS = $(addprefix $(DEBUG_BUILD_DIR)/, $(SOURCE_FILES:.cpp=.o))\r
+\r
+FAST_TARGET = fasttest\r
+FAST_SOURCES = $(addprefix src/, $(SOURCE_FILES))\r
+FAST_BUILD_DIR = fastbuild\r
+FAST_OBJECTS = $(addprefix $(FAST_BUILD_DIR)/, $(SOURCE_FILES:.cpp=.o))\r
+\r
+SERVER_TARGET = server\r
+SERVER_SOURCE_FILES = porting.cpp materials.cpp defaultsettings.cpp mapnode.cpp voxel.cpp mapblockobject.cpp inventory.cpp debug.cpp serialization.cpp light.cpp filesys.cpp connection.cpp environment.cpp server.cpp socket.cpp mapblock.cpp mapsector.cpp heightmap.cpp map.cpp player.cpp utility.cpp servermain.cpp test.cpp\r
+SERVER_SOURCES = $(addprefix src/, $(SERVER_SOURCE_FILES))\r
+SERVER_BUILD_DIR = serverbuild\r
+SERVER_OBJECTS = $(addprefix $(SERVER_BUILD_DIR)/, $(SERVER_SOURCE_FILES:.cpp=.o))\r
+\r
+IRRLICHTPATH = ../irrlicht/irrlicht-1.7.1\r
+JTHREADPATH = ../jthread/jthread-1.2.1\r
+\r
+\r
+all: fast\r
+\r
+ifeq ($(HOSTTYPE), x86_64)\r
+LIBSELECT=64\r
+endif\r
+\r
+debug: CXXFLAGS = -Wall -g -O1\r
+debug: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DDEBUG -DRUN_IN_PLACE\r
+debug: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L$(IRRLICHTPATH)/lib/Linux -L$(JTHREADPATH)/src/.libs -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -ljthread -lz\r
+\r
+fast: CXXFLAGS = -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops -mtune=i686\r
+fast: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DUNITTEST_DISABLE -DRUN_IN_PLACE\r
+fast: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L$(IRRLICHTPATH)/lib/Linux -L$(JTHREADPATH)/src/.libs -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -ljthread -lz\r
+\r
+server: CXXFLAGS = -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops -mtune=i686\r
+server: CPPFLAGS = -I$(IRRLICHTPATH)/include -I/usr/X11R6/include -I$(JTHREADPATH)/src -DSERVER -DUNITTEST_DISABLE -DRUN_IN_PLACE\r
+server: LDFLAGS = -L$(JTHREADPATH)/src/.libs -ljthread -lz -lpthread\r
+\r
+DEBUG_DESTPATH = bin/$(DEBUG_TARGET)\r
+FAST_DESTPATH = bin/$(FAST_TARGET)\r
+SERVER_DESTPATH = bin/$(SERVER_TARGET)\r
+\r
+# Build commands\r
+\r
+debug: $(DEBUG_BUILD_DIR) $(DEBUG_DESTPATH)\r
+fast: $(FAST_BUILD_DIR) $(FAST_DESTPATH)\r
+server: $(SERVER_BUILD_DIR) $(SERVER_DESTPATH)\r
+\r
+$(DEBUG_BUILD_DIR):\r
+       mkdir -p $(DEBUG_BUILD_DIR)\r
+$(FAST_BUILD_DIR):\r
+       mkdir -p $(FAST_BUILD_DIR)\r
+$(SERVER_BUILD_DIR):\r
+       mkdir -p $(SERVER_BUILD_DIR)\r
+\r
+$(DEBUG_DESTPATH): $(DEBUG_OBJECTS)\r
+       $(CXX) -o $@ $(DEBUG_OBJECTS) $(LDFLAGS)\r
+\r
+$(FAST_DESTPATH): $(FAST_OBJECTS)\r
+       $(CXX) -o $@ $(FAST_OBJECTS) $(LDFLAGS)\r
+\r
+$(SERVER_DESTPATH): $(SERVER_OBJECTS)\r
+       $(CXX) -o $@ $(SERVER_OBJECTS) $(LDFLAGS)\r
+\r
+$(DEBUG_BUILD_DIR)/%.o: src/%.cpp\r
+       $(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS)\r
+\r
+$(FAST_BUILD_DIR)/%.o: src/%.cpp\r
+       $(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS)\r
+\r
+$(SERVER_BUILD_DIR)/%.o: src/%.cpp\r
+       $(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS)\r
+\r
+clean: clean_debug clean_fast clean_server\r
+\r
+clean_debug:\r
+       @$(RM) $(DEBUG_OBJECTS) $(DEBUG_DESTPATH)\r
+\r
+clean_fast:\r
+       @$(RM) $(FAST_OBJECTS) $(FAST_DESTPATH)\r
+\r
+clean_server:\r
+       @$(RM) $(SERVER_OBJECTS) $(SERVER_DESTPATH)\r
+\r
+.PHONY: all all_win32 clean clean_debug clean_win32 clean_fast clean_server\r
diff --git a/old/minetest.sln b/old/minetest.sln
new file mode 100644 (file)
index 0000000..d1f144c
--- /dev/null
@@ -0,0 +1,20 @@
+\r
+Microsoft Visual Studio Solution File, Format Version 9.00\r
+# Visual C++ Express 2005\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minetest", "minetest.vcproj", "{AE3BF173-1D74-4294-AAB8-5A0ACDE9990D}"\r
+EndProject\r
+Global\r
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+               Debug|Win32 = Debug|Win32\r
+               Release|Win32 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+               {AE3BF173-1D74-4294-AAB8-5A0ACDE9990D}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {AE3BF173-1D74-4294-AAB8-5A0ACDE9990D}.Debug|Win32.Build.0 = Debug|Win32\r
+               {AE3BF173-1D74-4294-AAB8-5A0ACDE9990D}.Release|Win32.ActiveCfg = Release|Win32\r
+               {AE3BF173-1D74-4294-AAB8-5A0ACDE9990D}.Release|Win32.Build.0 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(SolutionProperties) = preSolution\r
+               HideSolutionNode = FALSE\r
+       EndGlobalSection\r
+EndGlobal\r
diff --git a/old/minetest.vcproj b/old/minetest.vcproj
new file mode 100644 (file)
index 0000000..8973c9a
--- /dev/null
@@ -0,0 +1,424 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8,00"\r
+       Name="minetest"\r
+       ProjectGUID="{AE3BF173-1D74-4294-AAB8-5A0ACDE9990D}"\r
+       RootNamespace="minetest"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)\bin"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       UseOfATL="1"\r
+                       ATLMinimizesCRunTimeLibraryUsage="true"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               AdditionalIncludeDirectories="&quot;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include&quot;;&quot;..\jthread\jthread-1.2.1\src&quot;;&quot;..\irrlicht\irrlicht-1.7.1\include&quot;;&quot;..\zlib\zlib-1.2.5&quot;"\r
+                               PreprocessorDefinitions="WIN32;RUN_IN_PLACE"\r
+                               BufferSecurityCheck="true"\r
+                               EnableEnhancedInstructionSet="1"\r
+                               FloatingPointModel="2"\r
+                               DebugInformationFormat="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="wsock32.lib"\r
+                               AdditionalLibraryDirectories="&quot;..\irrlicht\irrlicht-1.7.1\lib\Win32-visualstudio&quot;;..\zlib125dll\dll32"\r
+                               IgnoreAllDefaultLibraries="false"\r
+                               GenerateDebugInformation="true"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)\bin"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       UseOfMFC="0"\r
+                       WholeProgramOptimization="3"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               InlineFunctionExpansion="2"\r
+                               EnableIntrinsicFunctions="true"\r
+                               FavorSizeOrSpeed="1"\r
+                               OmitFramePointers="true"\r
+                               WholeProgramOptimization="true"\r
+                               AdditionalIncludeDirectories="&quot;C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include&quot;;&quot;..\jthread\jthread-1.2.1\src&quot;;&quot;..\irrlicht\irrlicht-1.7.1\include&quot;;&quot;..\zlib\zlib-1.2.5&quot;"\r
+                               PreprocessorDefinitions="WIN32;_HAS_ITERATOR_DEBUGGING=0;NDEBUG;_CRT_SECURE_NO_DEPRECATE;RUN_IN_PLACE"\r
+                               ExceptionHandling="2"\r
+                               BufferSecurityCheck="false"\r
+                               EnableEnhancedInstructionSet="1"\r
+                               FloatingPointModel="2"\r
+                               DebugInformationFormat="0"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="wsock32.lib"\r
+                               AdditionalLibraryDirectories="&quot;..\irrlicht\irrlicht-1.7.1\lib\Win32-visualstudio&quot;;..\zlib125dll\dll32"\r
+                               IgnoreDefaultLibraryNames="libcmtd.dll"\r
+                               GenerateDebugInformation="false"\r
+                               LinkTimeCodeGeneration="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\src\client.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\connection.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\debug.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\defaultsettings.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\environment.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\filesys.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\guiInventoryMenu.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\guiMainMenu.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\guiMessageMenu.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\guiPauseMenu.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\guiTextInputMenu.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\inventory.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\irrlichtwrapper.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\jthread\win32\jmutex.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\jthread\win32\jthread.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\light.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\main.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\map.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\mapblock.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\mapblockobject.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\mapnode.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\mapsector.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\materials.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\mineral.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\noise.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\player.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\porting.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\serialization.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\server.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\socket.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\test.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\tile.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\utility.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\voxel.cpp"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\src\client.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\clientserver.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\common_irrlicht.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\connection.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\constants.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\debug.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\environment.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\exceptions.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\heightmap.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\inventory.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\light.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\loadstatus.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\main.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\map.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\mapblock.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\mapnode.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\mapsector.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\player.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\serialization.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\server.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\socket.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\test.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\src\utility.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/pnoise.py b/pnoise.py
deleted file mode 100644 (file)
index fcab5ac..0000000
--- a/pnoise.py
+++ /dev/null
@@ -1,102 +0,0 @@
-#
-# 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/util/genmap.py b/util/genmap.py
new file mode 100755 (executable)
index 0000000..6b36269
--- /dev/null
@@ -0,0 +1,271 @@
+#!/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
diff --git a/util/pnoise.py b/util/pnoise.py
new file mode 100644 (file)
index 0000000..fcab5ac
--- /dev/null
@@ -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)))